EMA C++ Developers Guide : 3 OMM Containers and Messages : 3.3 Working with OMM Containers : 3.3.4 Example: Extracting Information from a FieldList Class
 
3.3.4 Example: Extracting Information from a FieldList Class
In the following example illustrates how to use the FieldList::forth() method to extract information from the FieldList class by iterating over the class. The following code extracts information about all entries.
 
 
void decode( const FieldList& fieldList )
{
    if ( fieldList.hasInfo() )
    {
        Int16 dictionaryId = fieldList.getInfoDictionaryId();
        Int16 fieldListNum = fieldList.getInfoFieldListNum();
    }
 
    while ( fieldList.forth() )
    {
        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;
        }
    }
}