daeDatabase Class Reference

#include <daeDatabase.h>

Inheritance diagram for daeDatabase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual daeInt changeElementID (daeElement *element, daeString newID)=0
virtual daeInt changeElementSID (daeElement *element, daeString newSID)=0
virtual daeInt clear ()=0
daeInt createCollection (daeString name, daeDocument **document=NULL)
daeInt createCollection (daeString name, daeElement *dom, daeDocument **document=NULL)
virtual daeInt createDocument (daeString name, daeDocument **document=NULL)=0
virtual daeInt createDocument (daeString name, daeElement *dom, daeDocument **document=NULL, bool zaeRootDocument=false, const std::string &extractedFileURI="")=0
 daeDatabase (DAE &dae)
daeDocumentgetCollection (daeString name)
daeDocumentgetCollection (daeUInt index)
daeUInt getCollectionCount ()
daeString getCollectionName (daeUInt index)
virtual DAEgetDAE ()
daeDocumentgetDoc (daeUInt index)
virtual daeDocumentgetDocument (daeString name, bool skipUriNormalization=false)=0
virtual daeDocumentgetDocument (daeUInt index)=0
virtual daeUInt getDocumentCount ()=0
virtual daeString getDocumentName (daeUInt index)=0
virtual daeInt getElement (daeElement **pElement, daeInt index, daeString name=NULL, daeString type=NULL, daeString file=NULL)=0
virtual daeUInt getElementCount (daeString name=NULL, daeString type=NULL, daeString file=NULL)=0
virtual daeUInt getTypeCount ()=0
virtual daeString getTypeName (daeUInt index)=0
daeElementidLookup (const std::string &id, daeDocument *doc)
virtual std::vector< daeElement * > idLookup (const std::string &id)=0
daeInt insertCollection (daeDocument *c)
daeInt insertCollection (daeString name, daeDocument **document=NULL)
daeInt insertCollection (daeString name, daeElement *dom, daeDocument **document=NULL)
virtual daeInt insertDocument (daeDocument *c)=0
virtual daeInt insertDocument (daeString name, daeDocument **document=NULL)=0
virtual daeInt insertDocument (daeString name, daeElement *dom, daeDocument **document=NULL, bool zaeRootDocument=false, const std::string &extractedFileURI="")=0
virtual daeInt insertElement (daeDocument *document, daeElement *element)=0
daeBool isCollectionLoaded (daeString name)
virtual daeBool isDocumentLoaded (daeString name)=0
daeInt removeCollection (daeDocument *document)
virtual daeInt removeDocument (daeDocument *document)=0
virtual daeInt removeElement (daeDocument *document, daeElement *element)=0
virtual daeInt setMeta (daeMetaElement *_topMeta)=0
virtual void sidLookup (const std::string &sid, std::vector< daeElement * > &matchingElements, daeDocument *doc=NULL)=0
std::vector< daeElement * > sidLookup (const std::string &sid, daeDocument *doc=NULL)
template<typename T >
void typeLookup (std::vector< T * > &matchingElements, daeDocument *doc=NULL)
template<typename T >
std::vector< T * > typeLookup (daeDocument *doc=NULL)
virtual void typeLookup (daeInt typeID, std::vector< daeElement * > &matchingElements, daeDocument *doc=NULL)=0
std::vector< daeElement * > typeLookup (daeInt typeID, daeDocument *doc=NULL)
virtual ~daeDatabase ()

Protected Attributes

DAEdae

Detailed Description

The daeDatabase class defines the COLLADA runtime database interface.

Definition at line 24 of file daeDatabase.h.


Constructor & Destructor Documentation

daeDatabase::daeDatabase ( DAE dae  ) 

Constructor

virtual daeDatabase::~daeDatabase (  )  [inline, virtual]

Destructor

Definition at line 25 of file daeDatabase.h.


Member Function Documentation

virtual daeInt daeDatabase::changeElementID ( daeElement element,
daeString  newID 
) [pure virtual]

Updates the database to reflect a change to the ID of a daeElement.

Parameters:
element daeElement whose ID is going to change.
newID The ID that will be assigned to the element.
Returns:
Returns DAE_OK if the database was successfully updated, otherwise returns a negative value as defined in daeError.h.
Note:
The database doesn't actually change the ID of the element, it merely updates its internal structures to reflect the change. It's expected that the ID will be assigned to the element by someone else.

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::changeElementSID ( daeElement element,
daeString  newSID 
) [pure virtual]

Updates the database to reflect a change to the sid of a daeElement.

Parameters:
element daeElement whose sid is going to change.
newSID The sid that will be assigned to the element.
Returns:
Returns DAE_OK if the database was successfully updated, otherwise returns a negative value as defined in daeError.h.
Note:
The database doesn't actually change the sid of the element, it merely updates its internal structures to reflect the change. It's expected that the sid will be assigned to the element by someone else. Note - This function currently isn't implemented in the default database.

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::clear (  )  [pure virtual]

Unloads all of the documents of the runtime database. This function frees all the dom* objects created so far, except any objects on which you still have a smart pointer reference (daeSmartRef).

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

Implemented in daeSTLDatabase.

daeInt daeDatabase::createCollection ( daeString  name,
daeDocument **  document = NULL 
) [inline]

Definition at line 294 of file daeDatabase.h.

daeInt daeDatabase::createCollection ( daeString  name,
daeElement dom,
daeDocument **  document = NULL 
) [inline]

Definition at line 291 of file daeDatabase.h.

virtual daeInt daeDatabase::createDocument ( daeString  name,
daeDocument **  document = NULL 
) [pure virtual]

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

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

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::createDocument ( daeString  name,
daeElement dom,
daeDocument **  document = NULL,
bool  zaeRootDocument = false,
const std::string &  extractedFileURI = "" 
) [pure virtual]

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

Parameters:
name Name of the new document, must be a valid URI.
dom Existing domCOLLADA root element of the document
document Pointer to a daeDocument pointer that receives the document created
zaeRootDocument Indicates if the new document is the root document of a ZAE archive.
extractedFileURI URI to extracted dae file.
Returns:
Returns DAE_OK if the document 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.

Implemented in daeSTLDatabase.

daeDocument* daeDatabase::getCollection ( daeString  name  )  [inline]

Definition at line 309 of file daeDatabase.h.

daeDocument* daeDatabase::getCollection ( daeUInt  index  )  [inline]

Definition at line 306 of file daeDatabase.h.

daeUInt daeDatabase::getCollectionCount (  )  [inline]

Definition at line 303 of file daeDatabase.h.

daeString daeDatabase::getCollectionName ( daeUInt  index  )  [inline]

Definition at line 312 of file daeDatabase.h.

virtual DAE* daeDatabase::getDAE (  )  [virtual]

Get the associated DAE object.

Returns:
The associated DAE object.
daeDocument* daeDatabase::getDoc ( daeUInt  index  ) 

Gets a document based on the document index.

Parameters:
index Index of the document to get.
Returns:
Returns a pointer on the document, or NULL if not found.
virtual daeDocument* daeDatabase::getDocument ( daeString  name,
bool  skipUriNormalization = false 
) [pure virtual]

Gets a document based on the document name.

Parameters:
name The name of the document as a URI.
skipUriNormalization Use the document name as is; don't normalize it first. This is mostly for improved performance.
Returns:
Returns a pointer to the document, or NULL if not found.
Note:
If the URI contains a fragment, the fragment is stripped off.

Implemented in daeSTLDatabase.

virtual daeDocument* daeDatabase::getDocument ( daeUInt  index  )  [pure virtual]

Gets a document based on the document index.

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

Implemented in daeSTLDatabase.

virtual daeUInt daeDatabase::getDocumentCount (  )  [pure virtual]

Gets the number of documents.

Returns:
Returns the number of documents.

Implemented in daeSTLDatabase.

virtual daeString daeDatabase::getDocumentName ( daeUInt  index  )  [pure virtual]

Gets a document name.

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

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::getElement ( daeElement **  pElement,
daeInt  index,
daeString  name = NULL,
daeString  type = NULL,
daeString  file = NULL 
) [pure virtual]

Implemented in daeSTLDatabase.

virtual daeUInt daeDatabase::getElementCount ( daeString  name = NULL,
daeString  type = NULL,
daeString  file = NULL 
) [pure virtual]

Implemented in daeSTLDatabase.

virtual daeUInt daeDatabase::getTypeCount (  )  [pure virtual]

Implemented in daeSTLDatabase.

virtual daeString daeDatabase::getTypeName ( daeUInt  index  )  [pure virtual]

Implemented in daeSTLDatabase.

daeElement* daeDatabase::idLookup ( const std::string &  id,
daeDocument doc 
)

Find an element with the given ID in a specific document.

Parameters:
id The ID to match on.
doc The document to search in.
Returns:
The matching element if one is found, NULL otherwise.
virtual std::vector<daeElement*> daeDatabase::idLookup ( const std::string &  id  )  [pure virtual]

Lookup elements by ID, searching through all documents.

Parameters:
id The ID to match on.
Returns:
The array of matching elements.

Implemented in daeSTLDatabase.

daeInt daeDatabase::insertCollection ( daeDocument c  )  [inline]

Definition at line 297 of file daeDatabase.h.

daeInt daeDatabase::insertCollection ( daeString  name,
daeDocument **  document = NULL 
) [inline]

Definition at line 288 of file daeDatabase.h.

daeInt daeDatabase::insertCollection ( daeString  name,
daeElement dom,
daeDocument **  document = NULL 
) [inline]

Definition at line 285 of file daeDatabase.h.

virtual daeInt daeDatabase::insertDocument ( daeDocument c  )  [pure virtual]

Inserts an already existing document into the database.

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

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::insertDocument ( daeString  name,
daeDocument **  document = NULL 
) [pure virtual]

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

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

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::insertDocument ( daeString  name,
daeElement dom,
daeDocument **  document = NULL,
bool  zaeRootDocument = false,
const std::string &  extractedFileURI = "" 
) [pure virtual]

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

Parameters:
name Name of the new document, must be a valid URI.
dom Existing domCOLLADA root element of the document
document Pointer to a daeDocument pointer that receives the document created
zaeRootDocument Indicates if the new document is the root document of a ZAE archive.
extractedFileURI URI to extracted dae file.
Returns:
Returns DAE_OK if the document 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 createDocument.

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::insertElement ( daeDocument document,
daeElement element 
) [pure virtual]

Inserts a daeElement into the runtime database.

Parameters:
document Document 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.

Implemented in daeSTLDatabase.

daeBool daeDatabase::isCollectionLoaded ( daeString  name  )  [inline]

Definition at line 315 of file daeDatabase.h.

virtual daeBool daeDatabase::isDocumentLoaded ( daeString  name  )  [pure virtual]

Indicates if a document is loaded or not.

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

Implemented in daeSTLDatabase.

daeInt daeDatabase::removeCollection ( daeDocument document  )  [inline]

Definition at line 300 of file daeDatabase.h.

virtual daeInt daeDatabase::removeDocument ( daeDocument document  )  [pure virtual]

Removes a document from the database.

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

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::removeElement ( daeDocument document,
daeElement element 
) [pure virtual]

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

Parameters:
document Document 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.

Implemented in daeSTLDatabase.

virtual daeInt daeDatabase::setMeta ( daeMetaElement _topMeta  )  [pure 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.

Implemented in daeSTLDatabase.

virtual void daeDatabase::sidLookup ( const std::string &  sid,
std::vector< daeElement * > &  matchingElements,
daeDocument doc = NULL 
) [pure virtual]

Same as the previous method, but the results are returned via a parameter instead of a return value, for extra efficiency.

Parameters:
sid The sid to match on.
matchingElements The array of matching elements.
doc The document to search in, or NULL to search in all documents. Note - This function currently isn't implemented in the default database.

Implemented in daeSTLDatabase.

std::vector<daeElement*> daeDatabase::sidLookup ( const std::string &  sid,
daeDocument doc = NULL 
)

Lookup elements by sid.

Parameters:
sid The sid to match on.
doc The document to search in, or NULL to search in all documents.
Returns:
The array of matching elements. Note - This function currently isn't implemented in the default database.
template<typename T >
void daeDatabase::typeLookup ( std::vector< T * > &  matchingElements,
daeDocument doc = NULL 
) [inline]

Same as the previous method, but returns the array of matching elements via a reference parameter for additional efficiency.

Parameters:
matchingElements The array of matching elements.
doc The document to search in, or NULL to search in all documents.

Definition at line 227 of file daeDatabase.h.

template<typename T >
std::vector<T*> daeDatabase::typeLookup ( daeDocument doc = NULL  )  [inline]

Lookup elements by type ID.

Parameters:
doc The document to search in, or NULL to search in all documents.
Returns:
The array of matching elements.

Definition at line 214 of file daeDatabase.h.

virtual void daeDatabase::typeLookup ( daeInt  typeID,
std::vector< daeElement * > &  matchingElements,
daeDocument doc = NULL 
) [pure virtual]

Same as the previous method, but returns the array of matching elements via a reference parameter for additional efficiency.

Parameters:
typeID The type to match on, e.g. domNode::ID().
matchingElements The array of matching elements.
doc The document to search in, or NULL to search in all documents.

Implemented in daeSTLDatabase.

std::vector<daeElement*> daeDatabase::typeLookup ( daeInt  typeID,
daeDocument doc = NULL 
)

Lookup elements by type ID.

Parameters:
typeID The type to match on, e.g. domNode::ID().
doc The document to search in, or NULL to search in all documents.
Returns:
The array of matching elements.

Member Data Documentation

DAE& daeDatabase::dae [protected]

Definition at line 320 of file daeDatabase.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


colladadom
Author(s): Du Hung Hou, Khronos.org, Marcus Barnes, Greg Corson, Herbert Law, Sebastian Schwarz, Steven Thomas, John Hsu (ros package), Tim Field (ros package)
autogenerated on Fri Jan 11 09:29:11 2013