zorba::Collection#include <zorba/collection.h> Inherited from: zorba::SmartObject 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.Public Functions
Protected Attributes
Public FunctionsaddReferencevoid addReference() const
contentsItemSequence_t contents()=0 This function returns the sequence of nodes of the collection.
ReturnsThe sequence contained in the given collection.deleteNodeFirstvoid deleteNodeFirst()=0 This function deletes the first node from a collection.
Parameters
deleteNodeLastvoid deleteNodeLast()=0 This function deletes the last node from a collection.
Parameters
deleteNodesvoid deleteNodes(const ItemSequence_t &aNodes)=0 This function deletes zero of more nodes from a collection.
Parameters
Parameters
deleteNodesFirstvoid deleteNodesFirst(unsigned long aNumNodes)=0 This function deletes the n first nodes from a collection.
Parameters
deleteNodesLastvoid deleteNodesLast(unsigned long aNumNodes)=0 This function deletes the n last nodes from a collection.
Parameters
freevoid free()
getAnnotationsvoid getAnnotations(std::vector< Annotation_t > &aAnnotations) const =0 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. Returnsa list of all annotations for the given collection (if found)getNameconst Item getName() const =0 Get the name of the collection.
ReturnsThe name of the collection.getRefCountlong getRefCount() const
getTypeSequenceType getType() const =0 Retrieves the sequence type for this (static declared) collection.
Returnsthe sequence type for the said collection, or 0 if this collection is not statically declared.ReturnsisStatic()indexOflong long indexOf(const Item &aNode)=0 This function returns the index of the given node in the collection.
Parameters
ReturnsReturns the position of the given node in the collection.Parameters
insertNodesAftervoid 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.
Parameters
Parameters
insertNodesBeforevoid 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.
Parameters
Parameters
insertNodesFirstvoid insertNodesFirst(const ItemSequence_t &aNodes)=0 This function inserts copies of the given nodes at the beginning of the collection.
Parameters
insertNodesLastvoid insertNodesLast(const ItemSequence_t &aNodes)=0 This function inserts copies of the given nodes at the end of the collection.
Parameters
isStaticbool isStatic() const =0 The function checks if this collection has been statically declared.
Returnstrue if the collection is a static collection, false otherwise.registerDiagnosticHandlervoid registerDiagnosticHandler(DiagnosticHandler *aDiagnosticHandler)=0 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. Parameters
removeReferencevoid removeReference()
~Collection ~Collection() Destructor.
Protected AttributestheRefCountunsigned int theRefCount
|