openvrml::script_node::eventout Class Reference

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

#include <openvrml/script.h>

Inherits noncopyable.

Public Member Functions

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

Detailed Description

An event_emitter along with the emitted value.

Constructor & Destructor Documentation

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

Construct.

Parameters
[in]typefield value type identifier.
[in]nodescript_node.
Exceptions
std::bad_allocif memory allocation fails.

Member Function Documentation

const openvrml::field_value & openvrml::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::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]valfield value.
Exceptions
std::bad_allocif memory allocation fails.
std::bad_castif val is not the correct type.
bool openvrml::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::eventout::emitter ( )
throw (
)

The event_emitter associated with the eventout.

Returns
the event_emitter associated with the eventout.
void openvrml::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]timestampthe current time.
Exceptions
std::bad_allocif memory allocation fails.