OpenVDB 11.0.0

Loading...
Searching...
No Matches
DelayedLoadMetadata Class Reference

Store a buffer of data that can be optionally used during reading for faster delayed-load I/O performance. More...

`#include <openvdb/io/DelayedLoadMetadata.h>`

Inheritance diagram for DelayedLoadMetadata:

## Public Types
using | Ptr = SharedPtr<DelayedLoadMetadata>
using | ConstPtr = SharedPtr<const DelayedLoadMetadata>
using | MaskType = int8_t
using | CompressedSizeType = int64_t

## Public Member Functions
| DelayedLoadMetadata ()=default
| DelayedLoadMetadata (const DelayedLoadMetadata &other)
| ~DelayedLoadMetadata () override=default
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 | clear ()
| Delete the contents of the mask and compressed size arrays.
bool | empty () const
| Return `true` if both arrays are empty.
void | resizeMask (size_t size)
| Resize the mask array.
void | resizeCompressedSize (size_t size)
| Resize the compressed size array.
MaskType | getMask (size_t index) const
| Return the mask value for a specific index.
void | setMask (size_t index, const MaskType &value)
| Set the mask value for a specific index.
CompressedSizeType | getCompressedSize (size_t index) const
| Return the compressed size value for a specific index.
void | setCompressedSize (size_t index, const CompressedSizeType &value)
| Set the compressed size value for a specific index.
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 ()
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

Store a buffer of data that can be optionally used during reading for faster delayed-load I/O performance.

## Member Typedef Documentation

## ◆ CompressedSizeType

using CompressedSizeType = int64_t

## ◆ ConstPtr

using ConstPtr = SharedPtr<const DelayedLoadMetadata>

## ◆ MaskType

using MaskType = int8_t

## ◆ Ptr

using Ptr = SharedPtr<DelayedLoadMetadata>

## Constructor & Destructor Documentation

## ◆ DelayedLoadMetadata() [1/2]

DelayedLoadMetadata | ( |  | ) |
| default

## ◆ DelayedLoadMetadata() [2/2]

DelayedLoadMetadata | ( | const DelayedLoadMetadata & | other | ) |

## ◆ ~DelayedLoadMetadata()

~DelayedLoadMetadata | ( |  | ) |
| override default

## Member Function Documentation

## ◆ asBool()

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

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

Implements Metadata.

## ◆ clear()

void clear | ( |  | ) |

Delete the contents of the mask and compressed size arrays.

## ◆ 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() [1/2]

Metadata::Ptr createMetadata | ( |  | ) |
| inline static

## ◆ createMetadata() [2/2]

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

Create new metadata of the given type.

## ◆ empty()

bool empty | ( |  | ) | const

Return `true` if both arrays are empty.

## ◆ getCompressedSize()

CompressedSizeType getCompressedSize | ( | size_t | index | ) | const

Return the compressed size value for a specific index.

Note
  throws if index is out-of-range or DelayedLoadMask not registered

## ◆ getMask()

MaskType getMask | ( | size_t | index | ) | const

Return the mask value for a specific index.

Note
  throws if index is out-of-range or DelayedLoadMask not registered

## ◆ isRegisteredType() [1/2]

bool isRegisteredType | ( |  | ) |
| inline static

## ◆ isRegisteredType() [2/2]

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() [1/2]

void registerType | ( |  | ) |
| inline static

## ◆ registerType() [2/2]

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

Register the given metadata type along with a factory function.

## ◆ resizeCompressedSize()

void resizeCompressedSize | ( | size_t | size | ) |

Resize the compressed size array.

## ◆ resizeMask()

void resizeMask | ( | size_t | size | ) |

Resize the mask array.

## ◆ setCompressedSize()

void setCompressedSize | ( | size_t | index,
|  | const CompressedSizeType & | value )

Set the compressed size value for a specific index.

Note
  throws if index is out-of-range

## ◆ setMask()

void setMask | ( | size_t | index,
|  | const MaskType & | value )

Set the mask value for a specific index.

Note
  throws if index is out-of-range

## ◆ size()

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

Return the size of this metadata in bytes.

Implements Metadata.

## ◆ staticTypeName()

Name staticTypeName | ( |  | ) |
| inline static

## ◆ str()

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

Return a textual representation of this metadata.

Implements Metadata.

## ◆ typeName()

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

Return the type name of the metadata.

Implements Metadata.

## ◆ unregisterType() [1/2]

void unregisterType | ( |  | ) |
| inline static

## ◆ unregisterType() [2/2]

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

## ◆ 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.