OpenVDB  12.0.0
Public Member Functions | List of all members
NodeManagerHandle< BufferT > Class Template Reference

NodeManagerHandle manages the memory of a NodeManager. More...

#include <nanovdb/NodeManager.h>

Public Member Functions

 NodeManagerHandle (GridType gridType, BufferT &&buffer)
 Move constructor from a buffer. More...
 
 NodeManagerHandle ()=default
 Empty ctor. More...
 
 NodeManagerHandle (const NodeManagerHandle &)=delete
 Disallow copy-construction. More...
 
NodeManagerHandleoperator= (const NodeManagerHandle &)=delete
 Disallow copy assignment operation. More...
 
NodeManagerHandleoperator= (NodeManagerHandle &&other) noexcept
 Move copy assignment operation. More...
 
 NodeManagerHandle (NodeManagerHandle &&other) noexcept
 Move copy-constructor. More...
 
 ~NodeManagerHandle ()
 Default destructor. More...
 
void reset ()
 clear the buffer More...
 
BufferT & buffer ()
 Return a reference to the buffer. More...
 
const BufferT & buffer () const
 Return a const reference to the buffer. More...
 
void * data ()
 Returns a non-const pointer to the data. More...
 
const void * data () const
 Returns a const pointer to the data. More...
 
uint64_t size () const
 Returns the size in bytes of the raw memory buffer managed by this NodeManagerHandle's allocator. More...
 
template<typename BuildT >
const NodeManager< BuildT > * mgr () const
 Returns a const pointer to the NodeManager encoded in this NodeManagerHandle. More...
 
template<typename BuildT >
NodeManager< BuildT > * mgr ()
 Returns a pointer to the NodeManager encoded in this NodeManagerHandle. More...
 
template<typename BuildT , typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, const NodeManager< BuildT > * >::type deviceMgr () const
 Return a const pointer to the NodeManager encoded in this NodeManagerHandle on the device, e.g. GPU. More...
 
template<typename BuildT , typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, NodeManager< BuildT > * >::type deviceMgr ()
 Return a const pointer to the NodeManager encoded in this NodeManagerHandle on the device, e.g. GPU. More...
 
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type deviceUpload (void *deviceGrid, void *stream=nullptr, bool sync=true)
 Upload the NodeManager to the device, e.g. from CPU to GPU. More...
 
template<typename U = BufferT>
util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type deviceDownload (void *stream=nullptr, bool sync=true)
 Download the NodeManager to from the device, e.g. from GPU to CPU. More...
 

Detailed Description

template<typename BufferT>
class nanovdb::NodeManagerHandle< BufferT >

NodeManagerHandle manages the memory of a NodeManager.

This class serves to manage a raw memory buffer of a NanoVDB NodeManager or LeafManager.

Constructor & Destructor Documentation

NodeManagerHandle ( GridType  gridType,
BufferT &&  buffer 
)
inline

Move constructor from a buffer.

NodeManagerHandle ( )
default

Empty ctor.

NodeManagerHandle ( const NodeManagerHandle< BufferT > &  )
delete

Disallow copy-construction.

NodeManagerHandle ( NodeManagerHandle< BufferT > &&  other)
inlinenoexcept

Move copy-constructor.

~NodeManagerHandle ( )
inline

Default destructor.

Member Function Documentation

BufferT& buffer ( )
inline

Return a reference to the buffer.

const BufferT& buffer ( ) const
inline

Return a const reference to the buffer.

void* data ( )
inline

Returns a non-const pointer to the data.

Warning
Note that the return pointer can be NULL if the NodeManagerHandle was not initialized
const void* data ( ) const
inline

Returns a const pointer to the data.

Warning
Note that the return pointer can be NULL if the NodeManagerHandle was not initialized
util::enable_if<BufferTraits<U>::hasDeviceDual, void>::type deviceDownload ( void *  stream = nullptr,
bool  sync = true 
)
inline

Download the NodeManager to from the device, e.g. from GPU to CPU.

Note
This method is only available if the buffer supports devices
util::enable_if<BufferTraits<U>::hasDeviceDual, const NodeManager<BuildT>*>::type deviceMgr ( ) const
inline

Return a const pointer to the NodeManager encoded in this NodeManagerHandle on the device, e.g. GPU.

Warning
Note that the return pointer can be NULL if the template parameter does not match the specified grid!
util::enable_if<BufferTraits<U>::hasDeviceDual, NodeManager<BuildT>*>::type deviceMgr ( )
inline

Return a const pointer to the NodeManager encoded in this NodeManagerHandle on the device, e.g. GPU.

Warning
Note that the return pointer can be NULL if the template parameter does not match the specified grid!
util::enable_if<BufferTraits<U>::hasDeviceDual, void>::type deviceUpload ( void *  deviceGrid,
void *  stream = nullptr,
bool  sync = true 
)
inline

Upload the NodeManager to the device, e.g. from CPU to GPU.

Note
This method is only available if the buffer supports devices
const NodeManager<BuildT>* mgr ( ) const
inline

Returns a const pointer to the NodeManager encoded in this NodeManagerHandle.

Warning
Note that the return pointer can be NULL if the template parameter does not match the specified grid!
NodeManager<BuildT>* mgr ( )
inline

Returns a pointer to the NodeManager encoded in this NodeManagerHandle.

Warning
Note that the return pointer can be NULL if the template parameter does not match the specified grid!
NodeManagerHandle& operator= ( const NodeManagerHandle< BufferT > &  )
delete

Disallow copy assignment operation.

NodeManagerHandle& operator= ( NodeManagerHandle< BufferT > &&  other)
inlinenoexcept

Move copy assignment operation.

void reset ( )
inline

clear the buffer

uint64_t size ( ) const
inline

Returns the size in bytes of the raw memory buffer managed by this NodeManagerHandle's allocator.