OpenVDB  0.104.0
Public Types | Public Member Functions | List of all members
MetaMap Class Reference

Provides functionality storing type agnostic metadata information. Grids and other structures can inherit from this to attain metadata functionality. More...

#include <MetaMap.h>

Inherited by GridBase.

Public Types

typedef boost::shared_ptr
< MetaMap
Ptr
 
typedef boost::shared_ptr
< const MetaMap
ConstPtr
 
typedef std::map< Name,
Metadata::Ptr
MetadataMap
 
typedef MetadataMap::iterator MetaIterator
 
typedef MetadataMap::const_iterator ConstMetaIterator
 

Public Member Functions

 MetaMap ()
 Constructor. More...
 
 MetaMap (const MetaMap &other)
 
virtual ~MetaMap ()
 Destructor. More...
 
MetaMap::Ptr copyMeta () const
 Return a copy of this map whose fields are shared with this map. More...
 
MetaMap::Ptr deepCopyMeta () const
 Return a deep copy of this map that shares no data with this map. More...
 
MetaMapoperator= (const MetaMap &)
 Assign to this map a deep copy of another map. More...
 
void readMeta (std::istream &)
 Read in all the Meta information the given stream. More...
 
void writeMeta (std::ostream &) const
 Write out all the Meta information to the given stream. More...
 
void insertMeta (const Name &name, const Metadata &metadata)
 
void removeMeta (const Name &name)
 
template<typename T >
T & metaValue (const Name &name)
 
template<typename T >
const T & metaValue (const Name &name) const
 
MetaIterator beginMeta ()
 Functions for iterating over the Metadata. More...
 
MetaIterator endMeta ()
 
ConstMetaIterator beginMeta () const
 
ConstMetaIterator endMeta () const
 
void clearMetadata ()
 
size_t metaCount () const
 
bool empty () const
 
std::string str () const
 
Metadata::Ptr operator[] (const Name &)
 
Metadata::ConstPtr operator[] (const Name &) const
 
template<typename T >
T::Ptr getMetadata (const Name &name)
 
template<typename T >
T::ConstPtr getMetadata (const Name &name) const
 

Detailed Description

Provides functionality storing type agnostic metadata information. Grids and other structures can inherit from this to attain metadata functionality.

Member Typedef Documentation

typedef MetadataMap::const_iterator ConstMetaIterator
typedef boost::shared_ptr<const MetaMap> ConstPtr
typedef std::map<Name, Metadata::Ptr> MetadataMap
typedef MetadataMap::iterator MetaIterator
typedef boost::shared_ptr<MetaMap> Ptr

Constructor & Destructor Documentation

MetaMap ( )
inline

Constructor.

MetaMap ( const MetaMap other)
virtual ~MetaMap ( )
inlinevirtual

Destructor.

Member Function Documentation

MetaIterator beginMeta ( )
inline

Functions for iterating over the Metadata.

ConstMetaIterator beginMeta ( ) const
inline
void clearMetadata ( )
inline
MetaMap::Ptr copyMeta ( ) const

Return a copy of this map whose fields are shared with this map.

MetaMap::Ptr deepCopyMeta ( ) const

Return a deep copy of this map that shares no data with this map.

bool empty ( ) const
inline
MetaIterator endMeta ( )
inline
ConstMetaIterator endMeta ( ) const
inline
T::Ptr getMetadata ( const Name name)
inline
Returns
pointer to TypedMetadata, NULL if type and name mismatch.
T::ConstPtr getMetadata ( const Name name) const
inline
Returns
pointer to TypedMetadata, NULL if type and name mismatch.
void insertMeta ( const Name name,
const Metadata metadata 
)

Insert a new metadata or overwrite existing. If Metadata with given name doesn't exist, a new Metadata field is added. If it does exist and given metadata is of the same type, then overwrite existing with new value. If it does exist and not of the same type, then throw an exception.

Parameters
namethe name of the metadata.
metadatathe actual metadata to store.
size_t metaCount ( ) const
inline
T & metaValue ( const Name name)
inline
Returns
direct access to the underlying value stored by the given metadata name. Here T is the type of the value stored. If there is a mismatch, then throws an exception.
const T & metaValue ( const Name name) const
inline
MetaMap & operator= ( const MetaMap other)

Assign to this map a deep copy of another map.

Metadata::Ptr operator[] ( const Name name)
inline
Returns
a pointer to the metadata with the given name, NULL if no such field exists.
Metadata::ConstPtr operator[] ( const Name name) const
inline
Returns
a pointer to the metadata with the given name, NULL if no such field exists.
void readMeta ( std::istream &  is)

Read in all the Meta information the given stream.

void removeMeta ( const Name name)

Removes an existing metadata field from the grid. If the metadata with the given name doesn't exist, do nothing.

Parameters
namethe name of the metadata field to remove.
std::string str ( ) const
Returns
string representation of MetaMap
void writeMeta ( std::ostream &  os) const

Write out all the Meta information to the given stream.


The documentation for this class was generated from the following files: