OpenVDB 11.0.0
Loading...
Searching...
No Matches
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.
 
 ValueBuffer (const ValueBuffer &other)
 
 ~ValueBuffer ()
 Destructor that transfers an buffered values to the parent PagedArray.
 
ValueBufferoperator= (const ValueBuffer &)=delete
 
void push_back (const ValueT &v)
 Add a value to the buffer and increment the size.
 
void flush ()
 Manually transfers the values in this buffer to the parent PagedArray.
 
PagedArrayTypeparent () const
 Return a reference to the parent PagedArray.
 
size_t size () const
 Return the current number of elements cached in this buffer.
 

Static Public Member Functions

static size_t pageSize ()
 

Member Typedef Documentation

◆ PagedArrayType

template<typename ValueT , size_t Log2PageSize = 10UL>
using PagedArrayType = PagedArray<ValueT, Log2PageSize>

Constructor & Destructor Documentation

◆ ValueBuffer() [1/2]

template<typename ValueT , size_t Log2PageSize = 10UL>
ValueBuffer ( PagedArray & parent)
inline

Constructor from a PageArray.

◆ ValueBuffer() [2/2]

template<typename ValueT , size_t Log2PageSize = 10UL>
ValueBuffer ( const ValueBuffer & other)
inline
Warning
This copy-constructor is shallow in the sense that no elements are copied, i.e. size = 0.

◆ ~ValueBuffer()

template<typename ValueT , size_t Log2PageSize = 10UL>
~ValueBuffer ( )
inline

Destructor that transfers an buffered values to the parent PagedArray.

Member Function Documentation

◆ flush()

template<typename ValueT , size_t Log2PageSize = 10UL>
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.

◆ operator=()

template<typename ValueT , size_t Log2PageSize = 10UL>
ValueBuffer & operator= ( const ValueBuffer & )
delete

◆ pageSize()

template<typename ValueT , size_t Log2PageSize = 10UL>
static size_t pageSize ( )
inlinestatic

◆ parent()

template<typename ValueT , size_t Log2PageSize = 10UL>
PagedArrayType & parent ( ) const
inline

Return a reference to the parent PagedArray.

◆ push_back()

template<typename ValueT , size_t Log2PageSize = 10UL>
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()

template<typename ValueT , size_t Log2PageSize = 10UL>
size_t size ( ) const
inline

Return the current number of elements cached in this buffer.