Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

proto_node::proto_eventin< FieldValue > Class Template Reference

Inheritance diagram for proto_node::proto_eventin< FieldValue >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename FieldValue>
class proto_node::proto_eventin< FieldValue >

PROTO eventIn handler class template.

For internal use only.


Public Types

typedef FieldValue field_value_type
 Field value type.
typedef field_value_listener<
FieldValue > 
event_listener_type
 Type of event listeners to which the instance delegates.

Public Member Functions

 proto_eventin (proto_node &node)
 Construct.
virtual ~proto_eventin () throw ()
 Destroy.
bool is (event_listener_type &listener) throw (std::bad_alloc)
 Add a listener to delegate to. Corresponds to an IS statement.

Protected Member Functions

virtual void do_process_event (const FieldValue &value, double timestamp) throw (std::bad_alloc)
 Process event.

Private Types

typedef std::set< field_value_listener<
FieldValue > * > 
listeners
 Set of event listeners.

Private Attributes

listeners listeners_
 Set of event listeners to which events are delegated for processing.

Member Typedef Documentation

template<typename FieldValue>
proto_node::proto_eventin< FieldValue >::listeners [private]
 

Set of event listeners.

template<typename FieldValue>
proto_node::proto_eventin< FieldValue >::field_value_type
 

Field value type.

template<typename FieldValue>
proto_node::proto_eventin< FieldValue >::event_listener_type
 

Type of event listeners to which the instance delegates.


Constructor & Destructor Documentation

template<typename FieldValue>
proto_node::proto_eventin< FieldValue >::proto_eventin proto_node &  node  )  [explicit]
 

Construct.

Parameters:
node proto_node.

template<typename FieldValue>
proto_node::proto_eventin< FieldValue >::~proto_eventin  )  throw () [virtual]
 

Destroy.


Member Function Documentation

template<typename FieldValue>
bool proto_node::proto_eventin< FieldValue >::is event_listener_type listener  )  throw (std::bad_alloc)
 

Add a listener to delegate to. Corresponds to an IS statement.

Parameters:
listener an event_listener to delegate to.
Returns:
true if listener is added successfully; false otherwise (if it already exists in the list of delegates).
Exceptions:
std::bad_alloc if memory allocation fails.

template<typename FieldValue>
void proto_node::proto_eventin< FieldValue >::do_process_event const FieldValue &  value,
double  timestamp
throw (std::bad_alloc) [protected, virtual]
 

Process event.

Parameters:
value field value.
timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

Implements openvrml::field_value_listener< FieldValue >.

Reimplemented in proto_node::proto_exposedfield< FieldValue >.


Member Data Documentation

template<typename FieldValue>
proto_node::proto_eventin::listeners proto_node::proto_eventin< FieldValue >::listeners_ [private]
 

Set of event listeners to which events are delegated for processing.