openvrml::node_impl_util::bound_node_stack< BindableNode > Class Template Reference

A stack of bindable nodes. More...

#include <openvrml/node_impl_util.h>

Inherits std::stack<BindableNode *>.

List of all members.


Public Member Functions

bool bind (BindableNode &node, double timestamp) throw ( std::bad_alloc )
 Bind a node.
bool unbind (BindableNode &node, double timestamp) throw ( std::bad_alloc )
 Unbind a node.

Private Types

typedef std::stack
< BindableNode * >
::container_type 
container_type
 The container type.

Detailed Description

template<typename BindableNode>
class openvrml::node_impl_util::bound_node_stack< BindableNode >

A stack of bindable nodes.

The node at the top of the stack is considered the active node. Binding a node makes it the active node, moving it to the top of the stack if it already exists in the stack. Unbinding a node removes it from the stack, regardless of its position in the stack. See 4.6.10 of the VRML97 specification for further details of the semantics.

Template Parameters:
BindableNode a Bindable Node.
See also:
http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.10

Member Typedef Documentation

template<typename BindableNode >
std::stack< BindableNode * >::container_type openvrml::node_impl_util::bound_node_stack< BindableNode >::container_type [private]

The container type.

For internal use only.


Member Function Documentation

template<typename BindableNode >
bool openvrml::node_impl_util::bound_node_stack< BindableNode >::bind ( BindableNode &  n,
double  timestamp 
) throw ( std::bad_alloc ) [inline]

Bind a node.

Call top()->bind(false). Push n onto the top of the stack, making it the active node. Call n.bind(true).

Postcondition:
top() == &n
Template Parameters:
BindableNode a Bindable Node.
Parameters:
[in,out] n the node to bind.
[in] timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

template<typename BindableNode >
bool openvrml::node_impl_util::bound_node_stack< BindableNode >::unbind ( BindableNode &  n,
double  timestamp 
) throw ( std::bad_alloc ) [inline]

Unbind a node.

Call n.bind(false). Remove n from the top of the stack. The next node on the stack becomes the active node. Call top()->bind(true).

Postcondition:
&n is not on the stack.
Template Parameters:
BindableNode a Bindable Node.
Parameters:
[in,out] n the node to unbind.
[in] timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.