C API Definition of ffh_fast_message and its Related Structures

The C API, FASTMessage.h, defines ffh_fast_message and its related structures. ffh_fast_message and its related structures hold the contents of decoded FAST messages.

Warning!  

Do not modify the contents of the ffh_fast_message and its members in your message-processing code.

When you are done with the ffh_fast_message, invoke the release_message callback on the ffh_mh_info structure.

There will be a ffh_fast_field created for every field defined in the FAST template corresponding to the given ffh_fast_message. This includes any fields absent from the incoming stream. Those ffh_fast_fields have the value of their "present" member set to false.

The ascii_string, utf8_string and byte_vector members of the ffh_vector_data are not '\0' terminated. You must use the length member of the ffh_vector_data to determine their size.

typedef uint8_t byte;

typedef enum {
    FFT_GROUP = 1,
    FFT_SEQUENCE, 
    FFT_INT32, 
    FFT_UINT32,
    FFT_INT64,
    FFT_UINT64, 
    FFT_DECIMAL,
    FFT_ASCII,
    FFT_UNICODE,
    FFT_BYTES
} ffh_field_type;

typedef struct {
    const char * name_space;
    const char * name;
} ffh_fast_name; 

typedef struct {
    int64_t mantissa;
    int32_t exponent; 
} ffh_fast_decimal; 

typedef struct {
    size_t length;
    union { 
        char * ascii_string;
        byte * utf8_string;
        byte * byte_vector;
    };
} ffh_vector_data; 

typedef struct ffh_fast_field ffh_fast_field;

typedef struct {
    /* An array of fast_field pointers */
    ffh_fast_field ** fields;
    /* The number of entries in the above array */ 
    size_t field_count;
}ffh_fast_group;

typedef struct {
    ffh_fast_name template_name;
    uint64_t template_id; 
    ffh_fast_group data;
} ffh_fast_message;

typedef struct {
    size_t length;
    ffh_fast_group * elements; /* Array of groups */ 
} ffh_fast_sequence;

struct ffh_fast_field {
    ffh_fast_name  name;
    ffh_field_type type; 
    bool           present;
    union {
        int32_t              int32;
        uint32_t             uint32;
        int64_t              int64; 
        uint64_t             uint64;
        ffh_fast_decimal     decimal; 
        ffh_fast_sequence    sequence;
        ffh_fast_group       group; 
        ffh_vector_data      vector;
    };
};
Related concepts
Message Handler Plug-ins
Related tasks
Writing a Message Handler Plug-in for the FAST Feed Handler
Writing a Message Handler Plug-in Initialize Function
Writing a Message Handler Plug-in Process Function
Writing a Message Handler Plug-in Finalize Function
Implementing the Shutdown Callback Method
Related reference
Arguments of the Message Handler Plug-in Initialize Function
Arguments of the Message Handler Process Function
Arguments of the Message Handler Finalize Function
C API Definitions of Function Signatures for Building a Message Handler
FAST Templates