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

StatusMsg conveys item state information. More...

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

Public Member Functions

Constructor
 StatusMsg ()
 
 StatusMsg (const StatusMsg &other)
 
virtual ~StatusMsg ()
 
Accessors
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
bool hasItemGroup () const
 
bool hasState () const
 
bool hasPermissionData () const
 
bool hasPublisherId () const
 
bool hasServiceName () const
 
const OmmStategetState () const
 
const EmaBuffergetItemGroup () const
 
const EmaBuffergetPermissionData () const
 
UInt32 getPublisherIdUserId () const
 
UInt32 getPublisherIdUserAddress () const
 
bool getClearCache () const
 
bool getPrivateStream () const
 
const EmaStringgetServiceName () const
 
Operations
StatusMsgclear ()
 
StatusMsgstreamId (Int32 streamId)
 
StatusMsgdomainType (UInt16 domainType=thomsonreuters::ema::rdm::MMT_MARKET_PRICE)
 
StatusMsgname (const EmaString &name)
 
StatusMsgnameType (UInt8 nameType=rdm::INSTRUMENT_NAME_RIC)
 
StatusMsgserviceName (const EmaString &serviceName)
 
StatusMsgserviceId (UInt32 serviceId)
 
StatusMsgid (Int32 id)
 
StatusMsgfilter (UInt32 filter)
 
StatusMsgstate (OmmState::StreamState streamState=OmmState::OpenEnum, OmmState::DataState dataState=OmmState::OkEnum, UInt8 statusCode=OmmState::NoneEnum, const EmaString &statusText=EmaString())
 
StatusMsgitemGroup (const EmaBuffer &itemGroup)
 
StatusMsgpermissionData (const EmaBuffer &permissionData)
 
StatusMsgpublisherId (UInt32 userId, UInt32 userAddress)
 
StatusMsgattrib (const ComplexType &data)
 
StatusMsgpayload (const ComplexType &data)
 
StatusMsgextendedHeader (const EmaBuffer &buffer)
 
StatusMsgclearCache (bool clearCache=false)
 
StatusMsgprivateStream (bool privateStream=false)
 
- 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 DictionaryCallbackClient
 
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

StatusMsg is used to convey item state information, permission change or item group id change.

The following code snippet shows receiving and processing of StatusMsg.

class AppClient ; public OmmConsumerClient
{
...
void onStatusMsg( const StatusMsg& , const OmmConsumerEvent& );
};
void AppClient::onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& event )
{
cout << "Item's handle = " << event.getHandle() << "\n";
if ( statusMsg.hasName() )
cout << "Item's name = " << statusMsg.getName() << "\n";
if ( statusMsg.hasServiceName() )
cout << "Item's name = " << statusMsg.getServiceName() << "\n";
if ( statusMsg.hasPermissionData() )
{
const EmaBuffer& permData = statusMsg.getPermissionData();
...
}
if ( statusMsg.hasState() )
{
const OmmState& itemState = statusMsg.getState();
...
}
}
Remarks
Calling get***() method on an optional member of StatusMsg 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 StatusMsg.
Objects of this class are not cache-able.
Decoding of just encoded StatusMsg 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 79 of file StatusMsg.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::StatusMsg::StatusMsg ( )

Constructs StatusMsg.

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

Copy constructor.

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

Destructor.

Member Function Documentation

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

Specifies Attrib.

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

Clears the StatusMsg.

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

Specifies ClearCache.

Parameters
[in]clearCachetrue if cache needs to be cleared; false otherwise (default value is false)
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::domainType ( UInt16  domainType = thomsonreuters::ema::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
StatusMsg& thomsonreuters::ema::access::StatusMsg::extendedHeader ( const EmaBuffer buffer)

Specifies ExtendedHeader.

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

Specifies Filter.

Parameters
[in]filterspecifies filter
Returns
reference to this object
const EmaBuffer& thomsonreuters::ema::access::StatusMsg::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.

bool thomsonreuters::ema::access::StatusMsg::getClearCache ( ) const

Returns ClearCache.

Returns
true if cache needs to be cleared on receipt of this status message; false otherwise
Data::DataCode thomsonreuters::ema::access::StatusMsg::getCode ( ) const
virtual

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

Returns
Data::NoCodeEnum

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

DataType::DataTypeEnum thomsonreuters::ema::access::StatusMsg::getDataType ( ) const
virtual

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

Returns
DataType::StatusMsgEnum

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

const EmaBuffer& thomsonreuters::ema::access::StatusMsg::getItemGroup ( ) const

Returns ItemGroup.

Exceptions
OmmInvalidUsageExceptionif hasItemGroup() returns false
Returns
EmaBuffer containing item group information
const EmaBuffer& thomsonreuters::ema::access::StatusMsg::getPermissionData ( ) const

Returns PermissionData.

Exceptions
OmmInvalidUsageExceptionif hasPermissionData() returns false
Returns
EmaBuffer containing permission data information
bool thomsonreuters::ema::access::StatusMsg::getPrivateStream ( ) const

Returns PrivateStream. true if this is private stream item; false otherwise

UInt32 thomsonreuters::ema::access::StatusMsg::getPublisherIdUserAddress ( ) const

Returns PublisherIdUserAddress.

Exceptions
OmmInvalidUsageExceptionif hasPublisherId() returns false
Returns
publisher's user address
UInt32 thomsonreuters::ema::access::StatusMsg::getPublisherIdUserId ( ) const

Returns PublisherIdUserId.

Exceptions
OmmInvalidUsageExceptionif hasPublisherId() returns false
Returns
publisher's user Id
const EmaString& thomsonreuters::ema::access::StatusMsg::getServiceName ( ) const

Returns the ServiceName within the MsgKey.

Returns
EmaString containing service name
const OmmState& thomsonreuters::ema::access::StatusMsg::getState ( ) const

Returns State.

Exceptions
OmmInvalidUsageExceptionif hasState() returns false
Returns
state of item (e.g. Open / Ok)
bool thomsonreuters::ema::access::StatusMsg::hasItemGroup ( ) const

Indicates presence of ItemGroup.

Remarks
Item Group is an optional member of StatusMsg
Returns
true if Item Group information is set; false otherwise
bool thomsonreuters::ema::access::StatusMsg::hasPermissionData ( ) const

Indicates presence of PermissionData.

Remarks
permission data is optional member of StatusMsg
Returns
true if permission data is set; false otherwise
bool thomsonreuters::ema::access::StatusMsg::hasPublisherId ( ) const

Indicates presence of PublisherId.

Remarks
publisher id is an optional member of StatusMsg
Returns
true if publisher id is set; false otherwise
bool thomsonreuters::ema::access::StatusMsg::hasServiceName ( ) const

Indicates presence of the ServiceName within the MsgKey.

Remarks
service name is an optional member of StatusMsg
Returns
true if service name is set; false otherwise
bool thomsonreuters::ema::access::StatusMsg::hasState ( ) const

Indicates presence of State.

Remarks
Item State is an optional member of StatusMsg
Returns
true if state information is set; false otherwise
StatusMsg& thomsonreuters::ema::access::StatusMsg::id ( Int32  id)

Specifies Id.

Parameters
[in]idspecifies Id
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::itemGroup ( const EmaBuffer itemGroup)

Specifies ItemGroup.

Parameters
[in]itemGroupan EmaBuffer object with item group information
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::name ( const EmaString name)

Specifies Name.

Parameters
[in]namespecifies item name
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::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
StatusMsg& thomsonreuters::ema::access::StatusMsg::payload ( const ComplexType data)

Specifies Payload.

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

Specifies PermissionData.

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

Specifies PrivateStream.

Parameters
[in]privateStreamtrue if private stream; false otherwise (default value is false)
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::publisherId ( UInt32  userId,
UInt32  userAddress 
)

Specifies PublisherId.

Parameters
[in]UserIdspecifies publisher's user id
[in]UserAddressspecifies publisher's user address
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::serviceId ( UInt32  serviceId)

Specifies ServiceId.

Exceptions
OmmInvalidUsageExceptionif service name is already set
Parameters
[in]serviceIdspecifies service id
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::serviceName ( const EmaString serviceName)

Specifies ServiceName.

Exceptions
OmmInvalidUsageExceptionif service id is already set
Parameters
[in]serviceNamespecifies service name
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::state ( OmmState::StreamState  streamState = OmmState::OpenEnum,
OmmState::DataState  dataState = OmmState::OkEnum,
UInt8  statusCode = OmmState::NoneEnum,
const EmaString statusText = EmaString() 
)

Specifies State.

Parameters
[in]streamStateconveys item stream state value (default value is OmmState::OpenEnum)
[in]dataStateconveys item data state value (default value is OmmState::SuspectEnum)
[in]statusCodeconveys specific item state code (default value is OmmState::NoneEnum)
[in]statusTextconveys item status explanation (default value is 'empty string')
Returns
reference to this object
StatusMsg& thomsonreuters::ema::access::StatusMsg::streamId ( Int32  streamId)

Specifies StreamId.

Parameters
[in]streamIdspecifies stream id
Returns
reference to this object
const EmaString& thomsonreuters::ema::access::StatusMsg::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 DictionaryCallbackClient
friend

Definition at line 325 of file StatusMsg.h.

friend class ItemCallbackClient
friend

Definition at line 324 of file StatusMsg.h.