A Collection is a persistent sequence of node items. More...
#include <zorba/collection.h>
Public Member Functions | |
void | addReference () const |
virtual ItemSequence_t | contents ()=0 |
This function returns the sequence of nodes of the collection. | |
virtual void | deleteNodeFirst ()=0 |
This function deletes the first node from a collection. | |
virtual void | deleteNodeLast ()=0 |
This function deletes the last node from a collection. | |
virtual void | deleteNodes (const ItemSequence_t &aNodes)=0 |
This function deletes zero of more nodes from a collection. | |
virtual void | deleteNodesFirst (unsigned long aNumNodes)=0 |
This function deletes the n first nodes from a collection. | |
virtual void | deleteNodesLast (unsigned long aNumNodes)=0 |
This function deletes the n last nodes from a collection. | |
virtual void | free () |
virtual const Item | getName () const =0 |
Get the name of the collection. | |
long | getRefCount () const |
virtual long long | indexOf (const Item &aNode)=0 |
This function returns the index of the given node in the collection. | |
virtual void | insertNodesAfter (const Item &aTarget, const ItemSequence_t &aNodes)=0 |
This function inserts copies of the given nodes into a collection at the position directly following the given target node. | |
virtual void | insertNodesBefore (const Item &aTarget, const ItemSequence_t &aNodes)=0 |
This function inserts copies of the given nodes into a collection at the position directly preceding the given target node. | |
virtual void | insertNodesFirst (const ItemSequence_t &aNodes)=0 |
This function inserts copies of the given nodes at the beginning of the collection. | |
virtual void | insertNodesLast (const ItemSequence_t &aNodes)=0 |
This function inserts copies of the given nodes at the end of the collection. | |
void | removeReference () |
virtual | ~Collection () |
Destructor. | |
Protected Attributes | |
unsigned int | theRefCount |
A Collection is a persistent sequence of node items.
Instances of this class can be used to modify or retrieve the contents of a collection.
The variable aNodes passed to any of the insert functions is evaluated as though it were an enclosed expression in an element constructor. The result of this step is a sequence of nodes to be inserted into the collection.
Note: This class is reference counted. When writing multi-threaded clients, it is the responibility of the client code to synchronize assignments to the SmartPtr holding this object.
virtual zorba::Collection::~Collection | ( | ) | [inline, virtual] |
Destructor.
Definition at line 182 of file collection.h.
void zorba::SmartObject::addReference | ( | ) | const [inline, inherited] |
Definition at line 40 of file smart_ptr.h.
virtual ItemSequence_t zorba::Collection::contents | ( | ) | [pure virtual] |
This function returns the sequence of nodes of the collection.
virtual void zorba::Collection::deleteNodeFirst | ( | ) | [pure virtual] |
This function deletes the first node from a collection.
XDDY0011 | if the collection doesn't contain any node. |
virtual void zorba::Collection::deleteNodeLast | ( | ) | [pure virtual] |
This function deletes the last node from a collection.
XDDY0011 | if the collection doesn't contain any node. |
virtual void zorba::Collection::deleteNodes | ( | const ItemSequence_t & | aNodes | ) | [pure virtual] |
This function deletes zero of more nodes from a collection.
aNodes | the nodes in the collection that should be deleted. |
XDDY0011 | if any nodes in the given sequence is not a member of a collection or not all nodes of the sequence belong to the same collection. |
virtual void zorba::Collection::deleteNodesFirst | ( | unsigned long | aNumNodes | ) | [pure virtual] |
This function deletes the n first nodes from a collection.
XDDY0011 | if the collection doesn't contain any node. |
virtual void zorba::Collection::deleteNodesLast | ( | unsigned long | aNumNodes | ) | [pure virtual] |
This function deletes the n last nodes from a collection.
XDDY0011 | if the collection doesn't contain any node. |
virtual void zorba::SmartObject::free | ( | ) | [virtual, inherited] |
virtual const Item zorba::Collection::getName | ( | ) | const [pure virtual] |
Get the name of the collection.
long zorba::SmartObject::getRefCount | ( | ) | const [inline, inherited] |
Definition at line 38 of file smart_ptr.h.
virtual long long zorba::Collection::indexOf | ( | const Item & | aNode | ) | [pure virtual] |
This function returns the index of the given node in the collection.
aNode | The node to retrieve the index from. |
XDDY0011 | if node is not contained in any collection. |
virtual void zorba::Collection::insertNodesAfter | ( | const Item & | aTarget, |
const ItemSequence_t & | aNodes | ||
) | [pure virtual] |
This function inserts copies of the given nodes into a collection at the position directly following the given target node.
aTarget | the node in the collection after which the sequence should be inserted. |
aNodes | The sequences of nodes whose copies should be added to the collection. |
XDDY0011 | if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection. |
virtual void zorba::Collection::insertNodesBefore | ( | const Item & | aTarget, |
const ItemSequence_t & | aNodes | ||
) | [pure virtual] |
This function inserts copies of the given nodes into a collection at the position directly preceding the given target node.
aTarget | the node in the collection before which the sequence should be inserted. |
aNodes | The sequences of nodes whose copies should be added to the collection. |
XDDY0011 | if any nodes in the sequence is not a member of a collection or not all nodes of the sequence belong to the same collection. |
virtual void zorba::Collection::insertNodesFirst | ( | const ItemSequence_t & | aNodes | ) | [pure virtual] |
This function inserts copies of the given nodes at the beginning of the collection.
aNodes | The sequences of nodes whose copies should be added to the collection. |
virtual void zorba::Collection::insertNodesLast | ( | const ItemSequence_t & | aNodes | ) | [pure virtual] |
This function inserts copies of the given nodes at the end of the collection.
aNodes | The sequences of nodes whose copies should be added to the collection. |
void zorba::SmartObject::removeReference | ( | ) | [inline, inherited] |
Definition at line 42 of file smart_ptr.h.
unsigned int zorba::SmartObject::theRefCount [mutable, protected, inherited] |
Definition at line 27 of file smart_ptr.h.