HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::Metadata Class Referenceabstract

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

#include <Metadata.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::Metadata:

Public Types

using Ptr = SharedPtr< Metadata >
 
using ConstPtr = SharedPtr< const Metadata >
 

Public Member Functions

 Metadata ()
 
virtual ~Metadata ()
 
virtual Name typeName () const =0
 Return the type name of the metadata. More...
 
virtual Metadata::Ptr copy () const =0
 Return a copy of the metadata. More...
 
virtual void copy (const Metadata &other)=0
 Copy the given metadata into this metadata. More...
 
virtual std::string str () const =0
 Return a textual representation of this metadata. More...
 
virtual bool asBool () const =0
 
bool operator== (const Metadata &other) const
 Return true if the given metadata is equivalent to this metadata. More...
 
bool operator!= (const Metadata &other) const
 Return true if the given metadata is different from this metadata. More...
 
virtual Index32 size () const =0
 Return the size of this metadata in bytes. More...
 
void read (std::istream &)
 Unserialize this metadata from a stream. More...
 
void write (std::ostream &) const
 Serialize this metadata to a stream. More...
 

Static Public Member Functions

static Metadata::Ptr createMetadata (const Name &typeName)
 Create new metadata of the given type. More...
 
static bool isRegisteredType (const Name &typeName)
 Return true if the given type is known by the metadata type registry. More...
 
static void clearRegistry ()
 Clear out the metadata registry. 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)
 

Protected Member Functions

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

Static Protected Member Functions

static Index32 readSize (std::istream &)
 Read the size of the metadata from a stream. More...
 

Detailed Description

Base class for storing metadata information in a grid.

Definition at line 48 of file Metadata.h.

Member Typedef Documentation

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::Metadata::Metadata ( )
inline

Definition at line 54 of file Metadata.h.

virtual openvdb::OPENVDB_VERSION_NAME::Metadata::~Metadata ( )
inlinevirtual

Definition at line 55 of file Metadata.h.

Member Function Documentation

virtual bool openvdb::OPENVDB_VERSION_NAME::Metadata::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 openvdb::OPENVDB_VERSION_NAME::TypedMetadata< T >, and openvdb::OPENVDB_VERSION_NAME::UnknownMetadata.

static void openvdb::OPENVDB_VERSION_NAME::Metadata::clearRegistry ( )
static

Clear out the metadata registry.

virtual Metadata::Ptr openvdb::OPENVDB_VERSION_NAME::Metadata::copy ( ) const
pure virtual
virtual void openvdb::OPENVDB_VERSION_NAME::Metadata::copy ( const Metadata other)
pure virtual

Copy the given metadata into this metadata.

Implemented in openvdb::OPENVDB_VERSION_NAME::TypedMetadata< T >, and openvdb::OPENVDB_VERSION_NAME::UnknownMetadata.

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

Create new metadata of the given type.

static bool openvdb::OPENVDB_VERSION_NAME::Metadata::isRegisteredType ( const Name typeName)
static

Return true if the given type is known by the metadata type registry.

bool openvdb::OPENVDB_VERSION_NAME::Metadata::operator!= ( const Metadata other) const
inline

Return true if the given metadata is different from this metadata.

Definition at line 76 of file Metadata.h.

bool openvdb::OPENVDB_VERSION_NAME::Metadata::operator== ( const Metadata other) const

Return true if the given metadata is equivalent to this metadata.

void openvdb::OPENVDB_VERSION_NAME::Metadata::read ( std::istream &  is)
inline

Unserialize this metadata from a stream.

Definition at line 206 of file Metadata.h.

Index32 openvdb::OPENVDB_VERSION_NAME::Metadata::readSize ( std::istream &  is)
inlinestaticprotected

Read the size of the metadata from a stream.

Definition at line 197 of file Metadata.h.

virtual void openvdb::OPENVDB_VERSION_NAME::Metadata::readValue ( std::istream &  ,
Index32  numBytes 
)
protectedpure virtual
static void openvdb::OPENVDB_VERSION_NAME::Metadata::registerType ( const Name typeName,
Metadata::Ptr(*)()  createMetadata 
)
static

Register the given metadata type along with a factory function.

virtual Index32 openvdb::OPENVDB_VERSION_NAME::Metadata::size ( ) const
pure virtual

Return the size of this metadata in bytes.

Implemented in openvdb::OPENVDB_VERSION_NAME::TypedMetadata< T >, and openvdb::OPENVDB_VERSION_NAME::UnknownMetadata.

virtual std::string openvdb::OPENVDB_VERSION_NAME::Metadata::str ( ) const
pure virtual
virtual Name openvdb::OPENVDB_VERSION_NAME::Metadata::typeName ( ) const
pure virtual
static void openvdb::OPENVDB_VERSION_NAME::Metadata::unregisterType ( const Name typeName)
static
void openvdb::OPENVDB_VERSION_NAME::Metadata::write ( std::ostream &  os) const
inline

Serialize this metadata to a stream.

Definition at line 214 of file Metadata.h.

void openvdb::OPENVDB_VERSION_NAME::Metadata::writeSize ( std::ostream &  os) const
inlineprotected

Write the size of the metadata to a stream.

Definition at line 189 of file Metadata.h.

virtual void openvdb::OPENVDB_VERSION_NAME::Metadata::writeValue ( std::ostream &  ) const
protectedpure virtual

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