openvrml::node_metatype_id Class Reference

Identifier for node_metatypes. More...

#include <openvrml/node.h>

Public Member Functions

 node_metatype_id (const char *id) throw ( std::invalid_argument , std::bad_alloc )
 Construct from a const char *.
 node_metatype_id (const std::string &id) throw ( std::invalid_argument , std::bad_alloc )
 Construct from a std::string.
 operator std::string () const
 Convert to a std::string.

Related Functions

(Note that these are not member functions.)

bool operator== (const node_metatype_id &lhs, const node_metatype_id &rhs) throw()
bool operator!= (const node_metatype_id &lhs, const node_metatype_id &rhs) throw()

Detailed Description

Identifier for node_metatypes.

node_metatype identifiers take the following form:

absolute-uri ['#' proto-id ['#' proto-id [...]]]

A node_metatype identifier is basically like an absolute URI; except the fragment identifier syntax has been extended to support referring to nested PROTOs.

For example, supposing the following VRML world resides at http://example.com/example.wrl:

#VRML V2.0 utf8
PROTO Outer [] {
  PROTO Inner [] { Group {} }
  Group {}
}

The node_metatype_id string for Outer would be http://example.com/example.wrl#Outer; and for Inner, http://example.com/example.wrl#Outer#Inner.

Constructor & Destructor Documentation

openvrml::node_metatype_id::node_metatype_id ( const char *  id) throw ( std::invalid_argument , std::bad_alloc )

Construct from a const char *.

Parameters
[in]idthe identifier.
Exceptions
std::invalid_argumentif id is not a valid node_metatype identifier.
std::bad_allocif memory allocation fails.
openvrml::node_metatype_id::node_metatype_id ( const std::string &  id) throw ( std::invalid_argument , std::bad_alloc )

Construct from a std::string.

Parameters
[in]idthe identifier.
Exceptions
std::invalid_argumentif id is not a valid node_metatype identifier.
std::bad_allocif memory allocation fails.

Member Function Documentation

openvrml::node_metatype_id::operator std::string ( ) const

Convert to a std::string.

Returns
the node_metatype identifier as a std::string.

Friends And Related Function Documentation

bool operator== ( const node_metatype_id lhs,
const node_metatype_id rhs 
) throw()
related
Parameters
[in]lhs
[in]rhs
Returns
true if lhs and rhs are equal, false otherwise.
bool operator!= ( const node_metatype_id lhs,
const node_metatype_id rhs 
) throw()
related
Parameters
[in]lhs
[in]rhs
Returns
true if lhs and rhs are not equal, false otherwise.