question

Upvotes
Accepted
301 8 22 30

How to Encode blank data with RSSL_DT_UINT DataType in FieldEntry

I have a question, could you please help me?

I want to know how to encode blank data with RSSL_DT_UINT DataType in FieldEntry.

I try to do it like this: fieldEntry.fieldID = 3263; fieldEntry.dataType = RSSL_DT_UINT; rsslEncodeFieldEntry(&encIter, &fieldEntry, NULL);

But I can’t get the expected result.

Could you provide me more details about it? Thanks very much.

elektronrefinitiv-realtimeelektron-sdktrepfieldsencoding
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.

1 Answer

Upvotes
Accepted
322 9 13 16

Try this, it works for me.

RsslRet AddField( RsslEncodeIterator& encodeIter, RsslInt16 fid, RsslUInt64 value, bool blankData )
{
    RsslFieldEntry fe = RSSL_INIT_FIELD_ENTRY;

    fe.fieldId  = fid;

    fe.dataType = RSSL_DT_UINT;

    const void* pData = blankData ? NULL : reinterpret_cast<const void*>( &value );

    RsslRet rsslReturn = rsslEncodeFieldEntry( &encodeIter, &fe, pData );

    if( rsslReturn < RSSL_RET_SUCCESS )
    {
        boost::format fmt( " AddField Unable to encode UInt64 field %d, %d, Buffer length = %d" );

        fmt % fe.fieldId % rsslReturn % rsslGetEncodedBufferLength( &encodeIter );

        LogManager::Instance().Log( 2, fmt );
    }

    return rsslReturn;
}
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.