OpenVDB 13.0.0

Loading...
Searching...
No Matches
UnknownMetadata Class Reference

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

`#include <openvdb/Metadata.h>`

Inheritance diagram for UnknownMetadata:

## 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.
Metadata::Ptr | copy () const override
| Return a copy of the metadata.
void | copy (const Metadata &) override
| Copy the given metadata into this metadata.
std::string | str () const override
| Return a textual representation of this metadata.
bool | asBool () const override
Index32 | size () const override
| Return the size of this metadata in bytes.
void | setValue (const ByteVec &bytes)
const ByteVec & | value () const
bool | operator== (const Metadata &other) const
| Return `true` if the given metadata is equivalent to this metadata.
bool | operator!= (const Metadata &other) const
| Return `true` if the given metadata is different from this metadata.
void | read (std::istream &)
| Unserialize this metadata from a stream.
void | write (std::ostream &) const
| Serialize this metadata to a stream.

## Static Public Member Functions
static Metadata::Ptr | createMetadata (const Name &typeName)
| Create new metadata of the given type.
static bool | isRegisteredType (const Name &typeName)
| Return `true` if the given type is known by the metadata type registry.
static void | clearRegistry ()
| Clear out the metadata registry.
static void | registerType (const Name &typeName, Metadata::Ptr(*createMetadata)())
| Register the given metadata type along with a factory function.
static void | unregisterType (const Name &typeName)

## Protected Member Functions
void | readValue (std::istream &, Index32 numBytes) override
| Read the metadata from a stream.
void | writeValue (std::ostream &) const override
| Write the metadata to a stream.
void | writeSize (std::ostream &) const
| Write the size of the metadata to a stream.

## Static Protected Member Functions
static Index32 | readSize (std::istream &)
| Read the size of the metadata from a stream.

## Detailed Description

Subclass to hold raw data of an unregistered type.

## Member Typedef Documentation

## ◆ ByteVec

using ByteVec = std::vector<uint8_t>

## ◆ ConstPtr

using ConstPtr = SharedPtr<const Metadata>
| inherited

## ◆ Ptr

using Ptr = SharedPtr<Metadata>
| inherited

## Constructor & Destructor Documentation

## ◆ UnknownMetadata()

UnknownMetadata | ( | const Name & | typ = "<unknown>" | ) |
| inline explicit

## Member Function Documentation

## ◆ asBool()

bool asBool | ( |  | ) | const
| inline override virtual

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

Implements Metadata.

## ◆ clearRegistry()

void clearRegistry | ( |  | ) |
| static inherited

Clear out the metadata registry.

## ◆ copy() [1/2]

Metadata::Ptr copy | ( |  | ) | const
| override virtual

Return a copy of the metadata.

Implements Metadata.

## ◆ copy() [2/2]

void copy | ( | const Metadata & | other | ) |
| override virtual

Copy the given metadata into this metadata.

Implements Metadata.

## ◆ createMetadata()

Metadata::Ptr createMetadata | ( | const Name & | typeName | ) |
| static inherited

Create new metadata of the given type.

## ◆ isRegisteredType()

bool isRegisteredType | ( | const Name & | typeName | ) |
| static inherited

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

## ◆ operator!=()

bool operator!= | ( | const Metadata & | other | ) | const
| inline inherited

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 | ) |
| inline inherited

Unserialize this metadata from a stream.

## ◆ readSize()

Index32 readSize | ( | std::istream & | is | ) |
| inline static protected inherited

Read the size of the metadata from a stream.

## ◆ readValue()

void readValue | ( | std::istream & | ,
|  | Index32 | numBytes )
| override protected virtual

Read the metadata from a stream.

Implements Metadata.

## ◆ registerType()

void registerType | ( | const Name & | typeName,
|  | Metadata::Ptr(* | createMetadata )() )
| static inherited

Register the given metadata type along with a factory function.

## ◆ setValue()

void setValue | ( | const ByteVec & | bytes | ) |
| inline

## ◆ size()

Index32 size | ( |  | ) | const
| inline override virtual

Return the size of this metadata in bytes.

Implements Metadata.

## ◆ str()

std::string str | ( |  | ) | const
| inline override virtual

Return a textual representation of this metadata.

Implements Metadata.

## ◆ typeName()

Name typeName | ( |  | ) | const
| inline override virtual

Return the type name of the metadata.

Implements Metadata.

## ◆ unregisterType()

void unregisterType | ( | const Name & | typeName | ) |
| static inherited

## ◆ value()

const ByteVec & value | ( |  | ) | const
| inline

## ◆ write()

void write | ( | std::ostream & | os | ) | const
| inline inherited

Serialize this metadata to a stream.

## ◆ writeSize()

void writeSize | ( | std::ostream & | os | ) | const
| inline protected inherited

Write the size of the metadata to a stream.

## ◆ writeValue()

void writeValue | ( | std::ostream & |  | ) | const
| override protected virtual

Write the metadata to a stream.

Implements Metadata.