EMA C++ Developers Guide : 3 OMM Containers and Messages : 3.3 Working with OMM Containers : 3.3.5 Example: Application Filtering on the FieldList Class
 
3.3.5 Example: Application Filtering on the FieldList Class
In the following code snippet application filters or extracts select information from FieldList class. The FieldList::forth( Int16 ) method is used to iterate over the FieldList class. In this case only entries with field id of 22 will be extracted; all the other ones will be skipped.
 
 
void decode( const FieldList& fieldList )
{
while ( fieldList.forth( 22 ) )
{
const FieldEntry& fieldEntry = fieldList.getEntry();
 
if ( fieldEntry.getCode() == Data::BlankEnum )
continue;
 
switch ( fieldEntry.getLoadType() )
{
case DataType::AsciiEnum :
const EmaString& value = fieldEntry.getAscii();
break;
case DataType::IntEnum :
Int64 value = fieldEntry.getInt();
break;
}
}
}