How to check the the return type from getEntryType() is either UINT64 or TIME ?

When my code receives a FieldEntry, I'd like to check its type whether is expected by calling getEntryType(). Its type is of rfa::common::UInt8. My code also needs to access this entry's data by calling getData(). I was told that L2 market data update timestamp for example FID 6527 is of type UINT64 (LV_TIM_MS) and FID 14268 is of TIME (LV_TIM_NS)type. How to check the the return type from getEntryType() is either UINT64 or TIME ?

Tagged:

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @petejohn.buenafe

    Thanks for reaching out to us.

    getEntryType() is a method of DataEntry which is a parent class of FieldEntry and other entries.

    1663315249746.pngTherefore, the getEntryType method is used to indicate the following entry types

        enum EntryTypes
        {
            VectorEntryEnum = 0xF1,        // Offset avoids overlap with DataEnumeration.        
            ElementEntryEnum,
            FieldEntryEnum,
            MapEntryEnum,
            FilterEntryEnum,
            ArrayEntryEnum,
            SeriesEntryEnum
        };

    The FieldEntryEnum is 243.

    To check the data type in the FileEntry, you need the RDM Field dictionary. The code looks like this:

    void Decoder::decodeFieldEntry( const FieldEntry& input )
    {    
      _pCurrentFidDef = &_rRDMFieldDictionary.getFidDef( input.getFieldID() );
      ...
      fieldName = _pCurrentFidDef->getName();
      _out->outBegin( input, fieldName.c_str() );


       decodeData( input.getData(static_cast<UInt8>(_pCurrentFidDef->getOMMType())) );
    ...
    }

    The code gets FidDefinition from RDMFieldDictioary by using a field ID. Then, it gets the data type from the getOMMType() method. The getOMMType() method returns DataBufferEnumeration.

    enum DataBufferEnumeration
    {
    ...
    Int64Enum= 3,
    UInt64Enum= 4,
    ...
    TimeEnum= 10,
    ...
    }

    For more information, please refer to the StarterConsumer example in the RFA C++ package.

    Please feel free to reach out if you have any further questions.