Ptex

Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
PtexHashMap< Key, Value > Class Template Reference

`#include <PtexHashMap.h>`

## Classes
class | Entry

## Public Member Functions
| PtexHashMap ()
| ~PtexHashMap ()
void | clear ()
uint32_t | size () const
Value | get (Key &key)
Value | tryInsert (Key &key, Value value, size_t &newMemUsed)
template<typename Fn >
void | foreach (Fn &fn)

## Private Member Functions
| PtexHashMap (const PtexHashMap &)
void | operator= (const PtexHashMap &)
void | initContents ()
void | deleteContents ()
Entry * | getEntries ()
Entry * | lockEntries ()
void | unlockEntries (Entry *entries)
Entry * | lockEntriesAndGrowIfNeeded (size_t &newMemUsed)
Entry * | grow (Entry *oldEntries, size_t &newMemUsed)

## Private Attributes
Entry *volatile | _entries
uint32_t volatile | _numEntries
uint32_t volatile | _size
std::vector< Entry * > | _oldEntries

## Detailed Description

### template<typename Key, typename Value>
class PtexHashMap< Key, Value >

Definition at line 151 of file PtexHashMap.h.

## Constructor & Destructor Documentation

## ◆ PtexHashMap() [1/2]

template<typename Key , typename Value >

PtexHashMap< Key, Value >::PtexHashMap | ( | const PtexHashMap< Key, Value > & |  | ) |
| private

## ◆ PtexHashMap() [2/2]

template<typename Key , typename Value >

PtexHashMap< Key, Value >::PtexHashMap | ( |  | ) |
| inline

Definition at line 185 of file PtexHashMap.h.

## ◆ ~PtexHashMap()

template<typename Key , typename Value >

PtexHashMap< Key, Value >::~PtexHashMap | ( |  | ) |
| inline

Definition at line 190 of file PtexHashMap.h.

## Member Function Documentation

## ◆ clear()

template<typename Key , typename Value >

void PtexHashMap< Key, Value >::clear | ( |  | ) |
| inline

Definition at line 195 of file PtexHashMap.h.

Referenced by PtexReader::prune().

## ◆ deleteContents()

template<typename Key , typename Value >

void PtexHashMap< Key, Value >::deleteContents | ( |  | ) |
| inline private

Definition at line 172 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::clear(), and PtexHashMap< StringKey, PtexCachedReader * >::~PtexHashMap().

## ◆ foreach()

template<typename Key , typename Value >
template<typename Fn >

void PtexHashMap< Key, Value >::foreach | ( | Fn & | fn | ) |
| inline

Definition at line 252 of file PtexHashMap.h.

Referenced by PtexReaderCache::purgeAll().

## ◆ get()

template<typename Key , typename Value >

Value PtexHashMap< Key, Value >::get | ( | Key & | key | ) |
| inline

Definition at line 203 of file PtexHashMap.h.

Referenced by PtexReaderCache::get(), PtexReader::getData(), and PtexReaderCache::purge().

## ◆ getEntries()

template<typename Key , typename Value >

Entry* PtexHashMap< Key, Value >::getEntries | ( |  | ) |
| inline private

Definition at line 262 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::foreach(), and PtexHashMap< StringKey, PtexCachedReader * >::get().

## ◆ grow()

template<typename Key , typename Value >

Entry* PtexHashMap< Key, Value >::grow | ( | Entry * | oldEntries,
|  | size_t & | newMemUsed
| ) |  |
| inline private

Definition at line 294 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::lockEntriesAndGrowIfNeeded().

## ◆ initContents()

template<typename Key , typename Value >

void PtexHashMap< Key, Value >::initContents | ( |  | ) |
| inline private

Definition at line 165 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::clear(), and PtexHashMap< StringKey, PtexCachedReader * >::PtexHashMap().

## ◆ lockEntries()

template<typename Key , typename Value >

Entry* PtexHashMap< Key, Value >::lockEntries | ( |  | ) |
| inline private

Definition at line 270 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::lockEntriesAndGrowIfNeeded().

## ◆ lockEntriesAndGrowIfNeeded()

template<typename Key , typename Value >

Entry* PtexHashMap< Key, Value >::lockEntriesAndGrowIfNeeded | ( | size_t & | newMemUsed | ) |
| inline private

Definition at line 285 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::tryInsert().

## ◆ operator=()

template<typename Key , typename Value >

void PtexHashMap< Key, Value >::operator= | ( | const PtexHashMap< Key, Value > & |  | ) |
| private

## ◆ size()

template<typename Key , typename Value >

uint32_t PtexHashMap< Key, Value >::size | ( |  | ) | const
| inline

Definition at line 201 of file PtexHashMap.h.

Referenced by PtexReaderCache::getStats().

## ◆ tryInsert()

template<typename Key , typename Value >

Value PtexHashMap< Key, Value >::tryInsert | ( | Key & | key,
|  | Value | value,
|  | size_t & | newMemUsed
| ) |  |
| inline

Definition at line 224 of file PtexHashMap.h.

Referenced by PtexReaderCache::get(), and PtexReader::getData().

## ◆ unlockEntries()

template<typename Key , typename Value >

void PtexHashMap< Key, Value >::unlockEntries | ( | Entry * | entries | ) |
| inline private

Definition at line 280 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::tryInsert().

## Member Data Documentation

## ◆ _entries

template<typename Key , typename Value >

Entry* volatile PtexHashMap< Key, Value >::_entries
| private

Definition at line 318 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::deleteContents(), PtexHashMap< StringKey, PtexCachedReader * >::getEntries(), PtexHashMap< StringKey, PtexCachedReader * >::initContents(), PtexHashMap< StringKey, PtexCachedReader * >::lockEntries(), and PtexHashMap< StringKey, PtexCachedReader * >::unlockEntries().

## ◆ _numEntries

template<typename Key , typename Value >

uint32_t volatile PtexHashMap< Key, Value >::_numEntries
| private

Definition at line 319 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::deleteContents(), PtexHashMap< StringKey, PtexCachedReader * >::foreach(), PtexHashMap< StringKey, PtexCachedReader * >::get(), PtexHashMap< StringKey, PtexCachedReader * >::grow(), PtexHashMap< StringKey, PtexCachedReader * >::initContents(), PtexHashMap< StringKey, PtexCachedReader * >::lockEntriesAndGrowIfNeeded(), and PtexHashMap< StringKey, PtexCachedReader * >::tryInsert().

## ◆ _oldEntries

template<typename Key , typename Value >

std::vector<Entry*> PtexHashMap< Key, Value >::_oldEntries
| private

Definition at line 321 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::deleteContents(), and PtexHashMap< StringKey, PtexCachedReader * >::grow().

## ◆ _size

template<typename Key , typename Value >

uint32_t volatile PtexHashMap< Key, Value >::_size
| private

Definition at line 320 of file PtexHashMap.h.

Referenced by PtexHashMap< StringKey, PtexCachedReader * >::initContents(), PtexHashMap< StringKey, PtexCachedReader * >::lockEntriesAndGrowIfNeeded(), PtexHashMap< StringKey, PtexCachedReader * >::size(), and PtexHashMap< StringKey, PtexCachedReader * >::tryInsert().

The documentation for this class was generated from the following file:

- PtexHashMap.h