openvrml::script_node::script_node::eventout Class Reference

An event_emitter along with the emitted value. More...

#include <openvrml/script.h>

List of all members.


Public Member Functions

 eventout (field_value::type_id type, script_node &node) throw ( std::bad_alloc )
 Construct.
const field_valuevalue () const throw ()
 The value that will be sent from the eventOut.
void value (const field_value &val) throw ( std::bad_alloc , std::bad_cast )
 Set the value that will be sent from the eventOut.
bool modified () const throw ()
 Whether the value has been modified.
openvrml::event_emitteremitter () throw ()
 The event_emitter associated with the eventout.
void emit_event (double timestamp) throw ( std::bad_alloc )
 Cause the contained event_emitter to emit an event.

Private Attributes

script_nodenode_
 The containing script_node.
boost::scoped_ptr< field_valuevalue_
 The value.
bool modified_
 Flag to indicate whether value_ has been modified.
boost::scoped_ptr
< openvrml::event_emitter
emitter_
 Event emitter.

Detailed Description

An event_emitter along with the emitted value.

Constructor & Destructor Documentation

openvrml::script_node::script_node::eventout::eventout ( field_value::type_id  type,
script_node node 
) throw ( std::bad_alloc )

Construct.

Parameters:
[in] type field value type identifier.
[in] node script_node.
Exceptions:
std::bad_alloc if memory allocation fails.


Member Function Documentation

const openvrml::field_value & openvrml::script_node::script_node::eventout::value (  )  const throw ()

The value that will be sent from the eventOut.

Returns:
the value that will be sent from the eventOut.

void openvrml::script_node::script_node::eventout::value ( const field_value val  )  throw ( std::bad_alloc , std::bad_cast )

Set the value that will be sent from the eventOut.

After calling this function, modified will return true until emit_event is called.

Parameters:
[in] val field value.
Exceptions:
std::bad_alloc if memory allocation fails.
std::bad_cast if val is not the correct type.

bool openvrml::script_node::script_node::eventout::modified (  )  const throw ()

Whether the value has been modified.

Returns:
true if the value has been changed since emit_event was last called; false otherwise.

openvrml::event_emitter & openvrml::script_node::script_node::eventout::emitter (  )  throw ()

The event_emitter associated with the eventout.

Returns:
the event_emitter associated with the eventout.

void openvrml::script_node::script_node::eventout::emit_event ( double  timestamp  )  throw ( std::bad_alloc )

Cause the contained event_emitter to emit an event.

Events should be emitted from Script nodes by calling this function instead of passing the event_emitter directly to node::emit_event.

Parameters:
[in] timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.


Member Data Documentation

openvrml::script_node & openvrml::script_node::script_node::eventout::node_ [private]

The containing script_node.

boost::scoped_ptr< openvrml::field_value > openvrml::script_node::script_node::eventout::value_ [private]

The value.

bool openvrml::script_node::script_node::eventout::modified_ [private]

Flag to indicate whether value_ has been modified.

boost::scoped_ptr< openvrml::event_emitter > openvrml::script_node::script_node::eventout::emitter_ [private]

Event emitter.