Home | Download | Screen shots | Discussion | Documentation |
---|
Type information object for nodes
.
More...
#include <openvrml/node.h>
Public Member Functions | |
virtual | ~node_type ()=0 throw () |
Destructor. | |
const node_metatype & | metatype () const throw () |
The class object associated with the node_type . | |
const std::string & | id () const throw () |
The name of the node_type . | |
const node_interface_set & | interfaces () const throw () |
Get the set of interfaces for the node_type . | |
const boost::intrusive_ptr< node > | create_node (const boost::shared_ptr< scope > &scope, const initial_value_map &initial_values=initial_value_map()) const throw ( unsupported_interface , std::bad_cast , std::bad_alloc ) |
Create a new node with this node_type . |
Protected Member Functions | |
node_type (const node_metatype &c, const std::string &id) throw ( std::bad_alloc ) | |
Constructor. |
Private Member Functions | |
virtual const node_interface_set & | do_interfaces () const =0 throw () |
Get the set of interfaces for the node_type . | |
virtual const boost::intrusive_ptr< node > | do_create_node (const boost::shared_ptr< scope > &scope, const initial_value_map &initial_values) const =0 throw ( unsupported_interface , std::bad_cast , std::bad_alloc ) |
Create a new node with this node_type . |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const node_type &lhs, const node_type &rhs) throw() |
Compare for equality. | |
bool | operator!= (const node_type &lhs, const node_type &rhs) throw() |
Compare for inequality. |
Type information object for nodes
.
|
pure virtual |
Destructor.
|
protected |
const openvrml::node_metatype & openvrml::node_type::metatype | ( | ) | const throw () |
const std::string & openvrml::node_type::id | ( | ) | const throw () |
const openvrml::node_interface_set & openvrml::node_type::interfaces | ( | ) | const throw () |
Get the set of interfaces for the node_type
.
This function delegates to do_interfaces
.
const boost::intrusive_ptr< openvrml::node > openvrml::node_type::create_node | ( | const boost::shared_ptr< scope > & | scope, |
const initial_value_map & | initial_values = initial_value_map() |
||
) | const throw ( unsupported_interface , std::bad_cast , std::bad_alloc ) |
Create a new node with this node_type
.
[in] | scope | the scope to which the new node should belong. |
[in] | initial_values | a map of initial values for the node 's fields and exposedFields . |
boost::intrusive_ptr
to a new node.unsupported_interface | if initial_values specifies a field name that is not supported by the node type. |
std::bad_cast | if a value in initial_values is the wrong type. |
std::bad_alloc | if memory allocation fails. |
|
privatepure virtual |
Get the set of interfaces for the node_type
.
Subclasses must implement this function.
|
privatepure virtual |
Create a new node with this node_type
.
Subclasses must implement this function.
[in] | scope | the scope to which the new node should belong. |
[in] | initial_values | a map of initial values for the node 's fields and exposedFields . |
boost::intrusive_ptr
to a new node.unsupported_interface | if initial_values specifies a field name that is not supported by the node type. |
std::bad_cast | if a value in initial_values is the wrong type. |
std::bad_alloc | if memory allocation fails. |
Compare for equality.
Two node_types
t
and u
are considered equal if all of the following are true:
t.id() == u.id()
t.interfaces() == u.interfaces()
t.metatype().id()
is in the set of identifiers associated with u
in the browser
's node_metatype
map.Note that the latter requirement makes this comparison a rather expensive operation.
[in] | lhs | |
[in] | rhs |
true
if lhs
and rhs
are equal; false
otherwise.