Public Member Functions | List of all members
CollectionManager Class Reference

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

Public Member Functions

ItemSequence availableCollections ()
 This function returns a sequence of names of the collections that are available.
 CollectionManager (const CollectionManager &aMgr)
 CollectionManager (zorba::CollectionManager *aMgr)
void createCollection (const Item &aName)
 This function creates the collection with the given name.
void createCollection (const Item &aName, const ItemSequence &aContents)
 This function creates the collection with the given name.
void deleteCollection (const Item &aName)
 This function removes the collection with the given name.
Collection getCollection (const Item &aName)
 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)
 This function returns true if a collection with the given name is available.
void registerDiagnosticHandler (DiagnosticHandler *aDiagnosticHandler)
 Register a DiagnosticHandler to which errors occuring during the management of collections are reported.

Detailed Description

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

Definition at line 23 of file CollectionManager.h.

Constructor & Destructor Documentation

CollectionManager::CollectionManager ( const CollectionManager aMgr)

Definition at line 29 of file CollectionManager.h.

CollectionManager::CollectionManager ( zorba::CollectionManager *  aMgr)

Definition at line 30 of file CollectionManager.h.

Member Function Documentation

ItemSequence CollectionManager::availableCollections ( )

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.
void CollectionManager::createCollection ( const Item aName)

This function creates the collection with the given name.

Parameters
aNameThe name of the collection to create.
Exceptions
XDDY0002if a collection with the given name already exists.
void CollectionManager::createCollection ( const Item aName,
const ItemSequence aContents 
)

This function creates the collection with the given name.

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

Parameters
aNameThe name of the collection to create.
aContentsThe sequence of items.
Exceptions
XDDY0002if a collection with the given name already exists.
void CollectionManager::deleteCollection ( const Item aName)

This function removes the collection with the given name.

Parameters
aNameThe name of the collection to delete.
Exceptions
XDDY0003if the collection does not exist.
Collection CollectionManager::getCollection ( const Item aName)

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
aNameThe name of the collection to retrieve.
Exceptions
XDDY0003if the collection does not exist.
bool CollectionManager::isAvailableCollection ( const Item aName)

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
aNameThe name of the collection that is being checked.
Returns
true if the collection is available and false otherwise.
void CollectionManager::registerDiagnosticHandler ( DiagnosticHandler aDiagnosticHandler)

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
aDiagnosticHandlerDiagnosticHandler to which errors are reported. The caller retains ownership over the DiagnosticHandler passed as parameter.

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