OpenVDB  2.3.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
TypedMetadata< T > Class Template Reference

Templated metadata class to hold specific types. More...

#include <Metadata.h>

Inherits Metadata.

Public Types

typedef boost::shared_ptr
< TypedMetadata< T > > 
Ptr
 
typedef boost::shared_ptr
< const TypedMetadata< T > > 
ConstPtr
 

Public Member Functions

 TypedMetadata ()
 
 TypedMetadata (const T &value)
 
 TypedMetadata (const TypedMetadata< T > &other)
 
virtual ~TypedMetadata ()
 
virtual Name typeName () const
 
virtual Metadata::Ptr copy () const
 
virtual void copy (const Metadata &other)
 Copy value from the given metadata into the curent metadata. More...
 
virtual std::string str () const
 
virtual bool asBool () const
 
virtual Index32 size () const
 
void setValue (const T &)
 Set this metadata's value. More...
 
T & value ()
 
const T & value () const
 
template<>
std::string str () const
 
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 Name staticTypeName ()
 
static Metadata::Ptr createMetadata ()
 Creates a new metadata of this type. More...
 
static void registerType ()
 
static void unregisterType ()
 
static bool isRegisteredType ()
 
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

virtual void readValue (std::istream &, Index32 numBytes)
 Read the attribute from a stream. More...
 
virtual void writeValue (std::ostream &) const
 Write the attribute to a stream. More...
 
void writeSize (std::ostream &) const
 Write the size of 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

template<typename T>
class openvdb::v2_3_0::TypedMetadata< T >

Templated metadata class to hold specific types.

Member Typedef Documentation

typedef boost::shared_ptr<const TypedMetadata<T> > ConstPtr
typedef boost::shared_ptr<TypedMetadata<T> > Ptr

Constructor & Destructor Documentation

TypedMetadata ( )
inline
TypedMetadata ( const T &  value)
inline
TypedMetadata ( const TypedMetadata< T > &  other)
inline
~TypedMetadata ( )
inlinevirtual

Member Function Documentation

bool asBool ( ) const
inlinevirtual

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

Implements Metadata.

static void clearRegistry ( )
staticinherited

Clears out the metadata registry.

Metadata::Ptr copy ( ) const
inlinevirtual
Returns
a copy of the metadata

Implements Metadata.

void copy ( const Metadata other)
inlinevirtual

Copy value from the given metadata into the curent metadata.

Implements Metadata.

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

Creates a new Metadata from the metadata type registry.

Metadata::Ptr createMetadata ( )
inlinestatic

Creates a new metadata of this type.

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

Read the attribute from a stream.

Index32 readSize ( std::istream &  is)
inlinestaticprotectedinherited

Read the size of the attribute from a stream.

void readValue ( std::istream &  is,
Index32  numBytes 
)
inlineprotectedvirtual

Read the attribute from a stream.

Implements Metadata.

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

Register the given metadata type along with a factory function.

void registerType ( )
inlinestatic

Register the given metadata type and a function that knows how to create the metadata type. This way the registry will know how to create certain metadata types.

void setValue ( const T &  val)
inline

Set this metadata's value.

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

Implements Metadata.

static Name staticTypeName ( )
inlinestatic

Static specialized function for the type name. This function must be template specialized for each type T.

std::string str ( ) const
inlinevirtual
Returns
string representation of value

Implements Metadata.

std::string str ( ) const
inlinevirtual
Returns
string representation of Metadata

Implements Metadata.

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

Implements Metadata.

static void unregisterType ( const Name typeName)
staticprotectedinherited
void unregisterType ( )
inlinestatic
T & value ( )
inline
Returns
this metadata's value.
const T & value ( ) const
inline
void write ( std::ostream &  os) const
inlineinherited

Write the attribute to a stream.

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

Write the size of the attribute to a stream.

void writeValue ( std::ostream &  os) const
inlineprotectedvirtual

Write the attribute to a stream.

Implements Metadata.


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