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

AckMsg indicates success or failure of PostMsg. More...

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

Public Types

enum  NackCode {
  NoneEnum = 0,
  AccessDeniedEnum = 1,
  DeniedBySourceEnum = 2,
  SourceDownEnum = 3,
  SourceUnknownEnum = 4,
  NoResourcesEnum = 5,
  NoResponseEnum = 6,
  GatewayDownEnum = 7,
  SymbolUnknownEnum = 10,
  NotOpenEnum = 11,
  InvalidContentEnum = 12
}
 
- Public Types inherited from thomsonreuters::ema::access::Data
enum  DataCode {
  NoCodeEnum = 0,
  BlankEnum = 1
}
 

Public Member Functions

Constructor
 AckMsg ()
 
 AckMsg (const AckMsg &other)
 
Destructor
virtual ~AckMsg ()
 
Accessors
const EmaStringgetNackCodeAsString () const
 
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
bool hasSeqNum () const
 
bool hasNackCode () const
 
bool hasText () const
 
bool hasServiceName () const
 
UInt32 getSeqNum () const
 
UInt32 getAckId () const
 
UInt8 getNackCode () const
 
const EmaStringgetText () const
 
bool getPrivateStream () const
 
const EmaStringgetServiceName () const
 
Operations
AckMsgclear ()
 
AckMsgstreamId (Int32 streamId)
 
AckMsgdomainType (UInt16 domainType=rdm::MMT_MARKET_PRICE)
 
AckMsgname (const EmaString &name)
 
AckMsgnameType (UInt8 nameType=rdm::INSTRUMENT_NAME_RIC)
 
AckMsgserviceName (const EmaString &serviceName)
 
AckMsgserviceId (UInt32 serviceId)
 
AckMsgid (Int32 id)
 
AckMsgfilter (UInt32 filter)
 
AckMsgseqNum (UInt32 seqNum)
 
AckMsgackId (UInt32 postId)
 
AckMsgnackCode (UInt8 nackCode)
 
AckMsgtext (const EmaString &text)
 
AckMsgattrib (const ComplexType &attrib)
 
AckMsgpayload (const ComplexType &payload)
 
AckMsgextendedHeader (const EmaBuffer &buffer)
 
AckMsgprivateStream (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 ItemCallbackClient
 

Additional Inherited Members

- 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

If requested, AckMsg is sent by provider acting on PostMsg received from consumer. AckMsg indicates success or failure of caching / processing of received PostMsg. AckMsg is optional. Consumer requests provider to send AckMsg by calling PostMsg::solicitAck( true ).

The following code snippet shows processing of received AckMsg.

class AppClient : public OmmConsumerClient
{
...
void onAckMsg( const AckMsg& , const OmmConsumerEvent& );
};
void AppClient::onAckMsg( const AckMsg& ackMsg, const OmmConsumerEvent& )
{
if ( ackMsg.hasName() )
cout << ackMsg.getName() << "\n";
if ( ackMsg.hasServiceName() )
cout << ackMsg.getServiceName() << "\n";
if ( ackMsg.hasNackCode() )
cout << ackMsg.getNackCodeAsString() << "\n";
}
Remarks
Calling get***() method on an optional member of AcMsg 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 AckMsg.
Objects of this class are not cache-able.
Decoding of just encoded AckMsg 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 67 of file AckMsg.h.

Member Enumeration Documentation

An enumeration representing negative acknowledgement code.

Enumerator
NoneEnum 

Indicates no nack code

AccessDeniedEnum 

Indicates access denied

DeniedBySourceEnum 

Indicates denied by source

SourceDownEnum 

Indicates source is down

SourceUnknownEnum 

Indicates source is unknown

NoResourcesEnum 

Indicates no resources

NoResponseEnum 

Indicates no response

GatewayDownEnum 

Indicates gateway down

SymbolUnknownEnum 

Indicates unknown symbol

NotOpenEnum 

Indicates not open

InvalidContentEnum 

Indicates invalid content

Definition at line 74 of file AckMsg.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::AckMsg::AckMsg ( )

Constructs AckMsg.

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

Copy constructor.

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

Destructor.

Member Function Documentation

AckMsg& thomsonreuters::ema::access::AckMsg::ackId ( UInt32  postId)

Specifies AckId.

Parameters
[in]postIdspecifies related post id
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::attrib ( const ComplexType attrib)

Specifies Attrib.

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

Clears the AckMsg.

Remarks
Invoking clear() method clears all the values and resets all the defaults
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::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
AckMsg& thomsonreuters::ema::access::AckMsg::extendedHeader ( const EmaBuffer buffer)

Specifies ExtendedHeader.

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

Specifies Filter.

Parameters
[in]filterspecifies filter
Returns
reference to this object
UInt32 thomsonreuters::ema::access::AckMsg::getAckId ( ) const

Returns the AckId.

Returns
ack id
const EmaBuffer& thomsonreuters::ema::access::AckMsg::getAsHex ( ) const
virtual

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

Returns
EmaBuffer with the message hex information

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

Data::DataCode thomsonreuters::ema::access::AckMsg::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::AckMsg::getDataType ( ) const
virtual

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

Returns
DataType::AckMsgEnum

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

UInt8 thomsonreuters::ema::access::AckMsg::getNackCode ( ) const

Returns NackCode.

Exceptions
OmmInvalidUsageExceptionif hasNackCode() returns false
Returns
NackCode
const EmaString& thomsonreuters::ema::access::AckMsg::getNackCodeAsString ( ) const

Returns the NackCode value as a string format.

Returns
string representation of this object's NackCode
bool thomsonreuters::ema::access::AckMsg::getPrivateStream ( ) const

Returns PrivateStream.

Returns
true if this is a private stream; false otherwise
UInt32 thomsonreuters::ema::access::AckMsg::getSeqNum ( ) const

Returns SeqNum.

Exceptions
OmmInvalidUsageExceptionif hasSeqNum() returns false
Returns
sequence number
const EmaString& thomsonreuters::ema::access::AckMsg::getServiceName ( ) const

Returns the ServiceName within the MsgKey.

Exceptions
OmmInvalidUsageExceptionif hasServiceName() returns false
Returns
EmaString containing service name
const EmaString& thomsonreuters::ema::access::AckMsg::getText ( ) const

Returns Text.

Exceptions
OmmInvalidUsageExceptionif hasText() returns false
Returns
text
bool thomsonreuters::ema::access::AckMsg::hasNackCode ( ) const

Indicates presence of NackCode.

Remarks
negative acknowledgement code is an optional member of AckMsg
Returns
true if NackCode is set; false otherwise
bool thomsonreuters::ema::access::AckMsg::hasSeqNum ( ) const

Indicates presence of SeqNum.

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

Indicates presence of the ServiceName within the MsgKey.

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

Indicates presence of Text.

Remarks
Text is an optional member of AckMsg
Returns
true if text is set; false otherwise
AckMsg& thomsonreuters::ema::access::AckMsg::id ( Int32  id)

Specifies Id.

Parameters
[in]idspecifies Id
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::nackCode ( UInt8  nackCode)

Specifies NackCode.

Parameters
[in]nackCodea negative acknowledgement code
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::name ( const EmaString name)

Specifies Name.

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

Specifies Payload.

Parameters
[in]payloadan object of ComplexType
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::privateStream ( bool  privateStream = false)

Specifies PrivateStream.

Parameters
[in]privateStreamspecifies if this is a private stream (default is false)
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::seqNum ( UInt32  seqNum)

Specifies SeqNum.

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

Specifies ServiceId.

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

Specifies ServiceName.

Exceptions
OmmInvalidUsageExceptionif service id is already set
Parameters
[in]serviceNamespecifies service name
Returns
reference to this object
AckMsg& thomsonreuters::ema::access::AckMsg::streamId ( Int32  streamId)

Specifies StreamId.

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

Specifies Text.

Parameters
[in]textspecifies message text information
Returns
reference to this object
const EmaString& thomsonreuters::ema::access::AckMsg::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 315 of file AckMsg.h.