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

#include <arrow/buffer.h>

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

Public Member Functions

virtual Status Resize (const int64_t new_size, bool shrink_to_fit=true)=0
 Change buffer reported size to indicated size, allocating memory if necessary. More...
 
virtual Status Reserve (const int64_t new_capacity)=0
 Ensure that buffer has enough memory allocated to fit the indicated capacity (and meets the 64 byte padding requirement in Layout.md). More...
 
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
 

Protected Member Functions

 ResizableBuffer (uint8_t *data, int64_t size)
 
- Protected Member Functions inherited from arrow::MutableBuffer
 MutableBuffer ()
 

Additional Inherited Members

- 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_
 

Constructor & Destructor Documentation

◆ ResizableBuffer()

arrow::ResizableBuffer::ResizableBuffer ( uint8_t *  data,
int64_t  size 
)
inlineprotected

Member Function Documentation

◆ Reserve()

virtual Status arrow::ResizableBuffer::Reserve ( const int64_t  new_capacity)
pure virtual

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.

Implemented in arrow::PoolBuffer.

◆ Resize()

virtual Status arrow::ResizableBuffer::Resize ( const int64_t  new_size,
bool  shrink_to_fit = true 
)
pure virtual

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.

Implemented in arrow::PoolBuffer.

◆ TypedReserve()

template<class T >
Status arrow::ResizableBuffer::TypedReserve ( const int64_t  new_nb_elements)
inline

◆ TypedResize()

template<class T >
Status arrow::ResizableBuffer::TypedResize ( const int64_t  new_nb_elements,
bool  shrink_to_fit = true 
)
inline

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