OpenVDB  6.0.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

using Ptr = SharedPtr< TypedMetadata< T > >
 
using ConstPtr = SharedPtr< const TypedMetadata< T > >
 

Public Member Functions

 TypedMetadata ()
 
 TypedMetadata (const T &value)
 
 TypedMetadata (const TypedMetadata< T > &other)
 
 ~TypedMetadata () override
 
Name typeName () const override
 Return the type name of the metadata. More...
 
Metadata::Ptr copy () const override
 Return a copy of the metadata. More...
 
void copy (const Metadata &other) override
 Copy the given metadata into this metadata. More...
 
std::string str () const override
 Return a textual representation of this metadata. More...
 
bool asBool () const override
 
Index32 size () const override
 Return the size of this metadata in bytes. More...
 
void setValue (const T &)
 Set this metadata's value. More...
 
T & value ()
 Return this metadata's value. More...
 
const T & value () const
 
template<>
std::string str () const
 Return a textual representation of this metadata. More...
 
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...
 
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 Name staticTypeName ()
 
static Metadata::Ptr createMetadata ()
 Create new metadata of this type. More...
 
static void registerType ()
 
static void unregisterType ()
 
static bool isRegisteredType ()
 
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 readValue (std::istream &, Index32 numBytes) override
 Read the metadata from a stream. More...
 
void writeValue (std::ostream &) const override
 Write the metadata to a stream. More...
 
void writeSize (std::ostream &) const
 Write the size of 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

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

Templated metadata class to hold specific types.

Member Typedef Documentation

◆ ConstPtr

using ConstPtr = SharedPtr<const TypedMetadata<T> >

◆ Ptr

using Ptr = SharedPtr<TypedMetadata<T> >

Constructor & Destructor Documentation

◆ TypedMetadata() [1/3]

TypedMetadata ( )
inline

◆ TypedMetadata() [2/3]

TypedMetadata ( const T &  value)
inline

◆ TypedMetadata() [3/3]

TypedMetadata ( const TypedMetadata< T > &  other)
inline

◆ ~TypedMetadata()

~TypedMetadata ( )
inlineoverride

Member Function Documentation

◆ asBool()

bool asBool ( ) const
inlineoverridevirtual

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

Implements Metadata.

◆ clearRegistry()

static void clearRegistry ( )
staticinherited

Clear out the metadata registry.

◆ copy() [1/2]

Metadata::Ptr copy ( ) const
inlineoverridevirtual

Return a copy of the metadata.

Implements Metadata.

◆ copy() [2/2]

void copy ( const Metadata other)
inlineoverridevirtual

Copy the given metadata into this metadata.

Implements Metadata.

◆ createMetadata() [1/2]

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

Create new metadata of the given type.

◆ createMetadata() [2/2]

Metadata::Ptr createMetadata ( )
inlinestatic

Create new metadata of this type.

◆ isRegisteredType() [1/2]

static bool isRegisteredType ( const Name typeName)
staticinherited

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

◆ isRegisteredType() [2/2]

bool isRegisteredType ( )
inlinestatic

◆ operator!=()

bool operator!= ( const Metadata other) const
inlineinherited

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

◆ operator==()

bool operator== ( const Metadata other) const
inherited

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

◆ read()

void read ( std::istream &  is)
inlineinherited

Unserialize this metadata from a stream.

◆ readSize()

Index32 readSize ( std::istream &  is)
inlinestaticprotectedinherited

Read the size of the metadata from a stream.

◆ readValue()

void readValue ( std::istream &  ,
Index32  numBytes 
)
inlineoverrideprotectedvirtual

Read the metadata from a stream.

Implements Metadata.

◆ registerType() [1/2]

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

Register the given metadata type along with a factory function.

◆ registerType() [2/2]

void registerType ( )
inlinestatic

◆ setValue()

void setValue ( const T &  val)
inline

Set this metadata's value.

◆ size()

Index32 size ( ) const
inlineoverridevirtual

Return the size of this metadata in bytes.

Implements Metadata.

◆ staticTypeName()

static Name staticTypeName ( )
inlinestatic

◆ str() [1/2]

std::string str ( ) const
inlineoverridevirtual

Return a textual representation of this metadata.

Implements Metadata.

◆ str() [2/2]

std::string str ( ) const
inlinevirtual

Return a textual representation of this metadata.

Implements Metadata.

◆ typeName()

Name typeName ( ) const
inlineoverridevirtual

Return the type name of the metadata.

Implements Metadata.

◆ unregisterType() [1/2]

static void unregisterType ( const Name typeName)
staticinherited

◆ unregisterType() [2/2]

void unregisterType ( )
inlinestatic

◆ value() [1/2]

T & value ( )
inline

Return this metadata's value.

◆ value() [2/2]

const T & value ( ) const
inline

◆ write()

void write ( std::ostream &  os) const
inlineinherited

Serialize this metadata to a stream.

◆ writeSize()

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

Write the size of the metadata to a stream.

◆ writeValue()

void writeValue ( std::ostream &  ) const
inlineoverrideprotectedvirtual

Write the metadata to a stream.

Implements Metadata.


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