Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | List of all members
arrow::PoolBuffer Class Reference

A Buffer whose lifetime is tied to a particular MemoryPool. More...

#include <arrow/buffer.h>

Inheritance diagram for arrow::PoolBuffer:
arrow::ResizableBuffer arrow::MutableBuffer arrow::Buffer

Public Member Functions

 PoolBuffer (MemoryPool *pool=NULLPTR)
 
virtual ~PoolBuffer ()
 
Status Resize (const int64_t new_size, bool shrink_to_fit=true) override
 Change buffer reported size to indicated size, allocating memory if necessary. More...
 
Status Reserve (const int64_t new_capacity) override
 Ensure that buffer has enough memory allocated to fit the indicated capacity (and meets the 64 byte padding requirement in Layout.md). More...
 
- Public Member Functions inherited from arrow::ResizableBuffer
template<class T >
Status TypedResize (const int64_t new_nb_elements, bool shrink_to_fit=true)
 
template<class T >
Status TypedReserve (const int64_t new_nb_elements)
 
- Public Member Functions inherited from arrow::MutableBuffer
 MutableBuffer (uint8_t *data, const int64_t size)
 
 MutableBuffer (const std::shared_ptr< Buffer > &parent, const int64_t offset, const int64_t size)
 
- Public Member Functions inherited from arrow::Buffer
 Buffer (const uint8_t *data, int64_t size)
 Construct from buffer and size without copying memory. More...
 
 Buffer (const std::string &data)
 Construct from std::string without copying memory. More...
 
virtual ~Buffer ()=default
 
 Buffer (const std::shared_ptr< Buffer > &parent, const int64_t offset, const int64_t size)
 An offset into data that is owned by another buffer, but we want to be able to retain a valid pointer to it even after other shared_ptr's to the parent buffer have been destroyed. More...
 
bool is_mutable () const
 
bool Equals (const Buffer &other, int64_t nbytes) const
 Return true if both buffers are the same size and contain the same bytes up to the number of compared bytes. More...
 
bool Equals (const Buffer &other) const
 Return true if both buffers are the same size and contain the same bytes. More...
 
Status Copy (const int64_t start, const int64_t nbytes, MemoryPool *pool, std::shared_ptr< Buffer > *out) const
 Copy a section of the buffer into a new Buffer. More...
 
Status Copy (const int64_t start, const int64_t nbytes, std::shared_ptr< Buffer > *out) const
 Copy a section of the buffer using the default memory pool into a new Buffer. More...
 
int64_t capacity () const
 
const uint8_t * data () const
 
uint8_t * mutable_data ()
 
int64_t size () const
 
std::shared_ptr< Bufferparent () const
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::ResizableBuffer
 ResizableBuffer (uint8_t *data, int64_t size)
 
- Protected Member Functions inherited from arrow::MutableBuffer
 MutableBuffer ()
 
- Protected Attributes inherited from arrow::Buffer
bool is_mutable_
 
const uint8_t * data_
 
uint8_t * mutable_data_
 
int64_t size_
 
int64_t capacity_
 
std::shared_ptr< Bufferparent_
 

Detailed Description

A Buffer whose lifetime is tied to a particular MemoryPool.

Constructor & Destructor Documentation

◆ PoolBuffer()

arrow::PoolBuffer::PoolBuffer ( MemoryPool pool = NULLPTR)
explicit

◆ ~PoolBuffer()

virtual arrow::PoolBuffer::~PoolBuffer ( )
virtual

Member Function Documentation

◆ Reserve()

Status arrow::PoolBuffer::Reserve ( const int64_t  new_capacity)
overridevirtual

Ensure that buffer has enough memory allocated to fit the indicated capacity (and meets the 64 byte padding requirement in Layout.md).

It does not change buffer's reported size.

Implements arrow::ResizableBuffer.

◆ Resize()

Status arrow::PoolBuffer::Resize ( const int64_t  new_size,
bool  shrink_to_fit = true 
)
overridevirtual

Change buffer reported size to indicated size, allocating memory if necessary.

This will ensure that the capacity of the buffer is a multiple of 64 bytes as defined in Layout.md.

Parameters
shrink_to_fitOn deactivating this option, the capacity of the Buffer won't decrease.

Implements arrow::ResizableBuffer.


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