COLLADA 1.4 DOM: daeSTLDatabase Class Reference

COLLADA

daeSTLDatabase Class Reference

#include <daeSTLDatabase.h>

Inheritance diagram for daeSTLDatabase:

Inheritance graph
[legend]
Collaboration diagram for daeSTLDatabase:

Collaboration graph
[legend]
List of all members.

Detailed Description

The daeSTLDatabase class derives from daeDatabase and implements the default database.

Public Member Functions

 daeSTLDatabase ()
 Constructor.
virtual ~daeSTLDatabase ()
 Destructor.
virtual daeUInt getTypeCount ()
 Gets the number of types in the database.
virtual daeString getTypeName (daeUInt index)
 Retrieves the name of a type of object inserted in the database.
virtual daeInt setMeta (daeMetaElement *_topMeta)
 Sets the top meta object.
virtual daeInt insertCollection (const char *name, daeElement *dom, daeCollection **collection=NULL)
 Creates a new collection, defining its root as the dom object; returns an error if the collection name already exists.
virtual daeInt insertCollection (daeString name, daeCollection **collection=NULL)
 Creates a new domCOLLADA root element and a new collection; returns an error if the collection name already exists.
virtual daeInt createCollection (daeString name, daeElement *dom, daeCollection **collection=NULL)
 Creates a new collection, defining its root as the dom object; returns an error if the collection name already exists.
virtual daeInt createCollection (daeString name, daeCollection **collection=NULL)
 Creates a new domCOLLADA root element and a new collection; returns an error if the collection name already exists.
virtual daeInt insertCollection (daeCollection *c)
 Inserts an already existing collection into the database.
virtual daeInt removeCollection (daeCollection *collection)
 Removes a collection from the database.
virtual daeUInt getCollectionCount ()
 Gets the number of collections.
virtual daeCollectiongetCollection (daeUInt index)
 Gets a collection based on the collection index.
virtual daeCollectiongetCollection (daeString name)
 Gets a collection based on the collection name.
virtual daeString getCollectionName (daeUInt index)
 Gets a collection name.
virtual daeBool isCollectionLoaded (daeString name)
 Indicates if a collection is loaded or not.
virtual daeInt insertElement (daeCollection *collection, daeElement *element)
 Inserts a daeElement into the runtime database.
virtual daeInt removeElement (daeCollection *collection, daeElement *element)
 Removes a daeElement from the runtime database; not implemented in the reference STL implementation.
virtual daeInt clear ()
 Unloads all of the collections of the runtime database.
virtual void validate ()
 Optimizes the database.
virtual daeUInt getElementCount (daeString name=NULL, daeString type=NULL, daeString file=NULL)
 Gets the number of daeElement objects that match the search criteria Any combination of search criteria can be NULL, if a criterion is NULL all the parameters will match for this criterion.
virtual daeInt getElement (daeElement **pElement, daeInt index, daeString name=NULL, daeString type=NULL, daeString file=NULL)
 Returns the daeElement which matches the search criteria.
virtual daeInt queryElement (daeElement **pElement, daeString genericQuery)
 Returns the daeElement which matches the genericQuery parameter; not implemented.

Member Function Documentation

daeInt daeSTLDatabase::clear  )  [virtual]
 

Unloads all of the collections of the runtime database.

This function frees all the dom* objects and integration objects created so far, except any objects on which you still have a smart pointer reference (daeSmartRef).

Returns:
Returns DAE_OK if all collections successfully unloaded, otherwise returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeInt daeSTLDatabase::createCollection daeString  name,
daeCollection **  collection = NULL
[virtual]
 

Creates a new domCOLLADA root element and a new collection; returns an error if the collection name already exists.

Parameters:
name Name of the new collection, must be a valid URI.
collection Pointer to a daeCollection pointer that receives the collection created
Returns:
Returns DAE_OK if the collection was created successfully, otherwise returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeInt daeSTLDatabase::createCollection daeString  name,
daeElement dom,
daeCollection **  collection = NULL
[virtual]
 

Creates a new collection, defining its root as the dom object; returns an error if the collection name already exists.

Parameters:
name Name of the new collection, must be a valid URI.
dom Existing domCOLLADA root element of the collection
collection Pointer to a daeCollection pointer that receives the collection created
Returns:
Returns DAE_OK if the collection was created successfully, otherwise returns a negative value as defined in daeError.h.
Note:
The daeElement passed in as dom should always be a domCOLLADA object, the API may enforce this in the future.

Implements daeDatabase.

daeCollection * daeSTLDatabase::getCollection daeString  name  )  [virtual]
 

Gets a collection based on the collection name.

Parameters:
name The name of the collection as a URI.
Returns:
Returns a pointer to the collection, or NULL if not found.
Note:
If the URI contains a fragment, the fragment is stripped off.

Implements daeDatabase.

daeCollection * daeSTLDatabase::getCollection daeUInt  index  )  [virtual]
 

Gets a collection based on the collection index.

Parameters:
index Index of the collection to get.
Returns:
Returns a pointer on the collection, or NULL if not found.

Implements daeDatabase.

daeUInt daeSTLDatabase::getCollectionCount  )  [virtual]
 

Gets the number of collections.

Returns:
Returns the number of collections.

Implements daeDatabase.

daeString daeSTLDatabase::getCollectionName daeUInt  index  )  [virtual]
 

Gets a collection name.

Parameters:
index Index of the collection to get.
Returns:
Returns the name of the collection at the given index.

Implements daeDatabase.

daeInt daeSTLDatabase::getElement daeElement **  pElement,
daeInt  index,
daeString  name = NULL,
daeString  type = NULL,
daeString  file = NULL
[virtual]
 

Returns the daeElement which matches the search criteria.

Any combination of search criteria can be NULL, if a criterion is NULL all the parameters will match for this criterion. The function operates on the set of assets that match the name, type and file search criteria, with the index parameter indicating which asset within the set is returned. Calling daeElement(&pElement,index) without search criteria returns the daeElement number index in the database without any consideration of name, type or collection. Criteria can not be specified with wildcards, either a criterion is set and it will have to match, or it is not set and all daeElements match for this criterion. The default database search is roughly in log2(n). Maximum performance is obtained when querying by type and a name. Any other combination results in a slight overhead, but the overall search time remains around log2(n).

Parameters:
pElement Pointer of a daeElement* which receives the found daeElement if the search succeeds
index Index within the set of daeElements that match the search criteria
name Name or id of the daeElement, for example "mycube1", can be NULL
type Type of the daeElement to get, this can be any COLLADA tag such as <geometry> or <library>, can be NULL
file Name of the collection or file, for example, "myCollection.xml", can be NULL
Returns:
Returns DAE_OK upon success, returns DAE_ERR_QUERY_NO_MATCH if there is no match, otherwise, returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeUInt daeSTLDatabase::getElementCount daeString  name = NULL,
daeString  type = NULL,
daeString  file = NULL
[virtual]
 

Gets the number of daeElement objects that match the search criteria Any combination of search criteria can be NULL, if a criterion is NULL all the parameters will match for this criterion.

Hence getElementCount() called without parameters returns the total number of daeElement objects in the database. Criteria can not be specified with wildcards, either a criterion is set and it will have to match, or it is not set and all daeElements match for this criterion.

Parameters:
name Name or id of the daeElement, for example, "mycube1", can be NULL
type Type of daeElement to find, this can be any COLLADA tag such as <geometry> or <library>, can be NULL
file Name of the collection or file, for example, "myCollection.xml", can be NULL
Returns:
Returns the number of elements matching this query.

Implements daeDatabase.

daeUInt daeSTLDatabase::getTypeCount  )  [virtual]
 

Gets the number of types in the database.

Returns:
Returns the number of different types of objects inserted in the database.

Implements daeDatabase.

daeString daeSTLDatabase::getTypeName daeUInt  index  )  [virtual]
 

Retrieves the name of a type of object inserted in the database.

Parameters:
index Index of the type; must be between 0 and daeDatabase::getTypeCount()-1
Returns:
Returns the name of the type, NULL if the index is invalid.

Implements daeDatabase.

daeInt daeSTLDatabase::insertCollection daeCollection c  )  [virtual]
 

Inserts an already existing collection into the database.

Parameters:
c The collection to insert.
Returns:
Returns DAE_OK if the collection was inserted successfully, otherwise returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeInt daeSTLDatabase::insertCollection daeString  name,
daeCollection **  collection = NULL
[virtual]
 

Creates a new domCOLLADA root element and a new collection; returns an error if the collection name already exists.

Parameters:
name Name of the new collection, must be a valid URI.
collection Pointer to a daeCollection pointer that receives the collection created
Returns:
Returns DAE_OK if the collection was created successfully, otherwise returns a negative value as defined in daeError.h.
Deprecated:
This function will be removed in future versions.
Please use createCollection.

Implements daeDatabase.

daeInt daeSTLDatabase::insertCollection const char *  name,
daeElement dom,
daeCollection **  collection = NULL
[virtual]
 

Creates a new collection, defining its root as the dom object; returns an error if the collection name already exists.

Parameters:
name Name of the new collection, must be a valid URI.
dom Existing domCOLLADA root element of the collection
collection Pointer to a daeCollection pointer that receives the collection created
Returns:
Returns DAE_OK if the collection was created successfully, otherwise returns a negative value as defined in daeError.h.
Note:
The daeElement passed in as dom should always be a domCOLLADA object, the API may enforce this in the future.
Deprecated:
This function will be removed in future versions.
Please use createCollection.

Implements daeDatabase.

daeInt daeSTLDatabase::insertElement daeCollection collection,
daeElement element
[virtual]
 

Inserts a daeElement into the runtime database.

Parameters:
collection Collection in which the daeElement lives.
element daeElement to insert in the database
Returns:
Returns DAE_OK if element successfully inserted, otherwise returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeBool daeSTLDatabase::isCollectionLoaded daeString  name  )  [virtual]
 

Indicates if a collection is loaded or not.

Parameters:
name Name of the collection as a URI.
Returns:
Returns true if the collection is loaded, false otherwise.
Note:
If the URI contains a fragment, the fragment is stripped off.

Implements daeDatabase.

daeInt daeSTLDatabase::queryElement daeElement **  pElement,
daeString  genericQuery
[virtual]
 

Returns the daeElement which matches the genericQuery parameter; not implemented.

Parameters:
pElement Element to return.
genericQuery Generic query
Returns:
Returns DAE_OK if it succeeds, returns DAE_ERR_QUERY_NO_MATCH if there is no match, otherwise returns a negative value as defined in daeError.h.
Note:
This function is not implemented.

Implements daeDatabase.

daeInt daeSTLDatabase::removeCollection daeCollection collection  )  [virtual]
 

Removes a collection from the database.

Parameters:
collection Collection to remove from the database
Returns:
Returns DAE_OK if the collection was successfully removed, otherwise returns a negative value as defined in daeError.h.

Implements daeDatabase.

daeInt daeSTLDatabase::removeElement daeCollection collection,
daeElement element
[virtual]
 

Removes a daeElement from the runtime database; not implemented in the reference STL implementation.

Parameters:
collection Collection in which the daeElement lives.
element Element to remove.
Returns:
Returns DAE_OK if element successfully removed, otherwise returns a negative value as defined in daeError.h.
Note:
This function is not implemented in the reference STL implementation.

Implements daeDatabase.

daeInt daeSTLDatabase::setMeta daeMetaElement _topMeta  )  [virtual]
 

Sets the top meta object.

Called by dae::setDatabase() when the database changes. It passes to this function the top meta object, which is the root of a hierarchy of daeMetaElement objects. This top meta object is capable of creating any of the root objects in the DOM tree.

Parameters:
_topMeta Top meta object to use to create objects to fill the database.
Returns:
Returns DAE_OK if successful, otherwise returns a negative value defined in daeError.h.

Implements daeDatabase.

void daeSTLDatabase::validate  )  [virtual]
 

Optimizes the database.

This function takes time; it is called by the interface at the end of a load operation. Some databases cannot be queried when items are being inserted; for instance, they may need to be sorted. All database search functions call validate(); you should not need to call this function directly.

Implements daeDatabase.


The documentation for this class was generated from the following files:
  • C:/SVN_wf/COLLADA_DOM/include/modules/daeSTLDatabase.h
  • C:/SVN_wf/COLLADA_DOM/src/modules/STLDatabase/daeSTLDatabase.cpp

©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:47:04 2006 for COLLADA 1.4 DOM by doxygen 1.4.3