Figure 23. ImqReferenceHeader class

This class encapsulates specific features of the MQRMH data
structure. It relates to the MQI calls listed in Table 24.
ImqBinary (see ImqBinary)
ImqHeader (see ImqHeader)
ImqItem (see ImqItem)
ImqMessage (see ImqMessage)
ImqString (see ImqString)
- 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
- 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.
- ImqReferenceHeader( );
- The default constructor.
- ImqReferenceHeader( const ImqReferenceHeader &
header );
- The copy constructor.
- 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" 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" for further details.
- void operator = ( const ImqReferenceHeader &
header );
- Instance data is copied 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 may be zero, which is
the same as specifying MQOII_NONE. If id is nonzero, then it
must address MQ_OBJECT_INSTANCE_ID_LENGTH bytes of binary data. When
using pre-defined values such as MQOII_NONE, it may be necessary 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.
- MQRMH omqrmh
- The MQRMH data structure.
MQRC_BINARY_DATA_LENGTH_ERROR
MQRC_STRUC_LENGTH_ERROR
MQRC_STRUC_ID_ERROR
MQRC_INSUFFICIENT_DATA
MQRC_INCONSISTENT_FORMAT
MQRC_ENCODING_ERROR
© IBM Corporation 2001. All Rights Reserved