
The STACK organization provides fast LIFO (last-in first-out) and FIFO (first-in first-out) stacks.
There are three ways of implementing a stack in OrgC++:
push() pushes a new object onto the stack;
pop() returns the next object and disconnects it from
the stack.
When pop() returns NULL, the stack is empty.
When using the RING, LIFO, or FIFO organizations, start=NULL must be set before using the stack. When using the array-style stack, the array must be declared by ZZ_HYPER_ARRAY(), and formed by form() (See Chap.11.15)
| ZZ_HYPER_LIFO(id,TYPE); ZZ_HYPER_FIFO(id,TYPE); |
Declare the two types of the queue. |
| void id.push(TYPE *obj); | Pushes the given object into the queue. |
| TYPE* id.pop(); | Pops another object from the queue. When returning NULL, the queue is empty. |
| Next Section 11.8 ENTITY_RELATIONSHIP MODEL |