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

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.

Additional Inherited Members

- Private Attributes inherited from std::stack< T >
elements
 STL member.

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
BindableNodea Bindable Node.
See Also
http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.10

Member Function Documentation

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

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
BindableNodea Bindable Node.
Parameters
[in,out]nthe node to bind.
[in]timestampthe current time.
Exceptions
std::bad_allocif memory allocation fails.
template<typename BindableNode >
bool openvrml::node_impl_util::bound_node_stack< BindableNode >::unbind ( BindableNode &  n,
double  timestamp 
) throw ( std::bad_alloc )

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
BindableNodea Bindable Node.
Parameters
[in,out]nthe node to unbind.
[in]timestampthe current time.
Exceptions
std::bad_allocif memory allocation fails.