zorba::Collection Class Reference

A Collection is a 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

virtual bool addDocument (std::istream &aInStream, const long aPosition=-1)=0
 Adds the document retrieved from the given input stream to the Collection.
virtual bool addNode (const Item &aNode, const Item &aTargetNode, bool aOrder)=0
 Adds a Node Item to the Collection after the targetNode.
virtual bool addNode (const Item &aNode, const long aPosition=-1)=0
 Adds a Node Item to the Collection.
virtual bool addNodes (const ResultIterator *aResultIterator)=0
 Adds the Node Items retrieved from the given ResultIterator to the Collection.
void addReference () const
virtual bool deleteNode (const long aPosition=-1)=0
 Deletes the Item at the given position from the Collection.
virtual bool deleteNode (const Item &aNode)=0
 Deletes the given Item from the Collection.
virtual void free ()
long getRefCount () const
virtual Item getUri () const =0
 Get the URI of a collection as an anyURI Item.
virtual Item nodeAt (const long aPosition)=0
 Get the node at the given position in the collection as a Node Item.
void removeReference ()
virtual unsigned long size () const =0
 Returns the number of items in the collection.
virtual ~Collection ()
 Destructor.

Protected Attributes

unsigned int theRefCount


Detailed Description

A Collection is a sequence of Node Items.

Each Collection is created by the XmlDataManager and referenced by a URI. The URI can be accessed in a query's fn:collection function.

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 34 of file collection.h.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 39 of file collection.h.


Member Function Documentation

virtual bool zorba::Collection::addDocument ( std::istream &  aInStream,
const long  aPosition = -1 
) [pure virtual]

Adds the document retrieved from the given input stream to the Collection.

Parameters:
aInStream the input stream from which to parse the document.
aPosition the position where the node will be inserted. By default the data will be appended at the end.
Returns:
true if the document was added to the collection (e.g. was a valid document), false otherwise.

virtual bool zorba::Collection::addNode ( const Item aNode,
const Item aTargetNode,
bool  aOrder 
) [pure virtual]

Adds a Node Item to the Collection after the targetNode.

Parameters:
aNode the Node Item to add.
aTargetNode the aNode will be added before the aTargetNode.
sOrder if true the aNode will be inserted before the aTarget. Otherwise aNode will be inserted after aTarget.
Returns:
true if the Node Item was added to the Collection, false otherwise.

virtual bool zorba::Collection::addNode ( const Item aNode,
const long  aPosition = -1 
) [pure virtual]

Adds a Node Item to the Collection.

Parameters:
aNode the Node Item to add.
aPosition the position where the node will be inserted. By default the data will be appended at the end.
Returns:
true if the Node Item was added to the Collection, false otherwise.

virtual bool zorba::Collection::addNodes ( const ResultIterator aResultIterator  )  [pure virtual]

Adds the Node Items retrieved from the given ResultIterator to the Collection.

Parameters:
aResultIterator the ResultIterator that produces the Node Items to add.
Returns:
true if all the Node Items of the given ResultIterator were added to the Collection, false otherwise.

void zorba::SmartObject::addReference (  )  const [inline, inherited]

Definition at line 39 of file smart_ptr.h.

virtual bool zorba::Collection::deleteNode ( const long  aPosition = -1  )  [pure virtual]

Deletes the Item at the given position from the Collection.

Parameters:
aPosition the position of the Node that will be removed from collection. By default the last Node will be removed from collection.
Returns:
true if the given Node Item was deleted, false otherwise.

virtual bool zorba::Collection::deleteNode ( const Item aNode  )  [pure virtual]

Deletes the given Item from the Collection.

Parameters:
aNode the Node Item to delete
Returns:
true if the given Node Item was deleted, false otherwise.

virtual void zorba::SmartObject::free (  )  [inline, virtual, inherited]

Definition at line 35 of file smart_ptr.h.

long zorba::SmartObject::getRefCount (  )  const [inline, inherited]

Definition at line 37 of file smart_ptr.h.

virtual Item zorba::Collection::getUri (  )  const [pure virtual]

Get the URI of a collection as an anyURI Item.

Returns:
Item the anyURI Item of the Collection.

virtual Item zorba::Collection::nodeAt ( const long  aPosition  )  [pure virtual]

Get the node at the given position in the collection as a Node Item.

Parameters:
aPosition the position of the Node in the collection.
Returns:
the Node Item at the given position.

void zorba::SmartObject::removeReference (  )  [inline, inherited]

Definition at line 41 of file smart_ptr.h.

virtual unsigned long zorba::Collection::size (  )  const [pure virtual]

Returns the number of items in the collection.

Returns:
The number of items in the collection.


Member Data Documentation

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

Definition at line 26 of file smart_ptr.h.


The documentation for this class was generated from the following file: