Public Member Functions | Protected Attributes
zorba::Collection Class Reference

A Collection is a persistent sequence of node items. More...

#include <zorba/collection.h>

Inheritance diagram for zorba::Collection:
Inheritance graph
[legend]
Collaboration diagram for zorba::Collection:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

virtual zorba::Collection::~Collection ( ) [inline, virtual]

Destructor.

Definition at line 182 of file collection.h.


Member Function Documentation

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.

Returns:
The sequence contained in the given collection.
virtual void zorba::Collection::deleteNodeFirst ( ) [pure virtual]

This function deletes the first node from a collection.

Exceptions:
XDDY0011if the collection doesn't contain any node.
virtual void zorba::Collection::deleteNodeLast ( ) [pure virtual]

This function deletes the last node from a collection.

Exceptions:
XDDY0011if 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.

Parameters:
aNodesthe nodes in the collection that should be deleted.
Exceptions:
XDDY0011if 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.

Exceptions:
XDDY0011if 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.

Exceptions:
XDDY0011if 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.

Returns:
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.

Parameters:
aNodeThe node to retrieve the index from.
Returns:
Returns the position of the given node in the collection.
Exceptions:
XDDY0011if 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.

Parameters:
aTargetthe node in the collection after which the sequence should be inserted.
aNodesThe sequences of nodes whose copies should be added to the collection.
Exceptions:
XDDY0011if 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.

Parameters:
aTargetthe node in the collection before which the sequence should be inserted.
aNodesThe sequences of nodes whose copies should be added to the collection.
Exceptions:
XDDY0011if 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.

Parameters:
aNodesThe 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.

Parameters:
aNodesThe 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.


Member Data Documentation

unsigned int zorba::SmartObject::theRefCount [mutable, protected, inherited]

Definition at line 27 of file smart_ptr.h.


The documentation for this class was generated from the following file:
blog comments powered by Disqus