Home | Download | Screen shots | Discussion | Documentation
--- | --- | --- | --- | ---

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

# openvrml::script_node::eventout Class Reference

List of all members.

## Detailed Description

An event_emitter along with the emitted value.

## Public Member Functions

| eventout (field_value::type_id type, script_node &node) throw (std::bad_alloc)
| Construct.
const field_value & | value () 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_emitter & | emitter () 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_node & | node_
| The containing script_node.
boost::scoped_ptr< field_value > | value_
| The value.
bool | modified_
| Flag to indicate whether value_ has been modified.
boost::scoped_ptr< openvrml::event_emitter > | emitter_
| Event emitter.

## Constructor & Destructor Documentation

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

Construct.

Parameters:

  | type | field value type identifier.
  | node | script_node.

Exceptions:

  | std::bad_alloc | if memory allocation fails.

## Member Function Documentation

const 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:

  | 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::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.

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:

  | timestamp | the current time.

Exceptions:

  | std::bad_alloc | if memory allocation fails.

## Member Data Documentation

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

| The containing script_node.

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

| The value.

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

| Flag to indicate whether value_ has been modified.

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

| Event emitter.