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

#include <FairMQResizableBuffer.h>

Inherits arrow::ResizableBuffer.

Public Types

using Creator = std::function< std::unique_ptr< fair::mq::Message >(size_t)>
 

Public Member Functions

 FairMQResizableBuffer (Creator)
 
 ~FairMQResizableBuffer () override
 
arrow::Status Resize (const int64_t new_size, bool shrink_to_fit) override
 
arrow::Status Reserve (const int64_t capacity) override
 
std::unique_ptr< fair::mq::Message > Finalise ()
 

Detailed Description

An arrow::ResizableBuffer implemented on top of a fair::mq::Message FIXME: this is an initial attempt to integrate arrow and FairMQ a proper solution probably involves writing a arrow::MemoryPool using a fair::mq::UnmanagedRegion. This will come at a later stage.

Definition at line 90 of file FairMQResizableBuffer.h.

Member Typedef Documentation

◆ Creator

using o2::framework::FairMQResizableBuffer::Creator = std::function<std::unique_ptr<fair::mq::Message>(size_t)>

Definition at line 93 of file FairMQResizableBuffer.h.

Constructor & Destructor Documentation

◆ FairMQResizableBuffer()

o2::framework::FairMQResizableBuffer::FairMQResizableBuffer ( Creator  creator)

Definition at line 114 of file FairMQResizableBuffer.cxx.

◆ ~FairMQResizableBuffer()

o2::framework::FairMQResizableBuffer::~FairMQResizableBuffer ( )
overridedefault

Member Function Documentation

◆ Finalise()

std::unique_ptr< fair::mq::Message > o2::framework::FairMQResizableBuffer::Finalise ( )
Returns
the message to be sent. This will make the buffer lose ownership of the backing store, so you will have to either create a new one or in order to use it again.

Definition at line 162 of file FairMQResizableBuffer.cxx.

◆ Reserve()

arrow::Status o2::framework::FairMQResizableBuffer::Reserve ( const int64_t  capacity)
override

Reserve behaves as std::vector<T>::reserve()

  • If new capacity is greater than old capacity, reallocation happens
  • If new capacity is smaller than the old one, nothing happens.

Definition at line 142 of file FairMQResizableBuffer.cxx.

◆ Resize()

arrow::Status o2::framework::FairMQResizableBuffer::Resize ( const int64_t  new_size,
bool  shrink_to_fit 
)
override

Resize the buffer

  • If new size is larger than the backing message size, a new message will be created.
  • If new size is smaller than the backing message. We will use fair::mq::Message::SetUsedSize() accordingly when finalising the message.

Definition at line 124 of file FairMQResizableBuffer.cxx.


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