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

FilterList is a heterogeneous container of complex data type entries. More...

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

Public Member Functions

Constructor
 FilterList ()
 
Destructor
virtual ~FilterList ()
 
Accessors
DataType::DataTypeEnum getDataType () const
 
Data::DataCode getCode () const
 
const EmaBuffergetAsHex () const
 
const EmaStringtoString () const
 
bool hasTotalCountHint () const
 
UInt32 getTotalCountHint () const
 
bool forth () const
 
bool forth (UInt8 filterId) const
 
const FilterEntrygetEntry () const
 
void reset () const
 
Operations
FilterListclear ()
 
FilterListtotalCountHint (UInt32 totalCountHint)
 
FilterListadd (UInt8 filterId, FilterEntry::FilterAction action, const ComplexType &value, const EmaBuffer &permissionData=EmaBuffer())
 
FilterListadd (UInt8 filterId, FilterEntry::FilterAction action, const EmaBuffer &permissionData=EmaBuffer())
 
const FilterListcomplete ()
 
- 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

FilterList entries are identified by Filter Id. For the source directory information, the Filter Ids are defined in the RDM (see also EmaRdm.h file).

FilterList 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 pre populated containers to FilterList.

FieldList fieldList;
Map map;
// first step - populate Map with the fieldList
map.addKeyBuffer( EmaBuffer( "1234321" ), MapEntry::AddEnum, fieldList ).complete();
// second step - add already populated Map to FilterList
FilterList filterList;
filterList.add( 2, FilterEntry::SetEnum; map );
// third step - complete FilterList
filterList.complete();

The following code snippet shows addition of clear containers to FilterList. The added containers are populated right after addition.

FilterList fList;
Map map;
// first step - add clear map to filterList
fList.add( 2, FilterEntry::SetEnum; map )
// second step - populate Map
map.addKeyBuffer( EmaBuffer( "1234321" ), MapEntry::AddEnum, fieldList ).complete();
// third step - complete FilterList
fList.complete()

The following code snippet shows extracting data from FilterList.

while ( filterList.forth() )
{
const FilterEntry& entry = filterList.getEntry();
switch ( entry.getLoadType() )
{
cout << "filter id = " << (UInt32)entry.getFilterId() << "\n";
cout << "action = " << entry.getFilterActionAsString() << "\n";
decode( entry.getMap() );
break;
...
}
}
Remarks
These two methods apply to containers only: 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 FilterList and its content.
Objects of this class are not cache-able.
All methods in this class are Lock-free Method.
See Also
Data, FilterEntry, ReqMsg, RefreshMsg, UpdateMsg, StatusMsg, GenericMsg, PostMsg, AckMsg, ElementList, Map, Vector, Series, FilterList, OmmOpaque, OmmXml, OmmAnsiPage, OmmError, EmaString, EmaBuffer

Definition at line 132 of file FilterList.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::FilterList::FilterList ( )

Constructs FilterList.

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

Destructor.

Member Function Documentation

FilterList& thomsonreuters::ema::access::FilterList::add ( UInt8  filterId,
FilterEntry::FilterAction  action,
const ComplexType value,
const EmaBuffer permissionData = EmaBuffer() 
)

Adds a complex type of OMM data to the FilterList.

Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Parameters
[in]filterIdspecifies filter id for the added FilterEntry
[in]actionspecifies action for the added FilterEntry
[in]valuespecifies load for the added FilterEntry
[in]permissionDataspecifies permissions for the added FilterEntry
Returns
reference to this object
FilterList& thomsonreuters::ema::access::FilterList::add ( UInt8  filterId,
FilterEntry::FilterAction  action,
const EmaBuffer permissionData = EmaBuffer() 
)

Adds no payload to the FilterList.

Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Parameters
[in]filterIdspecifies filter id for the added FilterEntry
[in]actionspecifies action for the added FilterEntry
[in]permissionDataspecifies permissions for the added FilterEntry
Returns
reference to this object
FilterList& thomsonreuters::ema::access::FilterList::clear ( )

Clears the FilterList.

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

Completes encoding of FilterList.

Exceptions
OmmInvalidUsageExceptionif an error is detected (exception will specify the cause of the error)
Returns
const reference to this object
bool thomsonreuters::ema::access::FilterList::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 FilterList; true otherwise
bool thomsonreuters::ema::access::FilterList::forth ( UInt8  filterId) const

Iterates through a list of Data having matched actual filterId with the one passed in. Typical usage is to extract the entry during each iteration via getEntry().

Parameters
[in]filterIdlooked up filter id
Returns
false at the end of FilterList; true otherwise
const EmaBuffer& thomsonreuters::ema::access::FilterList::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::FilterList::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::FilterList::getDataType ( ) const
virtual

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

Returns
DataType::FilterListEnum

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

const FilterEntry& thomsonreuters::ema::access::FilterList::getEntry ( ) const

Returns Entry.

Exceptions
OmmInvalidUsageExceptionif forth() was not called first
Returns
FilterEntry
UInt32 thomsonreuters::ema::access::FilterList::getTotalCountHint ( ) const

Returns TotalCountHint.

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

Indicates presence of TotalCountHint.

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

Resets iteration to start of container.

const EmaString& thomsonreuters::ema::access::FilterList::toString ( ) const
virtual

Returns a string representation of the class instance.

Returns
string representation of the class instance

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

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

Specifies TotalCountHint.

Exceptions
OmmInvalidUsageExceptionif this method is called after adding an entry to FilterList.
Parameters
[in]totalCountHintspecifies estimated total number of entries
Returns
reference to this object