Home | Download | Screen shots | Discussion | Documentation |
---|
Abstract class implemented by scripting language bindings. More...
#include <openvrml/script.h>
Public Member Functions | |
virtual | ~script ()=0 |
Destroy. | |
void | initialize (double timestamp) |
Initialize the Script node. | |
void | process_event (const std::string &id, const field_value &value, double timestamp) |
Process an event. | |
void | events_processed (double timestamp) |
Execute script code after processing events. | |
void | shutdown (double timestamp) |
Shut down the Script node. |
Protected Member Functions | |
script (script_node &node) | |
Construct. | |
bool | direct_output () const throw () |
Whether direct output is enabled for the Script node. | |
bool | must_evaluate () const throw () |
Whether the browser may delay sending input events to the script until its outputs are needed by the browser. | |
void | field (const std::string &id, const field_value &value) throw ( unsupported_interface , std::bad_cast , std::bad_alloc ) |
Set the value of a field. | |
void | direct_output (event_listener &listener, const boost::shared_ptr< field_value > &value) throw ( field_value_type_mismatch , std::bad_alloc ) |
Add an event for direct output processing at the end of script execution. |
Protected Attributes | |
script_node & | node |
A reference to the script_node that uses this script object. |
Private Member Functions | |
virtual void | do_initialize (double timestamp)=0 |
Initialize the Script node. | |
virtual void | do_process_event (const std::string &id, const field_value &value, double timestamp)=0 |
Process an event. | |
virtual void | do_events_processed (double timestamp)=0 |
Execute script code after processing events. | |
virtual void | do_shutdown (double timestamp)=0 |
Shut down the Script node. |
Abstract class implemented by scripting language bindings.
The runtime instantiates subclasses of script for each VRML97 Script node; and calls its methods appropriately to execute script code.
|
pure virtual |
Destroy.
|
explicitprotected |
Construct.
[in] | node | a reference to the script_node that uses this script object. |
void openvrml::script::initialize | ( | double | timestamp | ) |
void openvrml::script::process_event | ( | const std::string & | id, |
const field_value & | value, | ||
double | timestamp | ||
) |
Process an event.
Delegates to do_process_event
.
[in] | id | eventIn identifier. |
[in] | value | event value. |
[in] | timestamp | the current time. |
void openvrml::script::events_processed | ( | double | timestamp | ) |
Execute script code after processing events.
Delegates to do_events_processed
.
[in] | timestamp | the current time. |
void openvrml::script::shutdown | ( | double | timestamp | ) |
|
protected |
Whether direct output is enabled for the Script node.
true
if direct output is enabled for the Script node; false
otherwise.
|
protected |
Whether the browser
may delay sending input events to the script
until its outputs are needed by the browser.
true
if the browser
may delay sending input events to the script
until its outputs are needed by the browser
; false
otherwise.
|
protected |
Set the value of a field.
[in] | id | field identifier. |
[in] | value | new value. |
unsupported_interface | if the Script node has no field id . |
std::bad_cast | if value is the wrong type. |
std::bad_alloc | if memory allocation fails. |
|
protected |
Add an event for direct output processing at the end of script execution.
[in] | listener | the event_listener to which the event should be sent. |
[in] | value | the value to send. |
field_value_type_mismatch | if listener is not the correct type to process events of value's type. |
std::bad_alloc | if memory allocation fails. |
|
privatepure virtual |
Initialize the Script node.
[in] | timestamp | the current time. |
|
privatepure virtual |
Process an event.
[in] | id | eventIn identifier. |
[in] | value | event value. |
[in] | timestamp | the current time. |
|
privatepure virtual |
Execute script code after processing events.
[in] | timestamp | the current time. |
|
privatepure virtual |
Shut down the Script node.
[in] | timestamp | the current time. |
|
protected |
A reference to the script_node
that uses this script
object.