OpenVDB: NodeManagerHandle< BufferT > Class Template Reference

OpenVDB 10.0.1

Loading...
Searching...
No Matches
Public Member Functions | List of all members
NodeManagerHandle< BufferT > Class Template Reference

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

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

## Public Member Functions
| NodeManagerHandle (BufferT &&buffer)
| Move constructor from a buffer. More...
| NodeManagerHandle ()=default
| Empty ctor. More...
| NodeManagerHandle (const NodeManagerHandle &)=delete
| Disallow copy-construction. More...
NodeManagerHandle & | operator= (const NodeManagerHandle &)=delete
| Disallow copy assignment operation. More...
NodeManagerHandle & | operator= (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...
uint8_t * | data ()
| Returns a non-const pointer to the data. More...
const uint8_t * | 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>
std::enable_if< BufferTraits< U >::hasDeviceDual, constNodeManager< 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>
std::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>
std::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>
std::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() [1/4]

NodeManagerHandle | ( | BufferT && | buffer | ) |
| inline

Move constructor from a buffer.

## ◆ NodeManagerHandle() [2/4]

NodeManagerHandle | ( |  | ) |
| default

Empty ctor.

## ◆ NodeManagerHandle() [3/4]

NodeManagerHandle | ( | const NodeManagerHandle< BufferT > & |  | ) |
| delete

Disallow copy-construction.

## ◆ NodeManagerHandle() [4/4]

NodeManagerHandle | ( | NodeManagerHandle< BufferT > && | other | ) |
| inlinenoexcept

Move copy-constructor.

## ◆ ~NodeManagerHandle()

~NodeManagerHandle | ( |  | ) |
| inline

Default destructor.

## Member Function Documentation

## ◆ buffer() [1/2]

BufferT & buffer | ( |  | ) |
| inline

Return a reference to the buffer.

## ◆ buffer() [2/2]

const BufferT & buffer | ( |  | ) | const
| inline

Return a const reference to the buffer.

## ◆ data() [1/2]

uint8_t * 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

## ◆ data() [2/2]

const uint8_t * 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

## ◆ deviceDownload()

std::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

## ◆ deviceMgr() [1/2]

std::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!

## ◆ deviceMgr() [2/2]

std::enable_if< BufferTraits< U >::hasDeviceDual, constNodeManager< 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!

## ◆ deviceUpload()

std::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

## ◆ mgr() [1/2]

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!

## ◆ mgr() [2/2]

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!

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

NodeManagerHandle & operator= | ( | const NodeManagerHandle< BufferT > & |  | ) |
| delete

Disallow copy assignment operation.

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

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

Move copy assignment operation.

## ◆ reset()

void reset | ( |  | ) |
| inline

clear the buffer

## ◆ size()

uint64_t size | ( |  | ) | const
| inline

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