OpenVDB: LeafNode< T, Log2Dim >::Buffer Class Reference

OpenVDB 3.2.0

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
LeafNode< T, Log2Dim >::Buffer Class Reference

Array of fixed size that stores the voxel values of a LeafNode. More...

`#include <LeafNode.h>`

## Public Types
typedef ValueType | WordType

## Public Member Functions
| Buffer ()
| Default constructor. More...
| Buffer (const ValueType &val)
| Construct a buffer populated with the specified value. More...
| Buffer (const Buffer &other)
| Copy constructor. More...
| Buffer (PartialCreate, const ValueType &)
| Construct a buffer but don't allocate memory for the full array of values. More...
| ~Buffer ()
| Destructor. More...
bool | isOutOfCore () const
| Return `true` if this buffer's values have not yet been read from disk. More...
bool | empty () const
| Return `true` if memory for this buffer has not yet been allocated. More...
bool | allocate ()
| Allocate memory for this buffer if it has not already been allocated. More...
void | fill (const ValueType &val)
| Populate this buffer with a constant value. More...
const ValueType & | getValue (Index i) const
| Return a const reference to the i'th element of this buffer. More...
const ValueType & | operator[] (Index i) const
| Return a const reference to the i'th element of this buffer. More...
void | setValue (Index i, const ValueType &val)
| Set the i'th value of this buffer to the specified value. More...
Buffer & | operator= (const Buffer &other)
| Copy the other buffer's values into this buffer. More...
bool | operator== (const Buffer &other) const
| Return `true` if the contents of the other buffer exactly equal the contents of this buffer. More...
bool | operator!= (const Buffer &other) const
| Return `true` if the contents of the other buffer are not exactly equal to the contents of this buffer. More...
void | swap (Buffer &other)
| Exchange this buffer's values with the other buffer's values. More...
Index | memUsage () const
| Return the memory footprint of this buffer in bytes. More...
const ValueType * | data () const
| Return a const pointer to the array of voxel values. More...
ValueType * | data ()
| Return a pointer to the array of voxel values. More...

## Static Public Member Functions
static Index | size ()
| Return the number of values contained in this buffer. More...

## Static Public Attributes
static const Index | WORD_COUNT = SIZE

## Friends
class | ::TestLeaf
class | LeafNode

## Detailed Description

### template<typename T, Index Log2Dim>
class openvdb::v3_2_0::tree::LeafNode< T, Log2Dim >::Buffer

Array of fixed size that stores the voxel values of a LeafNode.

## Member Typedef Documentation

## § WordType

typedef ValueType WordType

## Constructor & Destructor Documentation

## § Buffer() [1/4]

Buffer | ( |  | ) |
| inline

Default constructor.

## § Buffer() [2/4]

Buffer | ( | const ValueType & | val | ) |
| inlineexplicit

Construct a buffer populated with the specified value.

## § Buffer() [3/4]

Buffer | ( | const Buffer & | other | ) |
| inline

Copy constructor.

## § Buffer() [4/4]

Buffer | ( | PartialCreate | ,
|  | const ValueType & |
| ) |  |
| inline

Construct a buffer but don't allocate memory for the full array of values.

## § ~Buffer()

~Buffer | ( |  | ) |
| inline

Destructor.

## Member Function Documentation

## § allocate()

bool allocate | ( |  | ) |
| inline

Allocate memory for this buffer if it has not already been allocated.

## § data() [1/2]

const ValueType* data | ( |  | ) | const
| inline

Return a const pointer to the array of voxel values.

This method guarantees that the buffer is allocated and loaded.

Warning
  This method should only be used by experts seeking low-level optimizations.

## § data() [2/2]

ValueType* data | ( |  | ) |
| inline

Return a pointer to the array of voxel values.

This method guarantees that the buffer is allocated and loaded.

Warning
  This method should only be used by experts seeking low-level optimizations.

## § empty()

bool empty | ( |  | ) | const
| inline

Return `true` if memory for this buffer has not yet been allocated.

## § fill()

void fill | ( | const ValueType & | val | ) |
| inline

Populate this buffer with a constant value.

## § getValue()

const ValueType& getValue | ( | Index | i | ) | const
| inline

Return a const reference to the i'th element of this buffer.

## § isOutOfCore()

bool isOutOfCore | ( |  | ) | const
| inline

Return `true` if this buffer's values have not yet been read from disk.

## § memUsage()

Index memUsage | ( |  | ) | const
| inline

Return the memory footprint of this buffer in bytes.

## § operator!=()

bool operator!= | ( | const Buffer & | other | ) | const
| inline

Return `true` if the contents of the other buffer are not exactly equal to the contents of this buffer.

## § operator=()

Buffer& operator= | ( | const Buffer & | other | ) |
| inline

Copy the other buffer's values into this buffer.

## § operator==()

bool operator== | ( | const Buffer & | other | ) | const
| inline

Return `true` if the contents of the other buffer exactly equal the contents of this buffer.

## § operator[]()

const ValueType& operator[] | ( | Index | i | ) | const
| inline

Return a const reference to the i'th element of this buffer.

## § setValue()

void setValue | ( | Index | i,
|  | const ValueType & | val
| ) |  |
| inline

Set the i'th value of this buffer to the specified value.

## § size()

static Index size | ( |  | ) |
| inlinestatic

Return the number of values contained in this buffer.

## § swap()

void swap | ( | Buffer & | other | ) |
| inline

Exchange this buffer's values with the other buffer's values.

## Friends And Related Function Documentation

## § ::TestLeaf

friend class ::TestLeaf
| friend

## § LeafNode

friend class LeafNode
| friend

## Member Data Documentation

## § mData

ValueType* mData

## § mFileInfo

FileInfo* mFileInfo

## § WORD_COUNT

const Index WORD_COUNT = SIZE
| static

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

- LeafNode.h