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

# openvrml::node_metatype_registry Class Reference

Registry for `node_metatypes`. More...

`#include <openvrml/browser.h>`

List of all members.

## Public Member Functions
| ~node_metatype_registry () throw ()
| Destroy.
openvrml::browser & | browser () const throw ()
void | register_node_metatype (const std::string &id, const boost::shared_ptr< node_metatype > &metatype) throw ( std::invalid_argument , std::bad_alloc )
| Register a `node_metatype`.
## Private Member Functions
| node_metatype_registry (openvrml::browser &b)
| Construct.
## Private Attributes
boost::scoped_ptr < local::node_metatype_registry_impl > | impl_
| A pointer to the implementation object.
## Friends
class | browser
| The `browser`.
bool | operator== (const node_type &, const node_type &) throw ()
| Compare for equality.

## Detailed Description

Registry for `node_metatypes`.

## Constructor & Destructor Documentation

openvrml::node_metatype_registry::node_metatype_registry | ( | openvrml::browser & | b | ) | `[explicit, private]`

Construct.

Parameters:

  `[in]` | b | a `browser`.

openvrml::node_metatype_registry::~node_metatype_registry | ( |  | ) | throw ()

Destroy.

## Member Function Documentation

void openvrml::node_metatype_registry::register_node_metatype | ( | const std::string & | id,
|  | const boost::shared_ptr< node_metatype > & | metatype |
| ) |  |  | throw ( std::invalid_argument , std::bad_alloc )

Register a `node_metatype`.

This operation is destructive; that is, if a `node_metatype` is already registered under `id`, `metatype` will replace it in the registry.

Parameters:

  `[in]` | id | the string identifier associated with `metatype`.
  `[in]` | metatype | a `node_metatype`.

Exceptions:

  | std::invalid_argument | if `metatype` is null.
  | std::bad_alloc | if memory allocation fails.

## Friends And Related Function Documentation

openvrml::browser & openvrml::node_metatype_registry::browser`[friend]`

The `browser`.

Returns:
  the `browser`.

bool operator== | ( | const node_type & | lhs,
|  | const node_type & | rhs |
| ) |  |  | throw ()`[friend]`

Compare for equality.

Two `node_types` `t` and `u` are considered equal if all of the following are true:

- `t.id() == u.id()`
- `t.interfaces() == u.interfaces()`
- `t.metatype().id()` is in the set of identifiers associated with `u` in the `browser`'s `node_metatype` map.

Note that the latter requirement makes this comparison a rather expensive operation.

Parameters:

  `[in]` | lhs |
  `[in]` | rhs |

Returns:
  `true` if `lhs` and `rhs` are equal; `false` otherwise.

## Member Data Documentation

boost::scoped_ptr< openvrml::local::node_metatype_registry_impl > openvrml::node_metatype_registry::impl_`[private]`

A pointer to the implementation object.