question

Upvote
Accepted
16 0 0 1

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 ?

rfa
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @petejohn.buenafe

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.1k 250 52 74

@petejohn.buena

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.


1663315249746.png (24.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.