HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::HostBuffer::Pool Struct Reference

#include <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...
 
Pooloperator= (const Pool &)=delete
 Disallow copy assignment operation. More...
 
Pooloperator= (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
 

Detailed Description

Definition at line 254 of file HostBuffer.h.

Member Typedef Documentation

using nanovdb::HostBuffer::Pool::HashTableT = std::unordered_set<HostBuffer*>

Definition at line 256 of file HostBuffer.h.

Constructor & Destructor Documentation

nanovdb::HostBuffer::Pool::Pool ( uint64_t  size = 0,
void data = nullptr 
)
inline

External memory ctor.

Definition at line 266 of file HostBuffer.h.

nanovdb::HostBuffer::Pool::~Pool ( )
inline

Custom destructor.

Definition at line 289 of file HostBuffer.h.

nanovdb::HostBuffer::Pool::Pool ( const Pool )
delete

Disallow copy-construction.

nanovdb::HostBuffer::Pool::Pool ( const Pool &&  )
delete

Disallow move-construction.

Member Function Documentation

void nanovdb::HostBuffer::Pool::add ( HostBuffer buffer,
uint64_t  size 
)
inline

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

Definition at line 313 of file HostBuffer.h.

bool nanovdb::HostBuffer::Pool::isFull ( ) const
inline

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

Definition at line 412 of file HostBuffer.h.

Pool& nanovdb::HostBuffer::Pool::operator= ( const Pool )
delete

Disallow copy assignment operation.

Pool& nanovdb::HostBuffer::Pool::operator= ( const Pool &&  )
delete

Disallow move assignment operation.

void nanovdb::HostBuffer::Pool::remove ( HostBuffer buffer)
inline

Remove the specified buffer from the register.

Definition at line 336 of file HostBuffer.h.

void nanovdb::HostBuffer::Pool::replace ( HostBuffer buffer1,
HostBuffer buffer2 
)
inline

Replaces buffer1 with buffer2 in the register.

Definition at line 343 of file HostBuffer.h.

void nanovdb::HostBuffer::Pool::reset ( )
inline

Reset the register and all its buffers.

Definition at line 351 of file HostBuffer.h.

void nanovdb::HostBuffer::Pool::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.

Definition at line 364 of file HostBuffer.h.

uint64_t nanovdb::HostBuffer::Pool::usage ( ) const
inline

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

Definition at line 310 of file HostBuffer.h.

Member Data Documentation

uint8_t* nanovdb::HostBuffer::Pool::mData

Definition at line 259 of file HostBuffer.h.

uint8_t* nanovdb::HostBuffer::Pool::mFree

Definition at line 260 of file HostBuffer.h.

bool nanovdb::HostBuffer::Pool::mManaged

Definition at line 263 of file HostBuffer.h.

std::mutex nanovdb::HostBuffer::Pool::mMutex

Definition at line 257 of file HostBuffer.h.

uint64_t nanovdb::HostBuffer::Pool::mPadding

Definition at line 262 of file HostBuffer.h.

HashTableT nanovdb::HostBuffer::Pool::mRegister

Definition at line 258 of file HostBuffer.h.

uint64_t nanovdb::HostBuffer::Pool::mSize

Definition at line 261 of file HostBuffer.h.


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