Lists and structures
While each type of list has its own data structure, all list structures have the same form:
unsigned int numItems;
AR xxxStruct *xxxList;
} ARxxxList;
Each list structure has an integer that identifies the number of items in the list and a pointer to the allocated memory containing those items. If the number of items is zero, the server or client ignores the pointer and the pointer is usually set to NULL. The following figure shows an example that uses the ARFilterActionList structure.
Generic list structure
For simplicity, subsequent structure diagrams do not illustrate the numItems element (unsigned int) for any list structures. The number of items in the list is the first component of all list structures in the API. For information about the notation used to represent data relationships, see Data-relationships.
In general, the AR System server manages lists as arrays instead of linked lists. It then stores all items in the structure in a single area of memory with a pointer that identifies the memory address of the first item in the array. If the item structure itself (ARFilterActionStruct) contains a pointer, the server allocates the nested memory separately.