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::OmmError Class Reference

OmmError represents received Omm data who fails to process properly. More...

Inheritance diagram for thomsonreuters::ema::access::OmmError:
thomsonreuters::ema::access::Data

Public Types

enum  ErrorCode {
  NoErrorEnum = 0,
  NoDictionaryEnum = 1,
  IteratorSetFailureEnum = 2,
  IteratorOverrunEnum = 3,
  FieldIdNotFoundEnum = 4,
  IncompleteDataEnum = 5,
  UnsupportedDataTypeEnum = 6,
  NoSetDefinitionEnum = 7,
  UnknownErrorEnum = 8
}
 
- Public Types inherited from thomsonreuters::ema::access::Data
enum  DataCode {
  NoCodeEnum = 0,
  BlankEnum = 1
}
 

Public Member Functions

Accessors
const EmaStringgetErrorCodeAsString () const
 
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
ErrorCode getErrorCode () const
 
- Public Member Functions inherited from thomsonreuters::ema::access::Data
const EmaStringgetCodeAsString () const
 
 operator const char * () const
 
virtual ~Data ()
 

Friends

class Decoder
 
class StaticDecoder
 

Additional Inherited Members

- Protected Member Functions inherited from thomsonreuters::ema::access::Data
 Data ()
 

Detailed Description

Objects of OmmError class are returned when an error is detected while processing received data. These objects are used for debugging purposes only.

void decodeData( const Data& rcvdData )
{
if ( rcvdData.getCode() != Data::BlankEnum )
switch ( rcvdData.getDataType() )
{
UInt64 value = static_cast< const OmmUInt& >( rcvdData ).getUInt();
break;
...
cout << "Failed to decode data. Error code is: "
<< static_cast< OmmError& >( rcvdData ).getErrorCodeAsString() << "\n"
<< "Received data is: "
<< rcvdData.getAsHex() << "\n";
break;
}
}
Remarks
OmmError is a read only class.
The usage of this class is limited to downcast operation only.
All methods in this class are Lock-free Method.
See Also
Data, EmaString, EmaBuffer

Definition at line 62 of file OmmError.h.

Member Enumeration Documentation

An enumeration representing decoding error condition.

Enumerator
NoErrorEnum 

Indicates no error

NoDictionaryEnum 

Indicates missing dictionary

IteratorSetFailureEnum 

Indicates internal iterator set failure

IteratorOverrunEnum 

Indicates internal iterator overrun failure

FieldIdNotFoundEnum 

Indicates field id was not found in dictionary

IncompleteDataEnum 

Indicates incomplete data

UnsupportedDataTypeEnum 

Indicates unsupported data type

NoSetDefinitionEnum 

Indicates set defined data is not present

UnknownErrorEnum 

Indicates unknown error

Definition at line 69 of file OmmError.h.

Member Function Documentation

const EmaBuffer& thomsonreuters::ema::access::OmmError::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::OmmError::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::OmmError::getDataType ( ) const
virtual

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

Returns
DataType::ErrorEnum

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

ErrorCode thomsonreuters::ema::access::OmmError::getErrorCode ( ) const

Returns ErrorCode.

Returns
error code
const EmaString& thomsonreuters::ema::access::OmmError::getErrorCodeAsString ( ) const

Returns the ErrorCode value as a string format.

Returns
string representation of error code (e.g., "IteratorSetFailure" )
const EmaString& thomsonreuters::ema::access::OmmError::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 Decoder
friend

Definition at line 125 of file OmmError.h.

friend class StaticDecoder
friend

Definition at line 126 of file OmmError.h.