Home | Download | Screen shots | Discussion | Documentation |
---|
Class template to simplify implementation of exposedFields
.
More...
#include <openvrml/exposedfield.h>
Public Member Functions | |
virtual | ~exposedfield () throw () |
Destroy. | |
![]() | |
virtual | ~node_field_value_listener () throw () |
Destroy. | |
![]() | |
virtual | ~node_event_listener () throw () |
Destroy. | |
openvrml::node & | node () const throw () |
The node to which the node_event_listener belongs. | |
const std::string | eventin_id () const throw () |
The associated eventIn identifier. | |
![]() | |
virtual | ~event_listener ()=0 throw () |
Destroy. | |
![]() | |
virtual | ~field_value_listener ()=0 throw () |
Destroy. | |
void | process_event (const FieldValue &value, double timestamp) throw ( std::bad_alloc ) |
Process an event. | |
virtual field_value::type_id | type () const throw () |
FieldValue::field_value_type_id . | |
![]() | |
field_value_emitter (const FieldValue &value) throw () | |
Construct. | |
virtual | ~field_value_emitter ()=0 throw () |
Destroy. | |
bool | add (field_value_listener< FieldValue > &listener) throw ( std::bad_alloc ) |
Add an event listener. | |
bool | remove (field_value_listener< FieldValue > &listener) throw () |
Remove an event listener. | |
const std::set < field_value_listener < FieldValue > * > | listeners () const throw ( std::bad_alloc ) |
The event listeners currently listening to the emitter. | |
![]() | |
virtual | ~event_emitter ()=0 throw () |
Destroy. | |
const field_value & | value () const throw () |
A reference to the field_value for the event_emitter . | |
const std::string | eventout_id () const throw () |
The associated eventOut identifier. | |
double | last_time () const throw () |
The timestamp of the last event emitted. |
Protected Member Functions | |
exposedfield (openvrml::node &node, const typename FieldValue::value_type &value=typename FieldValue::value_type()) | |
Construct. | |
exposedfield (const exposedfield< FieldValue > &obj) | |
Construct a copy. | |
![]() | |
node_field_value_listener (openvrml::node &n) throw () | |
Construct. | |
![]() | |
node_event_listener (openvrml::node &n) throw () | |
Construct. | |
![]() | |
event_listener () throw () | |
Construct. | |
![]() | |
field_value_listener () throw () | |
Construct. |
Private Member Functions | |
virtual void | do_process_event (const FieldValue &value, double timestamp) throw ( std::bad_alloc ) |
Process an event. | |
virtual void | event_side_effect (const FieldValue &value, double timestamp) throw ( std::bad_alloc ) |
Called by exposedfield<FieldValue>::do_process_event . |
Additional Inherited Members | |
![]() | |
typedef std::set < event_listener * > | listener_set |
Set of event_listeners . |
Class template to simplify implementation of exposedFields
.
exposedfield
conveniently implements an event_listener
and an event_emitter
. Trivial exposedFields
can be implemented simply by instantiating this template with a FieldValue . For the purposes of OpenVRML, a trivial exposedField
is one that has no side-effects. That is, it simply receives an event, updates an internal value, and fires an eventOut
. Nontrivial exposedFields
(i.e., those with side-effects) can generally be implemented by inheriting an instance of this class template and overriding exposedfield<FieldValue>::event_side_effect
.
FieldValue | a Field Value. |
|
inlinevirtual |
Destroy.
FieldValue | a Field Value. |
Reimplemented in openvrml::node_impl_util::abstract_node< Derived >::exposedfield< FieldValue >, and openvrml::node_impl_util::abstract_node< Derived >::exposedfield< sfnode >.
|
inlineprotected |
Construct.
FieldValue | a Field Value. |
[in] | node | a reference to the node to which the exposedField belongs. |
[in] | value | default value. |
Reimplemented in openvrml::node_impl_util::abstract_node< Derived >::exposedfield< FieldValue >, and openvrml::node_impl_util::abstract_node< Derived >::exposedfield< sfnode >.
|
inlineprotected |
Construct a copy.
FieldValue | a Field Value. |
[in] | obj | the instance to copy. |
Reimplemented in openvrml::node_impl_util::abstract_node< Derived >::exposedfield< sfnode >.
|
inlineprivatevirtual |
Process an event.
This function performs the following steps:
exposedField
value.exposedfield<FieldValue>::event_side_effect
.exposedfield<FieldValue>::event_side_effect
instead.FieldValue | a Field Value. |
[in] | value | new value. |
[in] | timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |
|
inlineprivatevirtual |
Called by exposedfield<FieldValue>::do_process_event
.
Subclasses should override this method to implement event handling functionality specific to a particular exposedField
. The default implementation of this function does nothing.
FieldValue | a Field Value. |
[in] | value | new value. |
[in] | timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |