Class representing a dynamic array of INodes.
#include <INodeTab.h>
Public Member Functions |
|
void | DisposeTemporary () |
Deletes all temporary nodes, such as those
of type INodeTransformed, from the
array. |
|
int | IndexOf (INode *node) |
Finds the specified node in the array and
returns its index. |
|
bool | Contains (INode *node) |
Checks whether the specified node is in the
array. |
|
int | AppendNode (INode *node, bool allowDups=false, int allocExtra=0) |
Adds a node to the end of the array.
|
|
int | InsertNode (INode *node, int at, bool allowDups=false) |
Inserts a node into the array at the
specified position. |
void DisposeTemporary | ( | ) | [inline] |
Deletes all temporary nodes, such as those of type INodeTransformed, from the array.
{ for (int i=0; i<Count(); i++) { if ((*this)[i] != NULL) { (*this)[i]->DisposeTemporary(); } } }
int IndexOf | ( | INode * | node | ) | [inline] |
Finds the specified node in the array and returns its index.
node | - The node to find |
{ for (int i=0; i<Count(); i++) { if ((*this)[i] == node) { return i; } } return -1; }
bool Contains | ( | INode * | node | ) | [inline] |
Checks whether the specified node is in the array.
node | - The node to find |
{ return (IndexOf(node) >= 0); }
int AppendNode | ( | INode * | node, |
bool | allowDups = false , |
||
int | allocExtra =
0 |
||
) | [inline] |
Adds a node to the end of the array.
node | - The node to add to the array |
allowDups | - If true, the specified node is added to the array without checking whether it's contained already in it. If false, the node is added to the array only if it doesn't exist in it yet. |
allocExtra | - The number of extra items by which the array should be enlarged if all its items have been filled with nodes. |
int InsertNode | ( | INode * | node, |
int | at, | ||
bool | allowDups =
false |
||
) | [inline] |
Inserts a node into the array at the specified position.
node | - The node to add to the array |
at | - Array index where to insert the specified node. If a negative value is specified, the node will be appended to the array. |
allowDups | - If true, the specified node is added to the array without checking whether it's contained already in it. If false, the node is added to the array only if it doesn't exist in it yet. |
{ if (at < 0) { AppendNode(node, allowDups); return Count(); } else if (allowDups || !Contains(node)) { return Insert(at, 1, &node); } return -1; }