Loading...
Searching...
No Matches
TypedMetadata< T > Class Template Reference

Templated metadata class to hold specific types. More...

`#include <openvdb/Metadata.h>`

Inheritance diagram for TypedMetadata< T >:

## 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.
Metadata::Ptr | copy () const override
| Return a copy of the metadata.
void | copy (const Metadata &other) 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 T &)
| Set this metadata's value.
T & | value ()
| Return this metadata's value.
const T & | value () const
std::string | str () const
| Return a textual representation of this metadata.
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 Name | staticTypeName ()
static Metadata::Ptr | createMetadata ()
| Create new metadata of this type.
static void | registerType ()
static void | unregisterType ()
static bool | isRegisteredType ()
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

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

Templated metadata class to hold specific types.

## Member Typedef Documentation

## ConstPtr

template<typename T>

using ConstPtr = SharedPtr<const TypedMetadata<T>>

## Ptr

template<typename T>

using Ptr = SharedPtr<TypedMetadata<T>>

## Constructor & Destructor Documentation

## TypedMetadata() [1/3]

template<typename T>

TypedMetadata | ( |  | ) |

inline

## TypedMetadata() [2/3]

template<typename T>

TypedMetadata | ( | const T & | value | ) |

inline

## TypedMetadata() [3/3]

template<typename T>

TypedMetadata | ( | const TypedMetadata< T > & | other | ) |

inline

## ~TypedMetadata()

template<typename T>

~TypedMetadata | ( |  | ) |

inline override

## Member Function Documentation

## asBool()

template<typename T>

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]

template<typename T>

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

inline override virtual

Return a copy of the metadata.

Implements Metadata.

## copy() [2/2]

template<typename T>

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

inline override virtual

Copy the given metadata into this metadata.

Implements Metadata.

## createMetadata() [1/2]

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

static inherited

Create new metadata of the given type.

## createMetadata() [2/2]

template<typename T>

Metadata::Ptr createMetadata | ( |  | ) |

inline static

Create new metadata of this type.

## isRegisteredType() [1/2]

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

static inherited

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

## isRegisteredType() [2/2]

template<typename T>

bool isRegisteredType | ( |  | ) |

inline static

## 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()

template<typename T>

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

inline override protected virtual

Read the metadata from a stream.

Implements Metadata.

## registerType() [1/2]

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

static inherited

Register the given metadata type along with a factory function.

## registerType() [2/2]

template<typename T>

void registerType | ( |  | ) |

inline static

## setValue()

template<typename T>

void setValue | ( | const T & | val | ) |

inline

Set this metadata's value.

## size()

template<typename T>

Index32 size | ( |  | ) | const

inline override virtual

Return the size of this metadata in bytes.

Implements Metadata.

## staticTypeName()

template<typename T>

Name staticTypeName | ( |  | ) |

inline static

## str() [1/2]

std::string str | ( |  | ) | const

inline virtual

Return a textual representation of this metadata.

Implements Metadata.

## str() [2/2]

template<typename T>

std::string str | ( |  | ) | const

inline override virtual

Return a textual representation of this metadata.

Implements Metadata.

## typeName()

template<typename T>

Name typeName | ( |  | ) | const

inline override virtual

Return the type name of the metadata.

Implements Metadata.

## unregisterType() [1/2]

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

static inherited

## unregisterType() [2/2]

template<typename T>

void unregisterType | ( |  | ) |

inline static

## value() [1/2]

template<typename T>

T & value | ( |  | ) |

inline

Return this metadata's value.

## value() [2/2]

template<typename T>

const T & 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()

template<typename T>

void writeValue | ( | std::ostream & |  | ) | const

inline override protected virtual

Write the metadata to a stream.

Implements Metadata.