H3D::H3DNodeDatabase Struct Reference

The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with that name. More...

#include <H3DNodeDatabase.h>

List of all members.

Public Types

typedef map< string, FieldDBElement * > FieldDBType
typedef map< string, H3DNodeDatabase * > H3DNodeDatabaseType
typedef H3DNodeDatabaseType::const_iterator NodeDatabaseConstIterator

Public Member Functions

 H3DNodeDatabase (const string &_name, H3DCreateNodeFunc _createf, const type_info &_ti, H3DNodeDatabase *_parent=0)
 Constructor.
 H3DNodeDatabase (const type_info &_ti, H3DNodeDatabase *_parent=0)
 Unnamed constructor, for nodes that cannot be instantiated but instead act as base classes for other nodes.
void addField (FieldDBElement *f)
 add a field to the node database entry
FieldgetField (Node *n, const string &f) const
 getField() will search the node's field database for a field matching the given name and returning a pointer to the field if found.
void initFields (Node *) const
 initialise field names, field owner pointers and access restrictors.
FieldDBConstIterator fieldDBBegin ()
 Gets an iterator to the beginning first field in the H3DNodeDatabase.
FieldDBConstIterator fieldDBEnd ()
 Returns an iterator pointing at the end of fields in the H3DNodeDatabase.
size_t fieldDBSize ()
 Returns the number of fields in the H3DNodeDatabase.

Static Public Member Functions

static H3DNodeDatabaselookupTypeId (const type_info &t)
 Search the node database for an entry with a matching type_info structure.
static H3DNodeDatabaselookupName (const string &name)
 Search the node database for an entry with a matching name.
static NodecreateNode (const string &name)
 Create a new instance of a Node type.
static NodeDatabaseConstIterator begin ()
 Iterator to the first element in the database.
static NodeDatabaseConstIterator end ()
 Returns an iterator pointing at the end of the H3DNodeDatabase created.

Static Public Attributes

static H3DNodeDatabaseType * database
 The database with all H3DNodeDatabase instances.

Classes

class  FieldDBConstIterator
 The FieldDBConstIterator is an iterator class used for iterating over the field instances in an H3DNodeDatabase. More...


Detailed Description

The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with that name.

Each node that is to be used via X3D file input must register itself in the database in order to be available to X3D. To register a static H3DNodeDatabase member variable must be defined in the node class with the (nodename, constructor) pair that is wanted.


Member Function Documentation

static NodeDatabaseConstIterator H3D::H3DNodeDatabase::begin  )  [inline, static]
 

Iterator to the first element in the database.

Can be used to iterate over all H3DNodeDatabase instances that have been created.

Node * H3DNodeDatabase::createNode const string &  name  )  [static]
 

Create a new instance of a Node type.

Parameters:
name The name of the node in the database.
Returns:
A new instance of the node if it exists in the database, otherwise NULL is returned.

FieldDBConstIterator H3D::H3DNodeDatabase::fieldDBBegin  )  [inline]
 

Gets an iterator to the beginning first field in the H3DNodeDatabase.

Can be used to iteratate through all the fields in the database.


Member Data Documentation

H3DNodeDatabase::H3DNodeDatabaseType * H3DNodeDatabase::database [static]
 

Initial value:

The database with all H3DNodeDatabase instances.


Generated on Thu Aug 24 12:39:20 2006 for H3D API by  doxygen 1.4.5