OpenVDB: StringMetaCache Class Reference

OpenVDB 9.1.0

Public Types | Public Member Functions | List of all members
StringMetaCache Class Reference

Class to compute a string->index map from all string:N metadata. More...

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

## Public Types
using | UniquePtr = std::unique_ptr< StringMetaCache >
using | ValueMap = std::unordered_map< Name, Index >

## Public Member Functions
| StringMetaCache ()=default
| StringMetaCache (const MetaMap &metadata)
bool | empty () const
| Return `true` if no string elements in metadata. More...
size_t | size () const
| Returns the number of string elements in metadata. More...
void | reset (const MetaMap &metadata)
| Clears and re-populates the cache. More...
void | insert (const Name &key, Index index)
| Insert a new element in the cache. More...
const ValueMap & | map () const
| Retrieve the value map (string -> index) More...

## Detailed Description

Class to compute a string->index map from all string:N metadata.

## Member Typedef Documentation

## ◆ UniquePtr

using UniquePtr = std::unique_ptr<StringMetaCache>

## ◆ ValueMap

using ValueMap = std::unordered_map<Name, Index>

## Constructor & Destructor Documentation

## ◆ StringMetaCache() [1/2]

StringMetaCache | ( |  | ) |
| default

## ◆ StringMetaCache() [2/2]

StringMetaCache | ( | const MetaMap & | metadata | ) |
| explicit

## Member Function Documentation

## ◆ empty()

bool empty | ( |  | ) | const
| inline

Return `true` if no string elements in metadata.

## ◆ insert()

void insert | ( | const Name & | key,
|  | Index | index
| ) |  |

Insert a new element in the cache.

## ◆ map()

const ValueMap & map | ( |  | ) | const
| inline

Retrieve the value map (string -> index)

## ◆ reset()

void reset | ( | const MetaMap & | metadata | ) |

Clears and re-populates the cache.

## ◆ size()

size_t size | ( |  | ) | const
| inline

Returns the number of string elements in metadata.