zorba::CollectionManager

#include <zorba/collection_manager.h>

This class defines a set of functions for managing persistent collections.

Public Functions

ItemSequence_t

availableCollections() const =0

This function returns a sequence of names of the collections that are available.

void

createCollection(const Item &aName)=0

This function creates the collection with the given name.

void

createCollection(const Item &aName, const ItemSequence_t &aContents)=0

This function creates the collection with the given name.

void

deleteCollection(const Item &aName)=0

This function removes the collection with the given name.

Collection_t

getCollection(const Item &aName) const =0

Returns a instance of the Collection class which can be used to modify and retrieve the contents of the collection identified by the given name.

bool

isAvailableCollection(const Item &aName) const =0

This function returns true if a collection with the given name is available.

void

registerDiagnosticHandler(DiagnosticHandler *aDiagnosticHandler)=0

Register a DiagnosticHandler to which errors occuring during the management of collections are reported.

~CollectionManager()

Destructor.

Public Functions

availableCollections

ItemSequence_t availableCollections() const =0

This function returns a sequence of names of the collections that are available.

If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager methods), the collections returned by this function are also statically declared.

Returns

The list of names of the available collections.

createCollection

void createCollection(const Item &aName)=0

This function creates the collection with the given name.

Parameters

aName The name of the collection to create.

Parameters

XDDY0002 if a collection with the given name already exists.

createCollection

void createCollection(const Item &aName, const ItemSequence_t &aContents)=0

This function creates the collection with the given name.

Moreover, it adds copies of the sequence aContents to the new collection.

Parameters

aName The name of the collection to create.
aContents The sequence of items.

Parameters

XDDY0002 if a collection with the given name already exists.

deleteCollection

void deleteCollection(const Item &aName)=0

This function removes the collection with the given name.

Parameters

aName The name of the collection to delete.

Parameters

XDDY0003 if the collection does not exist.

getCollection

Collection_t getCollection(const Item &aName) const =0

Returns a instance of the Collection class which can be used to modify and retrieve the contents of the collection identified by the given name.

Parameters

aName The name of the collection to retrieve.

Parameters

XDDY0003 if the collection does not exist.

isAvailableCollection

bool isAvailableCollection(const Item &aName) const =0

This function returns true if a collection with the given name is available.

If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager() methods), the collection also needs to be statically declared.

Parameters

aName The name of the collection that is being checked.

Returns

true if the collection is available and false otherwise.

registerDiagnosticHandler

void registerDiagnosticHandler(DiagnosticHandler *aDiagnosticHandler)=0

Register a DiagnosticHandler to which errors occuring during the management of collections are reported.

If no DiagnosticHandler has been set using this function or the corresponding function of the XmlDataManager then subclasses of the ZorbaException class are thrown to report errors.

Parameters

aDiagnosticHandler DiagnosticHandler to which errors are reported. The caller retains ownership over the DiagnosticHandler passed as parameter.

~CollectionManager

 ~CollectionManager()

Destructor.