openvrml::scope Class Reference
The
scope class keeps track of defined
nodes and prototypes.
More...
#include <openvrml/scope.h>
List of all members.
Detailed Description
The
scope class keeps track of defined
nodes and prototypes.
PROTO definitions add node_types to the namespace. PROTO implementations are a separate node_type namespace and require that any nested PROTOs not be available outside the PROTO implementation. PROTOs defined outside the current namespace are available.
Constructor & Destructor Documentation
| openvrml::scope::scope |
( |
const std::string & |
id, |
|
|
const boost::shared_ptr< scope > & |
parent = boost::shared_ptr<scope>() | |
|
) |
| | [explicit] |
Construct.
- Parameters:
-
| [in] | id | the identifier for the scope. |
| [in] | parent | the parent scope. |
For the root
scope,
id should be the URI of the world. For child
scopes,
id should be the name of the
PROTO to which the
scope corresponds.
Member Function Documentation
| const std::string & openvrml::scope::id |
( |
|
) |
const throw () |
| const boost::shared_ptr< openvrml::scope > & openvrml::scope::parent |
( |
|
) |
const throw () |
| const std::pair< boost::shared_ptr< openvrml::node_type >, bool > openvrml::scope::add_type |
( |
const boost::shared_ptr< node_type > & |
type |
) |
throw ( std::bad_alloc ) |
Add a node_type.
Print an error message if the argument type is already defined.
- Parameters:
-
- Returns:
- a pair whose first element is a pointer to a
node_type whose node_type::id is the same as that of type. The second element is a boolean value. If the second element is true, type was successfully added to the scope and the first element is the same as type. If the second element is false, type was not added to the scope and the first element is a node_type that already exists in the scope.
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
- Precondition:
type is not null.
| const boost::shared_ptr< openvrml::node_type > & openvrml::scope::find_type |
( |
const std::string & |
id |
) |
const |
| openvrml::node * openvrml::scope::find_node |
( |
const std::string & |
id |
) |
const |
Friends And Related Function Documentation
openvrml::scope::node [friend] |
node identifiers are stored in the scope, so node needs special privilege to access them.
| const std::string path |
( |
const scope & |
s |
) |
throw(std::bad_alloc) [related] |
- Parameters:
-
- Returns:
- the full “path” to the
scope.
Member Data Documentation
scope identifier.
For internal use only.
The parent scope; null if the scope is a root scope.
For internal use only.