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

# openvrml::script_node::script_node_type Class Reference

Type objects for `script_nodes`. More...

`#include <openvrml/script.h>`

Inheritance diagram for openvrml::script_node::script_node_type:
[legend]

List of all members.

## Public Member Functions

| script_node_type (script_node_metatype &class_)
| Construct.
virtual | ~script_node_type () throw ()
| Destroy.
void | add_interface (const node_interface &interface_) throw ( std::bad_alloc , std::invalid_argument )
| Add an interface.

## Private Member Functions

virtual const node_interface_set & | do_interfaces () const throw ()
| Get the interfaces for the `node`.
virtual const boost::intrusive_ptr< node > | do_create_node (const boost::shared_ptr< openvrml::scope > &scope, const initial_value_map &initial_values) const throw ( unsupported_interface , std::bad_cast , std::bad_alloc )
| Clone the Script node that has this `node_type`.

## Private Attributes

node_interface_set | interfaces_
| Node interfaces.

## Detailed Description

Type objects for `script_nodes`.

For internal use only.

See also:
  script_node::type_

## Constructor & Destructor Documentation

openvrml::script_node::script_node_type::script_node_type | ( | script_node_metatype & | class_ | ) | `[explicit]`

Construct.

Parameters:

  `[in]` | class_ | the `node_metatype` for `script_nodes`.

openvrml::script_node::script_node_type::~script_node_type | ( |  | ) | throw ()`[virtual]`

Destroy.

## Member Function Documentation

void openvrml::script_node::script_node_type::add_interface | ( | const node_interface & | interface_ | ) | throw ( std::bad_alloc , std::invalid_argument )

Add an interface.

Parameters:

  `[in]` | interface_ |

Exceptions:

  | std::bad_alloc | if memory allocation fails.
  | std::invalid_argument | if the `script_node_type` already has an interface that conflicts with `interface_`.

const openvrml::node_interface_set & openvrml::script_node::script_node_type::do_interfaces | ( |  | ) | const throw ()`[private, virtual]`

Get the interfaces for the `node`.

Returns:
  the interfaces for the `node`.

Implements openvrml::node_type.

const boost::intrusive_ptr< openvrml::node > openvrml::script_node::script_node_type::do_create_node | ( | const boost::shared_ptr< openvrml::scope > & | scope,
|  | const initial_value_map & | initial_values |
| ) |  |  | const throw ( unsupported_interface , std::bad_cast , std::bad_alloc )`[private, virtual]`

Clone the Script node that has this `node_type`.

Since the `node_type` for a `script_node` is only available once a `script_node` is instantiated, you have to have a `script_node` instance in order to be able to use this method. The “primordial” `script_node` instance must be created with a call to the `script_node` constructor.

Parameters:

  `[in]` | scope | the `scope` to which the `node` should belong.
  `[in]` | initial_values | a map of initial values for the `node`'s `fields` and `exposedFields`.

Exceptions:

  | unsupported_interface | if `initial_values` specifies a field name that is not supported by the node type.
  | std::bad_cast | if a value in `initial_values` is the wrong type.
  | std::bad_alloc | if memory allocation fails.

## Member Data Documentation

openvrml::node_interface_set openvrml::script_node::script_node_type::interfaces_`[private]`

Node interfaces.