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

Vector is a homogeneous container of complex data type entries. More...

Inheritance diagram for thomsonreuters::ema::access::Vector:
thomsonreuters::ema::access::ComplexType thomsonreuters::ema::access::Data

Public Member Functions

Constructor
 Vector ()
 
Destructor
virtual ~Vector ()
 
Accessors
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
bool forth () const
 
void reset () const
 
bool hasTotalCountHint () const
 
bool getSortable () const
 
UInt32 getTotalCountHint () const
 
const SummaryDatagetSummaryData () const
 
const VectorEntrygetEntry () const
 
Operations
Vectorclear ()
 
Vectoradd (UInt32 position, VectorEntry::VectorAction action, const ComplexType &value, const EmaBuffer &permissionData=EmaBuffer())
 
Vectoradd (UInt32 position, VectorEntry::VectorAction action, const EmaBuffer &permissionData=EmaBuffer())
 
const Vectorcomplete ()
 
Vectorsortable (bool sortable=false)
 
VectortotalCountHint (UInt32 totalCountHint)
 
VectorsummaryData (const ComplexType &data)
 
- 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 ()
 

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::ComplexType
 ComplexType ()
 
- Protected Member Functions inherited from thomsonreuters::ema::access::Data
 Data ()
 

Detailed Description

Vector entries are identified by index.

Vector supports two methods of adding containers; they are:

The first method of adding of already populated containers allows for easy data manipulation but incurs additional memory copy. This method is useful in applications extracting data containers from some messages or containers and then setting them on other containers.

The second method allows for fast container population since it avoids additional memory copy incurred by the first method. This method is useful in source applications setting OMM data from native data formats.

The following code snippet shows addition of entry and summaryData to Vector.

FieldList fList;
fList.addInt( 1, 1 ).addUInt( 100, 2 ).addArray( 2000, Array().addInt( 1 ).addInt( 2 ).complete() ).complete();
Vector vector;
vector.sortable( true ).
summaryData( fList ).
add( 1, VectorEntry::SetEnum, fList ).

The following code snippet shows extracting of Vector and its content.

void decodeVector( const Vector& vector )
{
switch ( vector.getSummaryData().getDataType() )
{
decodeFieldList( vector.getSummaryData().getFieldList() );
break;
break;
}
while ( vector.forth() )
{
const VectorEntry& vEntry = vector.getEntry();
switch ( vEntry.getLoad().getDataType() )
{
decodeFieldList( vEntry.getLoad().getFieldList() );
break;
break;
}
}
}
Remarks
These two methods apply to containers only; e.g.,: ElementList, FieldList, FilterList, Map, Series, and Vector.
Objects of this class are intended to be short lived or rather transitional.
This class is designed to efficiently perform setting and extracting of Vector and its content.
Objects of this class are not cache-able.
All methods in this class are Lock-free Method.
See Also
Data, VectorEntry, SummaryData, ReqMsg, RefreshMsg, UpdateMsg, StatusMsg, GenericMsg, PostMsg, AckMsg, ElementList, Map, Vector, Series, FilterList, OmmOpaque, OmmXml, OmmAnsiPage, OmmError, EmaString, EmaBuffer

Definition at line 121 of file Vector.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::Vector::Vector ( )

Constructs Vector.

virtual thomsonreuters::ema::access::Vector::~Vector ( )
virtual

Destructor.

Member Function Documentation

Vector& thomsonreuters::ema::access::Vector::add ( UInt32  position,
VectorEntry::VectorAction  action,
const ComplexType value,
const EmaBuffer permissionData = EmaBuffer() 
)

Adds complex OMM data identified by a position.

Remarks
All entries must have same complex data type
Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Parameters
[in]positionspecifies position of this entry in Vector
[in]actionspecifies action to be performed on this entry
[in]valuecomplex type contained in this entry
[in]permissionDataspecifies permission data for this entry
Returns
reference to this object
Vector& thomsonreuters::ema::access::Vector::add ( UInt32  position,
VectorEntry::VectorAction  action,
const EmaBuffer permissionData = EmaBuffer() 
)

Adds no payload identified by a position.

Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Parameters
[in]positionspecifies position of this entry in Vector
[in]actionspecifies action to be performed on this entry
[in]permissionDataspecifies permission data for this entry
Returns
reference to this object
Vector& thomsonreuters::ema::access::Vector::clear ( )

Clears the Vector.

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

Completes encoding of the Vector.

Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Returns
const reference to this object
bool thomsonreuters::ema::access::Vector::forth ( ) const

Iterates through a list of Data of any DataType. Typical usage is to extract the entry during each iteration via getEntry().

Returns
false at the end of Vector; true otherwise
const EmaBuffer& thomsonreuters::ema::access::Vector::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::Vector::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::Vector::getDataType ( ) const
virtual

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

Returns
DataType::VectorEnum

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

const VectorEntry& thomsonreuters::ema::access::Vector::getEntry ( ) const

Returns Entry.

Exceptions
OmmInvalidUsageExceptionif forth() was not called first
Returns
VectorEntry
bool thomsonreuters::ema::access::Vector::getSortable ( ) const

Returns Sortable.

Returns
true if sortable flag is set; false otherwise
const SummaryData& thomsonreuters::ema::access::Vector::getSummaryData ( ) const

Returns the contained summaryData Data based on the summaryData DataType.

Remarks
SummaryData contains no data if SummaryData::getDataType() returns DataType::NoDataEnum
Returns
SummaryData
UInt32 thomsonreuters::ema::access::Vector::getTotalCountHint ( ) const

Returns TotalCountHint.

Exceptions
OmmInvalidUsageExceptionif hasTotalCountHint() returns false
Returns
total count hint
bool thomsonreuters::ema::access::Vector::hasTotalCountHint ( ) const

Indicates presence of TotalCountHint.

Returns
true if total count hint is set; false otherwise
void thomsonreuters::ema::access::Vector::reset ( ) const

Resets iteration to start of container.

Vector& thomsonreuters::ema::access::Vector::sortable ( bool  sortable = false)

Specifies Sortable.

Parameters
[in]sortablespecifies if this object is sortable
Returns
reference to this object
Vector& thomsonreuters::ema::access::Vector::summaryData ( const ComplexType data)

Specifies the SummaryData OMM Data.

Remarks
Call to summaryData( ) must happen prior to calling the add( ) method
Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Parameters
[in]summaryDataspecifies complex type as summaryData
Returns
reference to this object
const EmaString& thomsonreuters::ema::access::Vector::toString ( ) const
virtual

Returns a string representation of the class instance.

Returns
string representation of the class instance

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

Vector& thomsonreuters::ema::access::Vector::totalCountHint ( UInt32  totalCountHint)

Specifies TotalCountHint.

Parameters
[in]totalCountHintspecifies total count hint
Returns
reference to this object