Home | Download | Screen shots | Discussion | Documentation |
---|
A template for concrete node_types
.
More...
#include <openvrml/node_impl_util.h>
Classes | |
class | event_emitter_ptr |
Concrete pointer-to-member wrapper. More... | |
class | event_listener_ptr |
Concrete pointer-to-member wrapper. More... | |
class | field_ptr |
Concrete pointer-to-member wrapper. More... |
Public Types | |
typedef boost::shared_ptr < ptr_to_polymorphic_mem < openvrml::field_value, Node > > | field_ptr_ptr |
A shared_ptr to a pointer-to-member wrapper template. | |
typedef boost::shared_ptr < ptr_to_polymorphic_mem < openvrml::event_listener, Node > > | event_listener_ptr_ptr |
A shared_ptr to a pointer-to-member wrapper template. | |
typedef boost::shared_ptr < ptr_to_polymorphic_mem < openvrml::event_emitter, Node > > | event_emitter_ptr_ptr |
A shared_ptr to a pointer-to-member wrapper template. |
Public Member Functions | |
node_type_impl (const openvrml::node_metatype &metatype, const std::string &id) | |
Construct. | |
virtual | ~node_type_impl () throw () |
Destroy. | |
template<typename EventListenerMember , typename DeducedNode > | |
void | add_eventin (openvrml::field_value::type_id type, const std::string &id, EventListenerMember DeducedNode::*event_listener) throw ( std::invalid_argument , std::bad_alloc ) |
Add an eventIn . | |
template<typename EventEmitterMember , typename DeducedNode > | |
void | add_eventout (openvrml::field_value::type_id type, const std::string &id, EventEmitterMember DeducedNode::*event_emitter) throw ( std::invalid_argument , std::bad_alloc ) |
Add an eventOut . | |
template<typename EventListenerMember , typename FieldMember , typename EventEmitterMember , typename DeducedNode > | |
void | add_exposedfield (openvrml::field_value::type_id type, const std::string &id, EventListenerMember DeducedNode::*event_listener, FieldMember DeducedNode::*field, EventEmitterMember DeducedNode::*event_emitter) throw ( std::invalid_argument , std::bad_alloc ) |
Add an exposedField . | |
template<typename ExposedfieldMember , typename DeducedNode > | |
void | add_exposedfield (openvrml::field_value::type_id type, const std::string &id, ExposedfieldMember DeducedNode::*exposedfield) throw ( std::invalid_argument , std::bad_alloc ) |
template<typename FieldMember , typename DeducedNode > | |
void | add_field (openvrml::field_value::type_id type, const std::string &id, FieldMember DeducedNode::*exposedfield) throw ( std::invalid_argument , std::bad_alloc ) |
Add a field . | |
virtual const openvrml::field_value & | field_value (const openvrml::node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::field_value corresponding to the field identifier id . | |
virtual openvrml::event_listener & | event_listener (openvrml::node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::event_listener corresponding to the eventIn identifier id . | |
virtual openvrml::event_emitter & | event_emitter (openvrml::node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::event_emitter corresponding to the eventOut identifier id . | |
![]() | |
virtual | ~abstract_node_type ()=0 throw () |
Destroy. | |
![]() | |
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 . |
Static Public Member Functions | |
template<typename FieldMember , typename DeducedNode > | |
static const field_ptr_ptr | make_field_ptr_ptr (FieldMember DeducedNode::*ptr_to_mem) |
Make a field_ptr_ptr to a field member of a node. | |
template<typename EventListenerMember , typename DeducedNode > | |
static const event_listener_ptr_ptr | make_event_listener_ptr_ptr (EventListenerMember DeducedNode::*ptr_to_mem) |
Make an event_listener_ptr_ptr to a field member of a node. | |
template<typename EventEmitterMember , typename DeducedNode > | |
static const event_emitter_ptr_ptr | make_event_emitter_ptr_ptr (EventEmitterMember DeducedNode::*ptr_to_mem) |
Make an event_emitter_ptr_ptr to a field member of a node. |
Private Member Functions | |
virtual const openvrml::node_interface_set & | do_interfaces () const throw () |
The set of node_interfaces supported by the node_type . | |
virtual const boost::intrusive_ptr < openvrml::node > | do_create_node (const boost::shared_ptr< openvrml::scope > &scope, const openvrml::initial_value_map &initial_values) const throw ( openvrml::unsupported_interface , std::bad_cast , std::bad_alloc ) |
Create a node instance. | |
const openvrml::field_value & | do_field_value (const Node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::field_value corresponding to the field identifier id . | |
openvrml::event_listener & | do_event_listener (Node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::event_listener corresponding to the eventIn identifier id . | |
openvrml::event_emitter & | do_event_emitter (Node &node, const std::string &id) const throw ( openvrml::unsupported_interface ) |
node's openvrml::event_emitter corresponding to the eventOut identifier id . |
Additional Inherited Members | |
![]() | |
abstract_node_type (const openvrml::node_metatype &metatype, const std::string &id) | |
Construct. | |
![]() | |
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. |
A template for concrete node_types
.
Node | a concrete node type. |
boost::shared_ptr< openvrml::node_impl_util::ptr_to_polymorphic_mem< openvrml::field_value, Node > > openvrml::node_impl_util::node_type_impl< Node >::field_ptr_ptr |
A shared_ptr
to a pointer-to-member wrapper template.
boost::shared_ptr< openvrml::node_impl_util::ptr_to_polymorphic_mem< openvrml::event_listener, Node > > openvrml::node_impl_util::node_type_impl< Node >::event_listener_ptr_ptr |
A shared_ptr
to a pointer-to-member wrapper template.
boost::shared_ptr< openvrml::node_impl_util::ptr_to_polymorphic_mem< openvrml::event_emitter, Node > > openvrml::node_impl_util::node_type_impl< Node >::event_emitter_ptr_ptr |
A shared_ptr
to a pointer-to-member wrapper template.
openvrml::node_impl_util::node_type_impl< Node >::node_type_impl | ( | const openvrml::node_metatype & | metatype, |
const std::string & | id | ||
) |
Construct.
[in] | metatype | the node_metatype . |
[in] | id | the node_type identifier. |
|
virtual |
Destroy.
|
static |
Make a field_ptr_ptr
to a field member of a node.
FieldMember | a field_value member of Node. |
DeducedNode | the deduced type of the node may differ from its actual concrete type in the contexts in which this function is used. We static_cast to the actual type. |
[in] | ptr_to_mem | a pointer to an openvrml::field_value member. |
field_ptr_ptr
to ptr_to_mem
.
|
static |
Make an event_listener_ptr_ptr
to a field member of a node.
EventListenerMember | an event_listener member of Node. |
DeducedNode | the deduced type of the node may differ from its actual concrete type in the contexts in which this function is used. We static_cast to the actual type. |
[in] | ptr_to_mem | a pointer to an openvrml::event_listener member. |
event_listener_ptr_ptr
to ptr_to_mem
.
|
static |
Make an event_emitter_ptr_ptr
to a field member of a node.
EventEmitterMember | an event_emitter member of Node. |
DeducedNode | the deduced type of the node may differ from its actual concrete type in the contexts in which this function is used. We static_cast to the actual type. |
[in] | ptr_to_mem | a pointer to an openvrml::event_emitter member. |
event_emitter_ptr_ptr
to ptr_to_mem
. void openvrml::node_impl_util::node_type_impl< Node >::add_eventin | ( | openvrml::field_value::type_id | type, |
const std::string & | id, | ||
EventListenerMember DeducedNode::* | event_listener | ||
) | throw ( std::invalid_argument , std::bad_alloc ) |
Add an eventIn
.
EventListenerMember | the type of the event_listener member. |
DeducedNode | the deduced type of the node of which the event listener is a member. |
[in] | type | the field value type. |
[in] | id | the eventIn identifier. |
[in] | event_listener | the openvrml::event_listener associated with the eventIn . |
std::invalid_argument | if an interface with a conflicting id has already been added to the node_type . |
std::bad_alloc | if memory allocation fails. |
void openvrml::node_impl_util::node_type_impl< Node >::add_eventout | ( | openvrml::field_value::type_id | type, |
const std::string & | id, | ||
EventEmitterMember DeducedNode::* | event_emitter | ||
) | throw ( std::invalid_argument , std::bad_alloc ) |
Add an eventOut
.
EventEmitterMember | the type of the event_emitter member. |
DeducedNode | the deduced type of the node of which the event emitter is a member. |
[in] | type | the field value type. |
[in] | id | the eventOut identifier. |
[in] | event_emitter | the openvrml::event_emitter associated with the eventOut . |
std::invalid_argument | if an interface with a conflicting id has already been added to the node_type . |
std::bad_alloc | if memory allocation fails. |
void openvrml::node_impl_util::node_type_impl< Node >::add_exposedfield | ( | openvrml::field_value::type_id | type, |
const std::string & | id, | ||
EventListenerMember DeducedNode::* | event_listener, | ||
FieldMember DeducedNode::* | field, | ||
EventEmitterMember DeducedNode::* | event_emitter | ||
) | throw ( std::invalid_argument , std::bad_alloc ) |
Add an exposedField
.
EventEmitterMember | the type of the event_emitter member. |
FieldMember | the type of the field member. |
EventListenerMember | the type of the event_listener member. |
DeducedNode | the deduced type of the node of which the event emitter is a member. |
[in] | type | the field value type. |
[in] | id | the exposedField identifier. |
[in] | event_listener | the openvrml::event_listener associated with the exposedField . |
[in] | field | the openvrml::field_value associated with the exposedField . |
[in] | event_emitter | the openvrml::event_emitter associated with the exposedField . |
std::invalid_argument | if an interface with a conflicting id has already been added to the node_type . |
std::bad_alloc | if memory allocation fails. |
void openvrml::node_impl_util::node_type_impl< Node >::add_exposedfield | ( | openvrml::field_value::type_id | type, |
const std::string & | id, | ||
ExposedfieldMember DeducedNode::* | exposedfield | ||
) | throw ( std::invalid_argument , std::bad_alloc ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
ExposedfieldMember | the type of the exposedfield member. |
DeducedNode | the deduced type of the node of which the event emitter is a member. |
[in] | type | the field value type. |
[in] | id | the exposedField identifier. |
[in] | exposedfield | the member associated with the exposedField . |
std::invalid_argument | if an interface with a conflicting id has already been added to the node_type . |
std::bad_alloc | if memory allocation fails. |
void openvrml::node_impl_util::node_type_impl< Node >::add_field | ( | openvrml::field_value::type_id | type, |
const std::string & | id, | ||
FieldMember DeducedNode::* | field | ||
) | throw ( std::invalid_argument , std::bad_alloc ) |
Add a field
.
FieldMember | the type of the field member. |
DeducedNode | the deduced type of the node of which the event emitter is a member. |
[in] | type | the field value type. |
[in] | id | the field identifier. |
[in] | field | the openvrml::field_value associated with the field . |
std::invalid_argument | if an interface with a conflicting id has already been added to the node_type . |
std::bad_alloc | if memory allocation fails. |
|
virtual |
node's
openvrml::field_value
corresponding to the field identifier id
.
Delegates to node_type_impl<Node>::do_field_value
.
[in] | node | the openvrml::node for which to return the openvrml::field_value . |
[in] | id | field identifier. |
node's
openvrml::field_value
corresponding to the field
identifier id
.openvrml::unsupported_interface | if node has no field id . |
Implements openvrml::node_impl_util::abstract_node_type.
|
virtual |
node's
openvrml::event_listener
corresponding to the eventIn
identifier id
.
Delegates to node_type_impl<Node>::do_event_listener
.
[in] | node | the openvrml::node for which to return the openvrml::event_listener . |
[in] | id | eventIn identifier. |
node's
openvrml::event_listener
corresponding to the eventIn identifier id
.openvrml::unsupported_interface | if node has no eventIn id . |
Implements openvrml::node_impl_util::abstract_node_type.
|
virtual |
node's
openvrml::event_emitter
corresponding to the eventOut
identifier id
.
Delegates to node_type_impl<Node>::do_event_emitter
.
[in] | node | the openvrml::node for which to return the openvrml::event_emitter . |
[in] | id | eventOut identifier. |
node's
openvrml::event_emitter
corresponding to the eventOut
identifier id
.openvrml::unsupported_interface | if node has no eventOut id . |
Implements openvrml::node_impl_util::abstract_node_type.
|
privatevirtual |
|
privatevirtual |
Create a node instance.
[in] | scope | the scope the new node will belong to. |
[in] | initial_values | initial values for the new node 's fields. |
openvrml::unsupported_interface | if a field identifier in initial_values does not correspond to a field for the node_type . |
std::bad_cast | if a field value type in initial_values is incorrect for the corresponding field for the node_type . |
std::bad_alloc | if memory allocation fails. |
|
private |
node's
openvrml::field_value
corresponding to the field identifier id
.
[in] | node | the node for which to return the openvrml::field_value . |
[in] | id | field identifier. |
node's
openvrml::field_value
corresponding to the field
identifier id
.openvrml::unsupported_interface | if node has no field id . |
|
private |
node's
openvrml::event_listener
corresponding to the eventIn
identifier id
.
[in] | node | the openvrml::node for which to return the openvrml::event_listener . |
[in] | id | eventIn identifier. |
node's
openvrml::event_listener
corresponding to the eventIn
identifier id
.openvrml::unsupported_interface | if node has no eventIn id . |
|
private |
node's
openvrml::event_emitter
corresponding to the eventOut
identifier id
.
Delegates to node_type_impl<Node>::do_event_emitter
.
[in] | node | the openvrml::node for which to return the openvrml::event_emitter . |
[in] | id | eventOut identifier. |
node's
openvrml::event_emitter
corresponding to the eventOut
identifier id
.openvrml::unsupported_interface | if node has no eventOut id . |