daeIDRef Class Reference

#include <daeIDRef.h>

List of all members.

Public Types

enum  ResolveState {
  id_empty, id_loaded, id_pending, id_success,
  id_failed_id_not_found, id_failed_invalid_id, id_failed_invalid_reference, id_failed_externalization,
  id_failed_no_document
}

Public Member Functions

void copyFrom (const daeIDRef &from)
 daeIDRef (daeElement &container)
 daeIDRef (const daeIDRef &constructFromIDRef)
 daeIDRef (daeString id)
 daeIDRef ()
daeIDRefget (daeUInt idx)
daeElementgetContainer () const
size_t getCount () const
daeElementgetElement () const
daeString getID () const
ResolveState getState () const
void initialize ()
daeIDRefoperator= (const daeIDRef &other)
bool operator== (const daeIDRef &other) const
daeIDRefoperator[] (size_t index)
void print ()
void reset ()
void resolveElement (daeString typeNameHint=NULL)
void resolveID ()
void setContainer (daeElement *cont)
void setID (daeString ID)
void validate ()

Private Attributes

daeElementcontainer
std::string id

Detailed Description

The daeIDRef is a simple class designed to aid in the parsing and resolution of ID references inside of COLLADA elements. A daeIDRef is created for every IDREF data type in the COLLADA schema. It also has the capability to attempt to resolve this reference into a daeElement. If a daeIDRef is stored within a daeElement it fills in its container field to point to the containing element.

The main API is the daeIDRef::resolveElement() will use a daeIDRefResolver to search for the daeElement inside of a daeDatabase.

Definition at line 29 of file daeIDRef.h.


Member Enumeration Documentation

An enum describing the status of the ID resolution process.

Enumerator:
id_empty 

No ID specified

id_loaded 

ID specified but not resolved

id_pending 

ID resolution pending

id_success 

ID resolved correctly

id_failed_id_not_found 

Resolution failed because ID was not found

id_failed_invalid_id 

Resolution failed because ID was invalid

id_failed_invalid_reference 

Resoltion failed due to invalid reference

id_failed_externalization 

Resolution failed due to an external error

id_failed_no_document 

Resolution failed because we don't have a document in which to search for the element. This means you probably forgot to set a container element.

Definition at line 35 of file daeIDRef.h.


Constructor & Destructor Documentation

daeIDRef::daeIDRef (  ) 

Simple Constructor

daeIDRef::daeIDRef ( daeString  id  ) 

Constructs an id reference via a string, using setID(); loads the status.

Parameters:
id ID to construct a reference for, passed to setID() automatically.
daeIDRef::daeIDRef ( const daeIDRef constructFromIDRef  ) 

Constructs a new id reference by copying an existing one.

Parameters:
constructFromIDRef daeIDRef to copy into this one.
daeIDRef::daeIDRef ( daeElement container  ) 

Constructs an id reference with a container element

Parameters:
container The container element.

Member Function Documentation

void daeIDRef::copyFrom ( const daeIDRef from  ) 
daeIDRef& daeIDRef::get ( daeUInt  idx  ) 
daeElement* daeIDRef::getContainer (  )  const

Gets a pointer to the daeElement that contains this URI.

Returns:
Returns the pointer to the containing daeElmement.
size_t daeIDRef::getCount (  )  const
daeElement* daeIDRef::getElement (  )  const

Gets the element that this URI resolves to in memory.

Returns:
Returns a ref to the element.
daeString daeIDRef::getID (  )  const

Gets the ID string

Returns:
Returns the full ID string from id.
ResolveState daeIDRef::getState (  )  const
void daeIDRef::initialize (  ) 

Initializes the daeIDREf, setting id, element, and container to NULL.

daeIDRef& daeIDRef::operator= ( const daeIDRef other  ) 

Assignment operator.

Returns:
Returns a reference to this object.
bool daeIDRef::operator== ( const daeIDRef other  )  const

Comparison operator.

Returns:
Returns true if URI's are equal.
daeIDRef& daeIDRef::operator[] ( size_t  index  ) 
void daeIDRef::print (  ) 

Outputs all components of this daeIDRef to stderr.

void daeIDRef::reset (  ) 

Resets this daeIDRef; frees all string references and returns state to empty.

void daeIDRef::resolveElement ( daeString  typeNameHint = NULL  ) 
void daeIDRef::resolveID (  ) 
void daeIDRef::setContainer ( daeElement cont  ) 

Sets the pointer to the daeElement that contains this URI.

Parameters:
cont Pointer to the containing daeElmement.
void daeIDRef::setID ( daeString  ID  ) 

Copies ID into the id data member. After the call to setID(), the state is set to id_loaded

Parameters:
ID String to use to configure this daeIDRef.
void daeIDRef::validate (  ) 

Member Data Documentation

Element that owns this ID (if any)

Definition at line 62 of file daeIDRef.h.

std::string daeIDRef::id [private]

ID used to refer to another element

Definition at line 59 of file daeIDRef.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:13 2013