COLLADA 1.4 DOM: daeIDRef Class Reference

COLLADA

daeIDRef Class Reference

#include <daeIDRef.h>

Collaboration diagram for daeIDRef:

Collaboration graph
[legend]
List of all members.

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.

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
}
 An enum describing the status of the ID resolution process. More...

Public Member Functions

daeElementRef getElement ()
 Gets the element that this URI resolves to in memory.
void setElement (daeElementRef newref)
 Sets the element that this URI resolves to in memory.
ResolveState getState ()
 Gets the resolve state of the URI.
void setState (ResolveState newState)
 Sets the resolve state of the URI.
daeElementgetContainer ()
 Gets a pointer to the daeElement that contains this URI.
void setContainer (daeElement *element)
 Sets the pointer to the daeElement that contains this URI.
 daeIDRef ()
 Simple Constructor.
 ~daeIDRef ()
 Destructor.
 daeIDRef (daeString id)
 Constructs an id reference via a string, using setID(); loads the status.
 daeIDRef (daeIDRef &constructFromIDRef)
 Constructs a new id reference by copying an existing one.
void setID (daeString ID)
 Copies ID into the id data member.
daeString getID () const
 Gets the ID string.
void resolveElement ()
 Uses the daeIDRefResolver static API to try to resolve this ID into a daeElement reference.
void resolveID ()
 Configures the id string of this daeIDRef based on the element set its element data member.
void validate ()
 Sets the state of this daeIDRef to id_pending, as it is awaiting a call to resolveElement().
void copyFrom (daeIDRef &from)
 Copies from into this.
void print ()
 Outputs all components of this daeIDRef to stderr.
void reset ()
 Resets this daeIDRef; frees all string references and returns state to empty.
void initialize ()
 Initializes the daeIDREf, setting id, element, and container to NULL.

Member Enumeration Documentation

enum daeIDRef::ResolveState
 

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.


Constructor & Destructor Documentation

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 daeIDRef constructFromIDRef  ) 
 

Constructs a new id reference by copying an existing one.

Parameters:
constructFromIDRef daeIDRef to copy into this one.


Member Function Documentation

void daeIDRef::copyFrom daeIDRef from  ) 
 

Copies from into this.

The function does a simple copy, and not "base validation".

Parameters:
from daeIDRef to copy from.

daeElement* daeIDRef::getContainer  )  [inline]
 

Gets a pointer to the daeElement that contains this URI.

Returns:
Returns the pointer to the containing daeElmement.

daeElementRef daeIDRef::getElement  )  [inline]
 

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  )  [inline]
 

Gets the resolve state of the URI.

Returns:
Returns the current state.
Note:
This will be removed when daeURI starts managing its state internally.

void daeIDRef::resolveElement  ) 
 

Uses the daeIDRefResolver static API to try to resolve this ID into a daeElement reference.

This function can effectively force a load of a file, perform a database query, et cetera based on the daeIDRefResolver plugins implemented.

void daeIDRef::resolveID  ) 
 

Configures the id string of this daeIDRef based on the element set its element data member.

Uses daeElement::getID() to get the element's ID information to configure the id string.

void daeIDRef::setContainer daeElement element  )  [inline]
 

Sets the pointer to the daeElement that contains this URI.

Parameters:
element Pointer to the containing daeElmement.

void daeIDRef::setElement daeElementRef  newref  )  [inline]
 

Sets the element that this URI resolves to in memory.

Parameters:
newref A ref to the element.

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::setState ResolveState  newState  )  [inline]
 

Sets the resolve state of the URI.

Parameters:
newState The new state.
Note:
This will be removed when daeURI starts managing its state internally.


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

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