# SUBSYSTEM OVERVIEW

Object Tree Manager (OTM) Subsystem

The OTM subsystem is used to maintain trees of objects. The objects may be a single data type or a structure of many data types. The objects will be stored in order defined by the specified compare function.

# USAGE

To use the object tree manager you must first create a tree by executing otm_CreateTree. After a tree has been created, objects may be added to the tree with otm_AddObject. Duplicate objects will be prevented from being added to the tree. Arrays of objects may be added using the otm_AddArray function. Objects may be removed from a tree with otm_RemoveObject. Objects may be retrieved with either otm_GetObject to get a single object pointer, or otm_GetArray to get an array of objects. The tree may be cycled using otm_CycleTree to get the object pointers one at a time. The mpm_LastError function should be used after cycling, since an error and the end of a tree both return a NULL pointer. A new tree may be created with either otm_CopyTree or otm_MergeTree. The otm_CopyTree function makes a duplicate copy of the specified tree and all its objects. The otm_MergeTree function will combine two trees into one using either the OTM_UNION, OTM_DIFFERENCE, or OTM_INTERSECTION operator. When finished with the tree, otm_DeleteTree should be called to free all memory associated with the tree.