Home | Download | Screen shots | Discussion | Documentation |
---|
Abstract base class of event emitters. More...
#include <openvrml/event.h>
Public Types | |
typedef std::set < event_listener * > | listener_set |
Set of event_listeners . More... | |
Public Member Functions | |
virtual | ~event_emitter ()=0 throw () |
Destroy. More... | |
const field_value & | value () const throw () |
A reference to the field_value for the event_emitter . More... | |
const std::string | eventout_id () const throw () |
The associated eventOut identifier. More... | |
double | last_time () const throw () |
The timestamp of the last event emitted. More... | |
template<typename FieldValue > | |
bool | add (field_value_listener< FieldValue > &listener) throw ( std::bad_alloc ) |
Add an event listener. More... | |
template<typename FieldValue > | |
bool | remove (field_value_listener< FieldValue > &listener) throw () |
Remove an event listener. More... | |
Protected Member Functions | |
event_emitter (const field_value &value) throw () | |
Construct. More... | |
template<typename FieldValue > | |
const std::set < field_value_listener < FieldValue > * > | listeners () const throw ( std::bad_alloc ) |
The event listeners currently listening to the emitter. More... | |
template<typename FieldValue > | |
void | emit_event (double timestamp) throw ( std::bad_alloc ) |
Emit an event. More... | |
Private Member Functions | |
virtual const std::string | do_eventout_id () const =0 throw () |
The associated eventOut identifier. More... | |
Abstract base class of event emitters.
|
pure virtual |
Destroy.
Implemented in openvrml::node_impl_util::abstract_node< Derived >::event_emitter< FieldValue >.
|
explicitprotected |
Construct.
[in] | value | field_value associated with this emitter. |
const openvrml::field_value & openvrml::event_emitter::value | ( | ) | const | |
throw | ( | |||
) |
A reference to the field_value
for the event_emitter
.
field_value
for the event_emitter
. const std::string openvrml::event_emitter::eventout_id | ( | ) | const | |
throw | ( | |||
) |
The associated eventOut
identifier.
This function delegates to event_emitter::do_eventout_id
.
eventOut
identifier. double openvrml::event_emitter::last_time | ( | ) | const | |
throw | ( | |||
) |
The timestamp of the last event emitted.
bool openvrml::event_emitter::add | ( | field_value_listener< FieldValue > & | listener) | ||
throw | ( | std::bad_alloc | |||
) |
Add an event listener.
FieldValue | a Field Value. |
[in] | listener | an event listener. |
std::bad_alloc | if memory allocation fails. |
bool openvrml::event_emitter::remove | ( | field_value_listener< FieldValue > & | listener) | ||
throw | ( | ||||
) |
Remove an event listener.
FieldValue | a Field Value. |
[in] | listener | an event listener. |
|
protected |
The event listeners currently listening to the emitter.
FieldValue | a Field Value. |
|
protected |
Emit an event.
FieldValue | a Field Value. |
[in] | timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |
[in] | timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |
This function is called by node::emit_event
.
|
privatepure virtual |
The associated eventOut
identifier.
Concrete subclasses must implement this function.
Implemented in openvrml::node_impl_util::event_emitter_base< Node >, and openvrml::node_impl_util::event_emitter_base< Derived >.