OpenVDB  9.0.1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
PagedArray< ValueT, Log2PageSize >::ValueBuffer Class Reference

#include <openvdb/util/PagedArray.h>

Public Types

using PagedArrayType = PagedArray< ValueT, Log2PageSize >
 

Public Member Functions

 ValueBuffer (PagedArray &parent)
 Constructor from a PageArray. More...
 
 ValueBuffer (const ValueBuffer &other)
 
 ~ValueBuffer ()
 Destructor that transfers an buffered values to the parent PagedArray. More...
 
ValueBufferoperator= (const ValueBuffer &)=delete
 
void push_back (const ValueT &v)
 Add a value to the buffer and increment the size. More...
 
void flush ()
 Manually transfers the values in this buffer to the parent PagedArray. More...
 
PagedArrayTypeparent () const
 Return a reference to the parent PagedArray. More...
 
size_t size () const
 Return the current number of elements cached in this buffer. More...
 

Static Public Member Functions

static size_t pageSize ()
 

Member Typedef Documentation

using PagedArrayType = PagedArray<ValueT, Log2PageSize>

Constructor & Destructor Documentation

ValueBuffer ( PagedArray parent)
inline

Constructor from a PageArray.

ValueBuffer ( const ValueBuffer other)
inline
Warning
This copy-constructor is shallow in the sense that no elements are copied, i.e. size = 0.
~ValueBuffer ( )
inline

Destructor that transfers an buffered values to the parent PagedArray.

Member Function Documentation

void flush ( )
inline

Manually transfers the values in this buffer to the parent PagedArray.

Note
This method is also called by the destructor and push_back so it should only be called if one manually wants to sync up the buffer with the array, e.g. during debugging.
ValueBuffer& operator= ( const ValueBuffer )
delete
static size_t pageSize ( )
inlinestatic
PagedArrayType& parent ( ) const
inline

Return a reference to the parent PagedArray.

void push_back ( const ValueT &  v)
inline

Add a value to the buffer and increment the size.

If the internal memory page is full it will automaically flush the page to the parent PagedArray.

size_t size ( ) const
inline

Return the current number of elements cached in this buffer.