OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
UnknownMetadata Class Reference

Subclass to hold raw data of an unregistered type. More...

#include <openvdb/Metadata.h>

Inherits Metadata.

Public Types

using ByteVec = std::vector< uint8_t >
 
using Ptr = SharedPtr< Metadata >
 
using ConstPtr = SharedPtr< const Metadata >
 

Public Member Functions

 UnknownMetadata (const Name &typ="<unknown>")
 
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 &) 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 ByteVec &bytes)
 
const ByteVecvalue () const
 
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 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

Subclass to hold raw data of an unregistered type.

Member Typedef Documentation

using ByteVec = std::vector<uint8_t>
using ConstPtr = SharedPtr<const Metadata>
inherited
using Ptr = SharedPtr<Metadata>
inherited

Constructor & Destructor Documentation

UnknownMetadata ( const Name typ = "<unknown>")
inlineexplicit

Member Function Documentation

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.

static void clearRegistry ( )
staticinherited

Clear out the metadata registry.

Metadata::Ptr copy ( ) const
overridevirtual

Return a copy of the metadata.

Implements Metadata.

void copy ( const Metadata other)
overridevirtual

Copy the given metadata into this metadata.

Implements Metadata.

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

Create new metadata of the given type.

static bool isRegisteredType ( const Name typeName)
staticinherited

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

bool operator!= ( const Metadata other) const
inlineinherited

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

bool operator== ( const Metadata other) const
inherited

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

void read ( std::istream &  is)
inlineinherited

Unserialize this metadata from a stream.

Index32 readSize ( std::istream &  is)
inlinestaticprotectedinherited

Read the size of the metadata from a stream.

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

Read the metadata from a stream.

Implements Metadata.

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

Register the given metadata type along with a factory function.

void setValue ( const ByteVec bytes)
inline
Index32 size ( ) const
inlineoverridevirtual

Return the size of this metadata in bytes.

Implements Metadata.

std::string str ( ) const
inlineoverridevirtual

Return a textual representation of this metadata.

Implements Metadata.

Name typeName ( ) const
inlineoverridevirtual

Return the type name of the metadata.

Implements Metadata.

static void unregisterType ( const Name typeName)
staticinherited
const ByteVec& value ( ) const
inline
void write ( std::ostream &  os) const
inlineinherited

Serialize this metadata to a stream.

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

Write the size of the metadata to a stream.

void writeValue ( std::ostream &  ) const
overrideprotectedvirtual

Write the metadata to a stream.

Implements Metadata.