OpenVDB  2.1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Metadata Class Referenceabstract

Base class for storing metadata information in a grid. More...

#include <Metadata.h>

Inherited by TypedMetadata< T >, and UnknownMetadata.

Public Types

typedef boost::shared_ptr
< Metadata
Ptr
 
typedef boost::shared_ptr
< const Metadata
ConstPtr
 

Public Member Functions

 Metadata ()
 Constructor. More...
 
virtual ~Metadata ()
 Destructor. More...
 
virtual Name typeName () const =0
 
virtual Metadata::Ptr copy () const =0
 
virtual void copy (const Metadata &other)=0
 Copy value from the given metadata into the curent metadata. More...
 
virtual std::string str () const =0
 
virtual bool asBool () const =0
 
virtual Index32 size () const =0
 
void read (std::istream &)
 Read the attribute from a stream. More...
 
void write (std::ostream &) const
 Write the attribute to a stream. More...
 

Static Public Member Functions

static Metadata::Ptr createMetadata (const Name &typeName)
 Creates a new Metadata from the metadata type registry. More...
 
static bool isRegisteredType (const Name &typeName)
 
static void clearRegistry ()
 Clears out the metadata registry. More...
 

Protected Member Functions

void writeSize (std::ostream &) const
 Write the size of the attribute to a stream. More...
 
virtual void readValue (std::istream &, Index32 numBytes)=0
 Read the attribute from a stream. More...
 
virtual void writeValue (std::ostream &) const =0
 Write the attribute to a stream. More...
 

Static Protected Member Functions

static Index32 readSize (std::istream &)
 Read the size of the attribute from a stream. More...
 
static void registerType (const Name &typeName, Metadata::Ptr(*createMetadata)())
 Register the given metadata type along with a factory function. More...
 
static void unregisterType (const Name &typeName)
 

Detailed Description

Base class for storing metadata information in a grid.

Member Typedef Documentation

typedef boost::shared_ptr<const Metadata> ConstPtr
typedef boost::shared_ptr<Metadata> Ptr

Constructor & Destructor Documentation

Metadata ( )
inline

Constructor.

virtual ~Metadata ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual bool asBool ( ) const
pure virtual

Return the boolean representation of this metadata (empty strings and zeroVals evaluate to false; most other values evaluate to true).

Implemented in TypedMetadata< T >, and UnknownMetadata.

static void clearRegistry ( )
static

Clears out the metadata registry.

virtual Metadata::Ptr copy ( ) const
pure virtual
Returns
a copy of the metadata.

Implemented in TypedMetadata< T >, and UnknownMetadata.

virtual void copy ( const Metadata other)
pure virtual

Copy value from the given metadata into the curent metadata.

Implemented in TypedMetadata< T >, and UnknownMetadata.

static Metadata::Ptr createMetadata ( const Name typeName)
static

Creates a new Metadata from the metadata type registry.

static bool isRegisteredType ( const Name typeName)
static
Returns
true if the given type is known by the metadata type registry.
void read ( std::istream &  is)
inline

Read the attribute from a stream.

Index32 readSize ( std::istream &  is)
inlinestaticprotected

Read the size of the attribute from a stream.

virtual void readValue ( std::istream &  ,
Index32  numBytes 
)
protectedpure virtual

Read the attribute from a stream.

Implemented in TypedMetadata< T >, and UnknownMetadata.

static void registerType ( const Name typeName,
Metadata::Ptr(*)()  createMetadata 
)
staticprotected

Register the given metadata type along with a factory function.

virtual Index32 size ( ) const
pure virtual
Returns
the size of the attribute in bytes.

Implemented in TypedMetadata< T >, and UnknownMetadata.

virtual std::string str ( ) const
pure virtual
Returns
string representation of Metadata

Implemented in TypedMetadata< T >, TypedMetadata< T >, and UnknownMetadata.

virtual Name typeName ( ) const
pure virtual
Returns
the type name of the metadata.

Implemented in TypedMetadata< T >, and UnknownMetadata.

static void unregisterType ( const Name typeName)
staticprotected
void write ( std::ostream &  os) const
inline

Write the attribute to a stream.

void writeSize ( std::ostream &  os) const
inlineprotected

Write the size of the attribute to a stream.

virtual void writeValue ( std::ostream &  ) const
protectedpure virtual

Write the attribute to a stream.

Implemented in TypedMetadata< T >, and UnknownMetadata.


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