next up previous contents
Next: Utilities Up: Serialisation Previous: Data Parsing   Contents

Data Flexibility

As all data structures must have a ts_id, as defined in the TINA enumerated type, in order to be processed. A potential problem may arise when trying to construct flexible data structures for base C defined variables. For this reason the basic structure types "ts_int", "ts_float", "ts_double" and "ts_string" have been defined and should be used whenever a data structure needs to point to a simple C variable. The best example of this is the List data structure.

typedef struct list  /* generic list type for all simple list structures */
{
    Ts_id ts_id;                /* Tina structure identifier */
    int type;
    struct list *next;
    void *to;
} List;
#define LIST_SWAP_STRING "ipp"

If the list3#3to field is required to point to float variables the "ts_float" structure must be used.

Also the mechanism cannot handle function pointers (as this must be processor dependent data) and cannot handle variable length structures such as arrays directly. These have to be handled by purpose written routines (eg: nvector_ts_serialise()). Potentially this problem could be rectified relatively simply with a slight modification to the parsing algorithms but this will not be necessary if programmers stick with the TINA List data structure for constructing variable length data sets.


next up previous contents
Next: Utilities Up: Serialisation Previous: Data Parsing   Contents
root 2017-09-25