EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Friends
thomsonreuters::ema::access::GenericMsg Class Reference

GenericMsg allows applications to bidirectionally send messages without any implied message semantics. More...

Inheritance diagram for thomsonreuters::ema::access::GenericMsg:
thomsonreuters::ema::access::Msg thomsonreuters::ema::access::ComplexType thomsonreuters::ema::access::Data

Public Member Functions

Constructor
 GenericMsg ()
 
 GenericMsg (const GenericMsg &other)
 
Destructor
virtual ~GenericMsg ()
 
Accessors
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
bool hasSeqNum () const
 
bool hasSecondarySeqNum () const
 
bool hasPartNum () const
 
bool hasPermissionData () const
 
UInt32 getSeqNum () const
 
UInt32 getSecondarySeqNum () const
 
UInt16 getPartNum () const
 
const EmaBuffergetPermissionData () const
 
bool getComplete () const
 
Operations
GenericMsgclear ()
 
GenericMsgstreamId (Int32 streamId)
 
GenericMsgdomainType (UInt16 domainType=rdm::MMT_MARKET_PRICE)
 
GenericMsgname (const EmaString &name)
 
GenericMsgnameType (UInt8 nameType=rdm::INSTRUMENT_NAME_RIC)
 
GenericMsgserviceId (UInt32 serviceId)
 
GenericMsgid (Int32 id)
 
GenericMsgfilter (UInt32 filter)
 
GenericMsgseqNum (UInt32 seqNum)
 
GenericMsgsecondarySeqNum (UInt32 secondarySeqNum)
 
GenericMsgpartNum (UInt16 partNum)
 
GenericMsgpermissionData (const EmaBuffer &permissionData)
 
GenericMsgattrib (const ComplexType &data)
 
GenericMsgpayload (const ComplexType &data)
 
GenericMsgextendedHeader (const EmaBuffer &buffer)
 
GenericMsgproviderDriven (bool providerDriven=true)
 
GenericMsgcomplete (bool complete=true)
 
- Public Member Functions inherited from thomsonreuters::ema::access::Msg
bool hasMsgKey () const
 
bool hasName () const
 
bool hasNameType () const
 
bool hasServiceId () const
 
bool hasId () const
 
bool hasFilter () const
 
bool hasExtendedHeader () const
 
Int32 getStreamId () const
 
UInt16 getDomainType () const
 
const EmaStringgetName () const
 
UInt8 getNameType () const
 
UInt32 getServiceId () const
 
Int32 getId () const
 
UInt32 getFilter () const
 
const EmaBuffergetExtendedHeader () const
 
const AttribgetAttrib () const
 
const PayloadgetPayload () const
 
virtual ~Msg ()
 
- Public Member Functions inherited from thomsonreuters::ema::access::ComplexType
virtual ~ComplexType ()
 
- Public Member Functions inherited from thomsonreuters::ema::access::Data
const EmaStringgetCodeAsString () const
 
 operator const char * () const
 
virtual ~Data ()
 

Friends

class ItemCallbackClient
 

Additional Inherited Members

- Public Types inherited from thomsonreuters::ema::access::Data
enum  DataCode {
  NoCodeEnum = 0,
  BlankEnum = 1
}
 
- Protected Member Functions inherited from thomsonreuters::ema::access::Msg
const Encoder & getEncoder () const
 
bool hasDecoder () const
 
bool hasEncoder () const
 
 Msg ()
 
void setDecoder (MsgDecoder *)
 
- Protected Member Functions inherited from thomsonreuters::ema::access::ComplexType
 ComplexType ()
 
- Protected Member Functions inherited from thomsonreuters::ema::access::Data
 Data ()
 
- Protected Attributes inherited from thomsonreuters::ema::access::Msg
Attrib _attrib
 
Payload _payload
 
MsgDecoder_pDecoder
 
MsgEncoder * _pEncoder
 

Detailed Description

GenericMsg may be sent on any item stream using OmmConsumer::submit( const GenericMsg& , UInt64 ).

The following code snippet shows processing of received GenericMsg.

class AppClient : public OmmConsumerClient
{
...
void onGenericMsg( const GenericMsg& , const OmmConsumerEvent& );
};
void AppClient::onGenericMsg( const GenericMsg& genMsg, const OmmConsumerEvent& )
{
if ( genMsg.hasName() )
cout << genMsg.getName() << "\n";
switch ( gemMsg.getPayload().getDataTyoe() )
{
decode( genMsg.getPayload().getFieldList() );
break;
break;
}
}

The following code snippet shows setting and submission of GenericMsg.

GenericMsg genMsg;
genMsg.name( "my generic message" );
elist.addInt( "int", 123 ).addAscii( "ascii", "my ascii" ).complete();
genMsg.payload( eList );
genMsg.complete( true );
consumer.submit( genMsg, itemHandle );
Remarks
Calling get***() method on an optional member of GenericMsg must be preceded by a call to respective has***() method.
Objects of this class are intended to be short lived or rather transitional.
This class is designed to efficiently perform setting and getting of information from GenericMsg.
Objects of this class are not cache-able.
Decoding of just encoded GenericMsg in the same application is not supported.
All methods in this class are Lock-free Method.
See Also
Data, Msg, EmaString, EmaBuffer,

Definition at line 86 of file GenericMsg.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::GenericMsg::GenericMsg ( )

Constructs GenericMsg.

thomsonreuters::ema::access::GenericMsg::GenericMsg ( const GenericMsg other)

Copy constructor.

Remarks
this is used to copy and process GenericMsg outside of EMA's callback methods.
this method does not support passing in just encoded GenericMsg in the application space.
virtual thomsonreuters::ema::access::GenericMsg::~GenericMsg ( )
virtual

Destructor.

Member Function Documentation

GenericMsg& thomsonreuters::ema::access::GenericMsg::attrib ( const ComplexType data)

Specifies Attrib.

Parameters
[in]attriban object of ComplexType
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::clear ( )

Clears the GenericMsg.

Remarks
Invoking clear() method clears all the values and resets all the defaults
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::complete ( bool  complete = true)

Specifies Complete.

Remarks
must be set to true for one part generic message
Parameters
[in]completespecifies if this is the last part of the multi part generic message
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::domainType ( UInt16  domainType = rdm::MMT_MARKET_PRICE)

Specifies DomainType.

Exceptions
OmmUnsupportedDomainTypeExceptionif domainType is greater than 255
Parameters
[in]domainTypespecifies RDM Message Model Type (default value is rdm::MMT_MARKET_PRICE)
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::extendedHeader ( const EmaBuffer buffer)

Specifies ExtendedHeader.

Parameters
[in]bufferan EmaBuffer containing extendedHeader information
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::filter ( UInt32  filter)

Specifies Filter.

Parameters
[in]filterspecifies filter
Returns
reference to this object
const EmaBuffer& thomsonreuters::ema::access::GenericMsg::getAsHex ( ) const
virtual

Returns a buffer that in turn provides an alphanumeric null-terminated hexadecimal string representation.

Returns
a buffer with the message hex information

Implements thomsonreuters::ema::access::Data.

Data::DataCode thomsonreuters::ema::access::GenericMsg::getCode ( ) const
virtual

Returns the Code, which indicates a special state of a DataType.

Returns
Data::NoCodeEnum

Implements thomsonreuters::ema::access::Data.

bool thomsonreuters::ema::access::GenericMsg::getComplete ( ) const

Returns Complete.

Returns
true if this is a one part generic message or the final part of the multi part generic message.
DataType::DataTypeEnum thomsonreuters::ema::access::GenericMsg::getDataType ( ) const
virtual

Returns the DataType, which is the type of Omm data. Results in this class type.

Returns
DataType::GenericMsgEnum

Implements thomsonreuters::ema::access::Data.

UInt16 thomsonreuters::ema::access::GenericMsg::getPartNum ( ) const

Returns PartNum.

Exceptions
OmmInvalidUsageExceptionif hasPartNum() returns false
Returns
part number
const EmaBuffer& thomsonreuters::ema::access::GenericMsg::getPermissionData ( ) const

Returns PermissionData.

Exceptions
OmmInvalidUsageExceptionif hasPermissionData() returns false
Returns
EmaBuffer containing permission data
UInt32 thomsonreuters::ema::access::GenericMsg::getSecondarySeqNum ( ) const

Returns SecondarySeqNum.

Exceptions
OmmInvalidUsageExceptionif hasSecondarySeqNum() returns false
Returns
secondary sequence number
UInt32 thomsonreuters::ema::access::GenericMsg::getSeqNum ( ) const

Returns SeqNum.

Exceptions
OmmInvalidUsageExceptionif hasSeqNum() returns false
Returns
sequence number
bool thomsonreuters::ema::access::GenericMsg::hasPartNum ( ) const

Indicates presence of PartNum.

Remarks
part number is an optional member of GenericMsg
Returns
true if part number is set; false otherwise
bool thomsonreuters::ema::access::GenericMsg::hasPermissionData ( ) const

Indicates presence of PermissionData.

Remarks
permission data is optional on GenericMsg
Returns
true if permission data is set; false otherwise
bool thomsonreuters::ema::access::GenericMsg::hasSecondarySeqNum ( ) const

Indicates presence of SecondarySeqNum.

Remarks
secondary sequence number is an optional member of GenericMsg
Returns
true if secondary sequence number is set; false otherwise
bool thomsonreuters::ema::access::GenericMsg::hasSeqNum ( ) const

Indicates presence of SeqNum.

Remarks
sequence number is an optional member of GenericMsg
Returns
true if sequence number is set; false otherwise
GenericMsg& thomsonreuters::ema::access::GenericMsg::id ( Int32  id)

Specifies Id.

Parameters
[in]idspecifies Id
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::name ( const EmaString name)

Specifies Name.

Parameters
[in]namespecifies item name
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::nameType ( UInt8  nameType = rdm::INSTRUMENT_NAME_RIC)

Specifies NameType.

Parameters
[in]nameTypespecifies RDM Instrument NameType (default value is rdm::INSTRUMENT_NAME_RIC)
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::partNum ( UInt16  partNum)

Specifies PartNum.

Parameters
[in]partNumspecifies part number
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::payload ( const ComplexType data)

Specifies Payload.

Parameters
[in]payloadan object of ComplexType
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::permissionData ( const EmaBuffer permissionData)

Specifies PermissionData.

Parameters
[in]permissionDataan EmaBuffer object with permission data information
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::providerDriven ( bool  providerDriven = true)

Specifies ProviderDriven.

Parameters
[in]providerDrivenspecifies ProviderDriven
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::secondarySeqNum ( UInt32  secondarySeqNum)

Specifies SecondarySeqNum.

Parameters
[in]secondarySeqNumspecifies secondary sequence number
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::seqNum ( UInt32  seqNum)

Specifies SeqNum.

Parameters
[in]seqNumspecifies sequence number
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::serviceId ( UInt32  serviceId)

Specifies ServiceId.

Parameters
[in]serviceIdspecifies service id
Returns
reference to this object
GenericMsg& thomsonreuters::ema::access::GenericMsg::streamId ( Int32  streamId)

Specifies StreamId.

Parameters
[in]streamIdspecifies stream id
Returns
reference to this object
const EmaString& thomsonreuters::ema::access::GenericMsg::toString ( ) const
virtual

Returns a string representation of the class instance.

Returns
string representation of the class instance

Implements thomsonreuters::ema::access::Data.

Friends And Related Function Documentation

friend class ItemCallbackClient
friend

Definition at line 295 of file GenericMsg.h.