daeSTLDatabase Class Reference

#include <daeSTLDatabase.h>

Inheritance diagram for daeSTLDatabase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Private Types

typedef std::multimap
< std::string, daeElement * >
::iterator 
idMapIter
typedef std::pair< std::string,
daeElement * > 
idMapPair
typedef std::pair< idMapIter,
idMapIter
idMapRange
typedef std::multimap
< std::string, daeElement * >
::iterator 
sidMapIter
typedef std::pair< std::string,
daeElement * > 
sidMapPair
typedef std::pair< sidMapIter,
sidMapIter
sidMapRange
typedef std::multimap< daeInt,
daeElement * >::iterator 
typeMapIter
typedef std::pair< daeInt,
daeElement * > 
typeMapPair
typedef std::pair< typeMapIter,
typeMapIter
typeMapRange

Private Member Functions

daeInt insertChildren (daeDocument *c, daeElement *element)
daeInt removeChildren (daeDocument *c, daeElement *element)

Private Attributes

std::vector< daeDocument * > documents
std::map< std::string,
std::vector< daeElement * > > 
elements
std::multimap< std::string,
daeElement * > 
elementsIDMap
std::multimap< std::string,
daeElement * > 
sidMap
daeMetaElementtopMeta
std::multimap< daeInt,
daeElement * > 
typeMap

Detailed Description

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

Definition at line 27 of file daeSTLDatabase.h.


Member Typedef Documentation

typedef std::multimap<std::string, daeElement*>::iterator daeSTLDatabase::idMapIter [private]

Definition at line 98 of file daeSTLDatabase.h.

typedef std::pair<std::string, daeElement*> daeSTLDatabase::idMapPair [private]

Definition at line 99 of file daeSTLDatabase.h.

typedef std::pair<idMapIter, idMapIter> daeSTLDatabase::idMapRange [private]

Definition at line 100 of file daeSTLDatabase.h.

typedef std::multimap<std::string, daeElement*>::iterator daeSTLDatabase::sidMapIter [private]

Definition at line 103 of file daeSTLDatabase.h.

typedef std::pair<std::string, daeElement*> daeSTLDatabase::sidMapPair [private]

Definition at line 104 of file daeSTLDatabase.h.

typedef std::pair<sidMapIter, sidMapIter> daeSTLDatabase::sidMapRange [private]

Definition at line 105 of file daeSTLDatabase.h.

typedef std::multimap<daeInt, daeElement*>::iterator daeSTLDatabase::typeMapIter [private]

Definition at line 93 of file daeSTLDatabase.h.

typedef std::pair<daeInt, daeElement*> daeSTLDatabase::typeMapPair [private]

Definition at line 94 of file daeSTLDatabase.h.

typedef std::pair<typeMapIter, typeMapIter> daeSTLDatabase::typeMapRange [private]

Definition at line 95 of file daeSTLDatabase.h.


Constructor & Destructor Documentation

daeSTLDatabase::daeSTLDatabase ( DAE dae  ) 

Constructor

virtual daeSTLDatabase::~daeSTLDatabase (  )  [virtual]

Destructor


Member Function Documentation

virtual daeInt daeSTLDatabase::changeElementID ( daeElement element,
daeString  newID 
) [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::changeElementSID ( daeElement element,
daeString  newSID 
) [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::clear (  )  [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::createDocument ( daeString  name,
daeDocument **  document = NULL 
) [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::createDocument ( daeString  name,
daeElement dom,
daeDocument **  document = NULL,
bool  zaeRootDocument = false,
const std::string &  extractedFileURI = "" 
) [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.

Implements daeDatabase.

virtual daeDocument* daeSTLDatabase::getDocument ( daeString  name,
bool  skipUriNormalization = false 
) [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.

Implements daeDatabase.

virtual daeDocument* daeSTLDatabase::getDocument ( daeUInt  index  )  [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.

Implements daeDatabase.

virtual daeUInt daeSTLDatabase::getDocumentCount (  )  [virtual]

Gets the number of documents.

Returns:
Returns the number of documents.

Implements daeDatabase.

virtual daeString daeSTLDatabase::getDocumentName ( daeUInt  index  )  [virtual]

Gets a document name.

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

Implements daeDatabase.

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

Implements daeDatabase.

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

Implements daeDatabase.

virtual daeUInt daeSTLDatabase::getTypeCount (  )  [virtual]

Implements daeDatabase.

virtual daeString daeSTLDatabase::getTypeName ( daeUInt  index  )  [virtual]

Implements daeDatabase.

virtual std::vector<daeElement*> daeSTLDatabase::idLookup ( const std::string &  id  )  [virtual]

Lookup elements by ID, searching through all documents.

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

Implements daeDatabase.

daeInt daeSTLDatabase::insertChildren ( daeDocument c,
daeElement element 
) [private]
virtual daeInt daeSTLDatabase::insertDocument ( daeDocument c  )  [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::insertDocument ( daeString  name,
daeDocument **  document = NULL 
) [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::insertDocument ( daeString  name,
daeElement dom,
daeDocument **  document = NULL,
bool  zaeRootDocument = false,
const std::string &  extractedFileURI = "" 
) [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::insertElement ( daeDocument document,
daeElement element 
) [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.

Implements daeDatabase.

virtual daeBool daeSTLDatabase::isDocumentLoaded ( daeString  name  )  [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.

Implements daeDatabase.

daeInt daeSTLDatabase::removeChildren ( daeDocument c,
daeElement element 
) [private]
virtual daeInt daeSTLDatabase::removeDocument ( daeDocument document  )  [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.

Implements daeDatabase.

virtual daeInt daeSTLDatabase::removeElement ( daeDocument document,
daeElement element 
) [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.

Implements daeDatabase.

virtual 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.

virtual void daeSTLDatabase::sidLookup ( const std::string &  sid,
std::vector< daeElement * > &  matchingElements,
daeDocument doc = NULL 
) [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.

Implements daeDatabase.

virtual void daeSTLDatabase::typeLookup ( daeInt  typeID,
std::vector< daeElement * > &  matchingElements,
daeDocument doc = NULL 
) [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.

Implements daeDatabase.


Member Data Documentation

std::vector<daeDocument*> daeSTLDatabase::documents [private]

Definition at line 107 of file daeSTLDatabase.h.

std::map< std::string, std::vector< daeElement* > > daeSTLDatabase::elements [private]

Definition at line 90 of file daeSTLDatabase.h.

std::multimap< std::string, daeElement* > daeSTLDatabase::elementsIDMap [private]

Definition at line 97 of file daeSTLDatabase.h.

std::multimap< std::string, daeElement* > daeSTLDatabase::sidMap [private]

Definition at line 102 of file daeSTLDatabase.h.

Definition at line 108 of file daeSTLDatabase.h.

std::multimap<daeInt, daeElement*> daeSTLDatabase::typeMap [private]

Definition at line 92 of file daeSTLDatabase.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:16 2013