OpenVDB
12.0.0
|
Base class for storing metadata information in a grid. More...
#include <openvdb/Metadata.h>
Inherited by DelayedLoadMetadata, TypedMetadata< T >, and UnknownMetadata.
Public Types | |
using | Ptr = SharedPtr< Metadata > |
using | ConstPtr = SharedPtr< const Metadata > |
Public Member Functions | |
Metadata () | |
virtual | ~Metadata () |
Metadata (const Metadata &)=delete | |
Metadata & | operator= (const Metadata &)=delete |
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... | |
Base class for storing metadata information in a grid.
|
inline |
|
inlinevirtual |
|
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 >, UnknownMetadata, and DelayedLoadMetadata.
|
static |
Clear out the metadata registry.
|
pure virtual |
Return a copy of the metadata.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
pure virtual |
Copy the given metadata into this metadata.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
static |
Create new metadata of the given type.
|
static |
Return true
if the given type is known by the metadata type registry.
|
inline |
Return true
if the given metadata is different from this metadata.
bool operator== | ( | const Metadata & | other | ) | const |
Return true
if the given metadata is equivalent to this metadata.
|
inline |
Unserialize this metadata from a stream.
|
inlinestaticprotected |
Read the size of the metadata from a stream.
|
protectedpure virtual |
Read the metadata from a stream.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
static |
Register the given metadata type along with a factory function.
|
pure virtual |
Return the size of this metadata in bytes.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
pure virtual |
Return a textual representation of this metadata.
Implemented in TypedMetadata< T >, TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
pure virtual |
Return the type name of the metadata.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.
|
static |
|
inline |
Serialize this metadata to a stream.
|
inlineprotected |
Write the size of the metadata to a stream.
|
protectedpure virtual |
Write the metadata to a stream.
Implemented in TypedMetadata< T >, UnknownMetadata, and DelayedLoadMetadata.