OpenVDB: StringMetaInserter Class Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
StringMetaInserter Class Reference

Class to help with insertion of keyed string values into metadata. More...

`#include <openvdb/points/AttributeArrayString.h>`

## Public Types
using | UniquePtr = std::unique_ptr<StringMetaInserter>

## Public Member Functions
| StringMetaInserter (MetaMap &metadata)
bool | hasKey (const Name &key) const
| Returns `true` if key exists.
bool | hasIndex (Index index) const
| Returns `true` if index exists.
Index | insert (const Name &name, Index hint=Index(0))
| Insert the string into the metadata using the hint if non-zero.
void | resetCache ()
| Reset the cache from the metadata.

## Detailed Description

Class to help with insertion of keyed string values into metadata.

## Member Typedef Documentation

## ◆ UniquePtr

using UniquePtr = std::unique_ptr<StringMetaInserter>

## Constructor & Destructor Documentation

## ◆ StringMetaInserter()

StringMetaInserter | ( | MetaMap & | metadata | ) |
| explicit

## Member Function Documentation

## ◆ hasIndex()

bool hasIndex | ( | Index | index | ) | const

Returns `true` if index exists.

## ◆ hasKey()

bool hasKey | ( | const Name & | key | ) | const

Returns `true` if key exists.

## ◆ insert()

Index insert | ( | const Name & | name,
|  | Index | hint = Index(0) )

Insert the string into the metadata using the hint if non-zero.

Parameters

  name | the string to insert
  hint | requested index to use if non-zero and not already in use

Note
  the hint can be used to insert non-sequentially so as to avoid an expensive re-indexing of string keys

Returns
  the chosen index which will match hint if the hint was used

## ◆ resetCache()

void resetCache | ( |  | ) |

Reset the cache from the metadata.