Project
Loading...
Searching...
No Matches
o2::framework::PreallocatedOutputStream Class Reference

#include <EmptyFragment.h>

Inherits arrow::io::OutputStream.

Public Member Functions

 PreallocatedOutputStream (std::vector< size_t > &sizes, const std::shared_ptr< arrow::ResizableBuffer > &buffer)
 
 ~PreallocatedOutputStream () override=default
 
arrow::Status Close () override
 Close the stream, preserving the buffer (retrieve it with Finish()).
 
bool closed () const override
 
arrow::Result< int64_t > Tell () const override
 
arrow::Status Write (const void *data, int64_t nbytes) override
 
arrow::Result< std::shared_ptr< arrow::Buffer > > Finish ()
 Close the stream and return the buffer.
 
arrow::Status Reset (std::vector< size_t > sizes, int64_t initial_capacity, arrow::MemoryPool *pool)
 Initialize state of OutputStream with newly allocated memory and set position to 0.
 
int64_t capacity () const
 

Static Public Member Functions

static arrow::Result< std::shared_ptr< PreallocatedOutputStream > > Create (std::vector< size_t > &sizes, int64_t initial_capacity=4096, arrow::MemoryPool *pool=arrow::default_memory_pool())
 Create in-memory output stream with indicated capacity using a memory pool.
 

Detailed Description

An OutputStream which does the reading of the input buffers directly on writing, if needed. Each deferred operation is encoded in the source buffer by an incremental number which can be used to lookup in the ops vector the operation to perform.

Definition at line 54 of file EmptyFragment.h.

Constructor & Destructor Documentation

◆ PreallocatedOutputStream()

o2::framework::PreallocatedOutputStream::PreallocatedOutputStream ( std::vector< size_t > &  sizes,
const std::shared_ptr< arrow::ResizableBuffer > &  buffer 
)
explicit

Definition at line 58 of file EmptyFragment.cxx.

◆ ~PreallocatedOutputStream()

o2::framework::PreallocatedOutputStream::~PreallocatedOutputStream ( )
overridedefault

Member Function Documentation

◆ capacity()

int64_t o2::framework::PreallocatedOutputStream::capacity ( ) const
inline

Definition at line 99 of file EmptyFragment.h.

◆ Close()

arrow::Status o2::framework::PreallocatedOutputStream::Close ( )
override

Close the stream, preserving the buffer (retrieve it with Finish()).

Definition at line 89 of file EmptyFragment.cxx.

◆ closed()

bool o2::framework::PreallocatedOutputStream::closed ( ) const
override

Definition at line 100 of file EmptyFragment.cxx.

◆ Create()

arrow::Result< std::shared_ptr< PreallocatedOutputStream > > o2::framework::PreallocatedOutputStream::Create ( std::vector< size_t > &  sizes,
int64_t  initial_capacity = 4096,
arrow::MemoryPool *  pool = arrow::default_memory_pool() 
)
static

Create in-memory output stream with indicated capacity using a memory pool.

Parameters
[in]initial_capacitythe initial allocated internal capacity of the OutputStream
[in,out]poola MemoryPool to use for allocations
Returns
the created stream

Definition at line 67 of file EmptyFragment.cxx.

◆ Finish()

arrow::Result< std::shared_ptr< arrow::Buffer > > o2::framework::PreallocatedOutputStream::Finish ( )

Close the stream and return the buffer.

Definition at line 102 of file EmptyFragment.cxx.

◆ Reset()

arrow::Status o2::framework::PreallocatedOutputStream::Reset ( std::vector< size_t >  sizes,
int64_t  initial_capacity,
arrow::MemoryPool *  pool 
)

Initialize state of OutputStream with newly allocated memory and set position to 0.

Parameters
[in]initial_capacitythe starting allocated capacity
[in,out]poolthe memory pool to use for allocations
Returns
Status

Definition at line 77 of file EmptyFragment.cxx.

◆ Tell()

arrow::Result< int64_t > o2::framework::PreallocatedOutputStream::Tell ( ) const
override

Definition at line 110 of file EmptyFragment.cxx.

◆ Write()

arrow::Status o2::framework::PreallocatedOutputStream::Write ( const void data,
int64_t  nbytes 
)
override

Definition at line 112 of file EmptyFragment.cxx.


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