# Available Classes - Data Object Library

**Question: Why doesn't this link to documentation instead?**

Our library provides a greater variety of data structures than STL or Rogue Wave's tools.h++, even though we have fewer classes and functions. Our design philosophy has always been that coding with a class library should be possible without constantly searching through the documentation.

Our classes are more universal, and we provide the minimum set of functions to manipulate each data structure. As examples: our dynamic ARRAY includes an array of objects, an array of pointers, a stack, and a binary heap; or our COLLECTION is regular or ordered, depending on how you treat it. Our trees do not include breath-first or depth-first searches, because these can be coded in 3-4 lines using our iterators. Many of our data structures include two-way pointer relations which cannot be implemented with containers - for example AGGREGATE or GRAPH.

Even though our library has been around much longer than STL, the style of its interface is surprisingly similar to that of STL. Most functions apply to more than one class, and iterators for different data structures are almost identical. This makes it easy to replace one data structure by another, similar one. In spite of the similarities, the interfaces of DOL and STL cannot be identical. The internal design of the library (intrusive data vs. containers) implies a different style of use. For example, intrusive data structures are naturally 'sets', while container based data structures are naturally 'bags'.

Frequently used functions (Many functions have abbreviated names):

add() ... add/append an item ins() ... insert an item del() ... delete/remove an item without destroying it fwd() ... move forward bwd() ... move backward par() ... get parent child() ... get the prime child (head of the list) chld() ... get the secondary child (tail of the list) set() ... make the selected item to be the prime child merge() ... splits or merges two lists

All iterators have: a constructor, start(), and operators ++ and possibly --. We believe that adding other functions to the iterator only complicates its use. Note that even simple pointer relations are recorded as 'data organizations'. This is necessary for automatic data persistency.

**SINGLE_RING(T)**

[Intrusive, circular ring of objects type T, singly linked. The user may control the order. Can also be used as a stack/queue.]

Functions: *add,del,merge,sort,fwd.*

**DOUBLE_RING(T)**

[Just like SINGLE_RING, but doubly linked] Can also be used as a stack/queue.]

Functions: *add,ins,del,merge,sort,fwd,bwd.*

**SINGLE_COLLECT(P,C)**

[Basic intrusive collection. Each object of the parent class P keeps a singly linked ring of children, class C. Similar to SINGLE_RING, but encapsulated under the parent class.]

Functions: *add,del,set,merge,sort,fwd,child,chld,switchParents.*

**DOUBLE_COLLECT(P,C)**

[Just like SINGLE_COLLECT, but doubly linked.]

Functions: *add,ins,del,set,merge,sort,fwd,bwd,child,chld,switchParents.*

**SINGLE_AGGREGATE(P,C)**

[Just like SINGLE_COLLECT, but each child has a pointer to its parent.]

Functions: *add,del,set,merge,sort,fwd,child,chld,switchParents,par.*

**DOUBLE_AGGREGATE(P,C)**

[Just like SINGLE_AGGREGATE, but doubly linked.]

Functions: *add,ins,del,set,merge,sort,fwd,bwd,child,chld,switchParents,par.*

**NAME(T)**

[This is similar to the String class. Every object of type T has a pointer to a variable length, \0 ending text string.]

Functions: *add,del,fwd.*

**SINGLE_LINK(S,T)**

[Each object of the source type, S, has a pointer to the target, type T. The T object has no pointer or knowledge of who points to it.]

Functions: *add,del,fwd.*

**DOUBLE_LINK(S,T)**

[T points to S, and S points to T.]

Functions: *add,del,fwd,bwd.*

**GENERAL_LINK(T)**

[T has a void* pointer.]

Functions: *add,del,fwd.*

**LIFO(T)**

[Last in, first out queue.]

Functions: *push, pop.*

**FIFO(T)**

[First in, first out queue.]

Functions: *push, pop.*

**REFERENCE(S,T)**

[Source S points to target T; T keeps a count of how many S point to it.]

Functions: *add,del,fwd,set,get.*

**SINGLE_TREE(T)**

[Each object of class T keeps a singly-linked list of children. The iterator traverses the children of a given parent.]

Functions: *add,app,del,fwd,par,child.*

**DOUBLE_TREE(T)**

[Just like SINGLE_TREE, but children form a doubly-linked list. The iterator traverses the children of a given parent.]

Functions: *add,app,ins,del,fwd,bwd,par,child.*

**SINGLE_GRAPH(N,E)**

[Each node N keeps a singly-linked list of adjacent edges, E. Each edge knows its source and target nodes. Can be used for both directed and undirected graphs. The iterator traverses adjacent edges.]

Functions: *add,del,nodes,edge,fwd,set.*

**DIRECT_GRAPH(N,E)**

[Each node N keeps a singly-linked list of adjacent edges, E. Each edge points to a target node, but does not know its source node. The iterator traverses adjacent edges.]

Functions: *add,del,nodes,edge,fwd,set.*

**1_TO_1(S,R,T)**

[One-to-one relation. Source S and target T are connected via relation R. R knows the source and target.]

Functions: *add,del,fwd,bwd,source,target.*

**1_TO_N(S,R,T)**

[One-to-many relation. Source S keeps a set of relations R. Each relation knows its source and target. The iterator traverses relation/target pairs for a given source.]

Functions: *add,del,fwd,bwd,source,target.*

**M_TO_1(S,R,T)**

[Many-to-one relation. Reverse of 1_TO_N. Actually, 1_TO_N can be used instead.]

Functions: *add,del,fwd,bwd,source,target.*

**M_TO_N(S,R,T)**

[Many-to-many relation. An S object can have multiple relations with different T objects, while any T object can have multiple relations with S objects. Each R is on two independent lists: One for all R's that have the same S as source, and one for all R's that have the same T as target. The iterator traverses relation/target pairs for a given source.]

Functions: *add,del,fwd,bwd,source,target,nxtOnTarg,preOnTarg,nxtOnSour, preOnSour.*

**ARRAY(H,T)**

[Every H object keeps a dynamic array of T's. T can be a pointer, for example ARRAY(MyClass,char*). This data organization can also be used as a binary heap, or a stack. There is no iterator. Function ind() replaces operator []; for a given index, it returns a pointer to the element of the array.]

Functions: *form,formed,free,size,ind,head,reset,push,pop,sort,inHeap, outHeap,updHeap,delHeap.*

**HASH(H,T)**

[Every H object keeps a hash table of T's. The user supplies the hashing function, but default functions for hashing an integer or a text string are available. The iterator traverses objects within the same bucket.]

Functions: *form,formed,resize,add,del,size,slot,free,get.*

**PROPERTY(T)**

[LISP-like property: Objects of type T can have any number of labelled properties. The values can be int, float, char, string, or an array of any of these. There is an overhead of only one pointer for each T.]

Functions: *setProp,getProp.*

**PAGER(T)**

[Each object of type T has an infinitely large array of characters, which is paged to disk according to the user's specification. Function addr() returns a pointer to the object directly inside its page, function io() copies objects in/out of the disk as if it were a database.]

Functions: *form,addr,io,close.*

**TYPE()**

[On demand, provides the meta-structure of your classes, including a mask which detects virtual function pointers.]

Function: *getType,virtRange,num,info,true.*

**UTILITIES()**

[Disk saving utilities, including allocation and deallocation of strings, functions which detect the closure of all objects, error detection, and entry into the intelligent browser, which lets you traverse your data structures.]

Functions: *too many and too specialized to list them here.*