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 void | getAnnotations (std::vector< Annotation_t > &aAnnotations) const =0 |
Retrieves all annotations for the given collection. | |
virtual const Item | getName () const =0 |
Get the name of the collection. | |
long | getRefCount () const |
virtual TypeIdentifier_t | getType () const =0 |
Retrieves the sequence type for this (static declared) collection. | |
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. | |
virtual bool | isStatic () const =0 |
The function checks if this collection has been statically declared. | |
virtual void | registerDiagnosticHandler (DiagnosticHandler *aDiagnosticHandler)=0 |
Register a DiagnosticHandler to which errors occuring during the management or manipulation of this collection are reported. | |
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.
Definition at line 39 of file collection.h.
virtual zorba::Collection::~Collection | ( | ) | [inline, virtual] |
Destructor.
Definition at line 183 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 void zorba::Collection::getAnnotations | ( | std::vector< Annotation_t > & | aAnnotations | ) | const [pure virtual] |
Retrieves all annotations for the given collection.
If the collection is a statically declared collection, the annotations are the ones that haven been given in the declaration of the collection (or the defaults). If the collection is a dynamic collection, the annotations are the default ones for dynamic collections.
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 TypeIdentifier_t zorba::Collection::getType | ( | ) | const [pure virtual] |
Retrieves the sequence type for this (static declared) collection.
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. |
virtual bool zorba::Collection::isStatic | ( | ) | const [pure virtual] |
The function checks if this collection has been statically declared.
virtual void zorba::Collection::registerDiagnosticHandler | ( | DiagnosticHandler * | aDiagnosticHandler | ) | [pure virtual] |
Register a DiagnosticHandler to which errors occuring during the management or manipulation of this collection are reported.
If no DiagnosticHandler has been set using (1) this function, (2) the corresponding function of the XmlDataManager, or (3) the corresponding function of the CollectionManager then subclasses of the ZorbaException class are thrown to report errors.
aDiagnosticHandler | DiagnosticHandler to which errors are reported. The caller retains ownership over the DiagnosticHandler passed as parameter. |
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.