OpenVDB: HostBuffer::Pool Struct Reference

OpenVDB 10.0.1

Public Types | Public Member Functions | Public Attributes | List of all members
HostBuffer::Pool Struct Reference

`#include <nanovdb/util/HostBuffer.h>`

## Public Types
using | HashTableT = std::unordered_set< HostBuffer * >

## Public Member Functions
| Pool (uint64_t size=0, void *data=nullptr)
| External memory ctor. More...
| ~Pool ()
| Custom destructor. More...
| Pool (const Pool &)=delete
| Disallow copy-construction. More...
| Pool (const Pool &&)=delete
| Disallow move-construction. More...
Pool & | operator= (const Pool &)=delete
| Disallow copy assignment operation. More...
Pool & | operator= (const Pool &&)=delete
| Disallow move assignment operation. More...
uint64_t | usage () const
| Return the total number of bytes used from this Pool by buffers. More...
void | add (HostBuffer *buffer, uint64_t size)
| Allocate a buffer of the specified size and add it to the register. More...
void | remove (HostBuffer *buffer)
| Remove the specified buffer from the register. More...
void | replace (HostBuffer *buffer1, HostBuffer *buffer2)
| Replaces buffer1 with buffer2 in the register. More...
void | reset ()
| Reset the register and all its buffers. More...
void | resize (uint64_t size, void *data=nullptr)
| Resize this Pool and update registered buffers as needed. If data is no NULL it is used as externally managed memory. More...
bool | isFull () const
| Return true is all the memory in this pool is in use. More...

## Public Attributes
std::mutex | mMutex
HashTableT | mRegister
uint8_t * | mData
uint8_t * | mFree
uint64_t | mSize
uint64_t | mPadding
bool | mManaged

## Member Typedef Documentation

## ◆ HashTableT

using HashTableT = std::unordered_set<HostBuffer*>

## Constructor & Destructor Documentation

## ◆ Pool() [1/3]

Pool | ( | uint64_t | size = `0`,
|  | void * | data = `nullptr`
| ) |  |
| inline

External memory ctor.

## ◆ ~Pool()

~Pool | ( |  | ) |
| inline

Custom destructor.

## ◆ Pool() [2/3]

Pool | ( | const Pool & |  | ) |
| delete

Disallow copy-construction.

## ◆ Pool() [3/3]

Pool | ( | const Pool && |  | ) |
| delete

Disallow move-construction.

## Member Function Documentation

## ◆ add()

void add | ( | HostBuffer * | buffer,
|  | uint64_t | size
| ) |  |
| inline

Allocate a buffer of the specified size and add it to the register.

## ◆ isFull()

bool isFull | ( |  | ) | const
| inline

Return true is all the memory in this pool is in use.

## ◆ operator=() [1/2]

Pool & operator= | ( | const Pool && |  | ) |
| delete

Disallow move assignment operation.

## ◆ operator=() [2/2]

Pool & operator= | ( | const Pool & |  | ) |
| delete

Disallow copy assignment operation.

## ◆ remove()

void remove | ( | HostBuffer * | buffer | ) |
| inline

Remove the specified buffer from the register.

## ◆ replace()

void replace | ( | HostBuffer * | buffer1,
|  | HostBuffer * | buffer2
| ) |  |
| inline

Replaces buffer1 with buffer2 in the register.

## ◆ reset()

void reset | ( |  | ) |
| inline

Reset the register and all its buffers.

## ◆ resize()

void resize | ( | uint64_t | size,
|  | void * | data = `nullptr`
| ) |  |
| inline

Resize this Pool and update registered buffers as needed. If data is no NULL it is used as externally managed memory.

## ◆ usage()

uint64_t usage | ( |  | ) | const
| inline

Return the total number of bytes used from this Pool by buffers.

## Member Data Documentation

## ◆ mData

uint8_t* mData

## ◆ mFree

uint8_t* mFree

## ◆ mManaged

bool mManaged

## ◆ mMutex

std::mutex mMutex

## ◆ mPadding

uint64_t mPadding

## ◆ mRegister

HashTableT mRegister

## ◆ mSize

uint64_t mSize