next up previous contents
Next: Tina Strings Up: Generic Lists Previous: Lists and Ddlists   Contents

Property Lists

One particularly important use of the the List data structure is the property list. It is used to associate extra specific information (relevant to individual application domains) with generic feature descriptions. The usual use is exemplified in the following generic data storage definition, which can be used to add extra information to a data structure that does not itself have a property list.

typedef struct generic
{
    Ts_id ts_id;                /* Tina structure identifier */
    int type;
    int label;
    void *to;
    struct list *props;
} Generic;

The list referenced by the field props is treated as a property list. List elements of the property lists are identified by the reserved system type PROP_TYPE (although this is hidden from the user and therefor largely redundant). Through a hidden data structure the list is used to reference additional specific and shared data structures associated with the defined structure. All tina structures used to define physical data (image, scene or model based) have their own property lists. Other data structures (eg. those representing transformations or projections) must be referenced through the type Generic in order to associate properties with them.

As implied above, property lists are not manipulated by the user, but by a limited set of access functions that allow the creation, deletion, update, and copying of properties using the data types as a reference key. The property list structure is given here purely for completeness.

typedef struct prop  /* a structure used to maintain property like lists */
{
    Ts_id ts_id;                /* Tina structure identifier */
    int type;
    int count;   /* the number of references through this prop */
    void (*freefunc)();
    void *to; /* must be suitably cast */
} Prop;

A few functions also exist for changing the order of elements on the property list to improve the efficiency of frequently accessed members, these and other props list manipulation functions will be described later.


next up previous contents
Next: Tina Strings Up: Generic Lists Previous: Lists and Ddlists   Contents
root 2017-11-18