ImqReferenceHeader C++ class
This class encapsulates features of the MQRMH data structure.

This class relates to the MQI calls listed in ImqReferenceHeader cross-reference.
Object attributes
- destination environment
- Environment for the destination. The initial value is a null string.
- destination name
- Name of the data destination. The initial value is a null string.
- instance id
- Instance identifier. A binary value (MQBYTE24) of length MQ_OBJECT_INSTANCE_ID_LENGTH. The initial value is MQOII_NONE.
- logical length
- Logical, or intended, length of message data that follows this header. The initial value is zero.
- logical offset
- Logical offset for the message data that follows, to be interpreted in the context of the data as a whole, at the ultimate destination. The initial value is zero.
- logical offset 2
- High-order extension to the logical offset. The initial value is zero.
- reference type
- Reference type. The initial value is a null string.
- source environment
- Environment for the source. The initial value is a null string.
- source name
- Name of the data source. The initial value is a null string.
Constructors
- ImqReferenceHeader( );
- The default constructor.
- ImqReferenceHeader( const ImqReferenceHeader & header );
- The copy constructor.
Overloaded ImqItem methods
- virtual ImqBoolean copyOut( ImqMessage & msg );
- Inserts an MQRMH data structure into the message buffer at the
beginning, moving existing message data further along, and sets the msg format to
MQFMT_REF_MSG_HEADER.
See the ImqHeader class method description on ImqHeader C++ class for further details.
- virtual ImqBoolean pasteIn( ImqMessage & msg );
- Reads an MQRMH data structure from the message buffer.
To be successful, the ImqMessage format must be MQFMT_REF_MSG_HEADER.
See the ImqHeader class method description on ImqHeader C++ class for further details.
Object methods (public)
- void operator = ( const ImqReferenceHeader & header );
- Copies instance data from header, replacing the existing instance data.
- ImqString destinationEnvironment( ) const ;
- Returns a copy of the destination environment.
- void setDestinationEnvironment( const char * environment = 0 );
- Sets the destination environment.
- ImqString destinationName( ) const ;
- Returns a copy of the destination name.
- void setDestinationName( const char * name = 0 );
- Sets the destination name.
- ImqBinary instanceId( ) const ;
- Returns a copy of the instance id.
- ImqBoolean setInstanceId( const ImqBinary & id );
- Sets the instance id. The data length of token must be either 0 or MQ_OBJECT_INSTANCE_ID_LENGTH. This method returns TRUE if successful.
- void setInstanceId( const MQBYTE24 id = 0 );
- Sets the instance id. id can be zero, which is the same as specifying MQOII_NONE. If id is nonzero, it must address MQ_OBJECT_INSTANCE_ID_LENGTH bytes of binary data. When using pre-defined values such as MQOII_NONE, you might need to make a cast to ensure a signature match, for example (MQBYTE *)MQOII_NONE.
- MQLONG logicalLength( ) const ;
- Returns the logical length.
- void setLogicalLength( const MQLONG length );
- Sets the logical length.
- MQLONG logicalOffset( ) const ;
- Returns the logical offset.
- void setLogicalOffset( const MQLONG offset );
- Sets the logical offset.
- MQLONG logicalOffset2( ) const ;
- Returns the logical offset 2.
- void setLogicalOffset2( const MQLONG offset );
- Sets the logical offset 2.
- ImqString referenceType( ) const ;
- Returns a copy of the reference type.
- void setReferenceType( const char * name = 0 );
- Sets the reference type.
- ImqString sourceEnvironment( ) const ;
- Returns a copy of the source environment.
- void setSourceEnvironment( const char * environment = 0 );
- Sets the source environment.
- ImqString sourceName( ) const ;
- Returns a copy of the source name.
- void setSourceName( const char * name = 0 );
- Sets the source name.
Object data (protected)
- MQRMH omqrmh
- The MQRMH data structure.
Reason codes
- MQRC_BINARY_DATA_LENGTH_ERROR
- MQRC_STRUC_LENGTH_ERROR
- MQRC_STRUC_ID_ERROR
- MQRC_INSUFFICIENT_DATA
- MQRC_INCONSISTENT_FORMAT
- MQRC_ENCODING_ERROR