question

Upvotes
Accepted
322 5 11 16

Question About Encoding Set Defs

There are flags HAS_SET_DEFS in some containers (Series, Map and Vector). And there is a encSetDefs buffer in the container’s members.

Take RsslSeries as an example:

{

               RSSL_SRF_NONE                                            = 0x00,        
               RSSL_SRF_HAS_SET_DEFS                            = 0x01,               
               RSSL_SRF_HAS_SUMMARY_DATA              = 0x02,                         
               RSSL_SRF_HAS_TOTAL_COUNT_HINT       = 0x04                             
} RsslSeriesFlags;
 
typedef struct
{
               RsslUInt8                            flags;                             
               RsslContainerType           containerType;                   
               RsslBuffer                           encSetDefs;                       /*!< @brief Contains encoded set definition information when present. Presence is indicated by \ref RsslSeriesFlags ::RSSL_SRF_HAS_SET_DEFS.   When decoding, this contains encoded set definitions.  When encoding, pre-encoded set definition information can be specified here; if not pre-encoded the user can encode set definitions and invoke rsslEncodeSeriesSetDefsComplete() when ready to continue encoding RsslSeries contents. */
               RsslBuffer                           encSummaryData;           
               RsslUInt32                          totalCountHint;                     
               RsslBuffer                           encEntries;                       
} RsslSeries;

My question is how to decode the encSetDefs? We have tried to decode it as a container indicated by containerType and to decode it as Series but failed. Could you please help to tell us which API should be used to decode it? And when encoding, what kind of structure should be encoded into it? If possible, appreciate any example about this function.

Thanks

elektronrefinitiv-realtimeelektron-sdktrepencoding
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
791 10 8 14

Set definitions are encoded using the set definition encoding format (so they are not communicated as a field list or any other container type but they are their own specific encoding format to optimally represent definitions on the wire). Essentially, the encoded set definitions would be either a Field Set Definition (if it is defining layout for Field List content) or an Element Set Definition (if it is defining layout for Element List content).

The type of this is generally determined by the container type specified on the construct providing the encSetDefs. For example, you are processing a Series that has set definitions present. If the series.containerType indicates RSSL_DT_FIELD_LIST, this tells you that the encoded set definitions are Field Set Defs and you would use the Field Set Def encoding/decoding methods when processing. If it said RSSL_DT_ELEMENT_LIST, this would be element set defs and you would use element set def methods.

There is an entire section in the UPA Developers Guide dedicated to explaining this in much more detail. It has tables that detail each method used for encoding or decoding set definitions as well as code examples that show how to use these concepts. This should help give you more information to get your code up and running. The chapter you want to look at is Chapter 11.6 'Set Definitions and Set Defined Data'. This chapter and its subsections cover all things related to set definitions.

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.