SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::Buffers Class Referencefinal

#include <swcdb/core/comm/Buffers.h>

+ Collaboration diagram for SWC::Comm::Buffers:

Public Types

typedef std::shared_ptr< BuffersPtr
 

Public Member Functions

 Buffers (uint32_t reserve=0)
 
 Buffers (const Serializable &params, uint32_t reserve=0)
 
 Buffers (const Serializable &params, StaticBuffer &buffer, uint32_t reserve=0)
 
 Buffers (StaticBuffer &buffer, uint32_t reserve=0)
 
 Buffers (const Serializable &params, uint32_t reserve, uint64_t cmd, uint32_t timeout)
 
 Buffers (const Serializable &params, StaticBuffer &buffer, uint32_t reserve, uint64_t cmd, uint32_t timeout)
 
 Buffers (const Event::Ptr &ev, uint32_t reserve=0)
 
 Buffers (const Event::Ptr &ev, const Serializable &params, uint32_t reserve=0)
 
 Buffers (const Event::Ptr &ev, StaticBuffer &buffer, uint32_t reserve=0)
 
 Buffers (const Event::Ptr &ev, const Serializable &params, StaticBuffer &buffer, uint32_t reserve=0)
 
 Buffers (Buffers &&)=delete
 
 Buffers (const Buffers &)=delete
 
Buffersoperator= (Buffers &&)=delete
 
Buffersoperator= (const Buffers &)=delete
 
 ~Buffers () noexcept
 
void set_data (uint32_t sz)
 
void set_data (const Serializable &params, uint32_t reserve)
 
SWC_CAN_INLINE void append_i8 (uint8_t ival) noexcept
 
SWC_CAN_INLINE void append_i32 (uint32_t ival) noexcept
 
SWC_CAN_INLINE void prepare (Core::Encoder::Type encoder)
 
SWC_CAN_INLINE bool expired () const noexcept
 
Core::Vector< asio::const_buffer > get_buffers ()
 
StaticBuffer && moveout_buf_ext () noexcept
 

Static Public Member Functions

static SWC_CAN_INLINE Ptr make (uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Serializable &params, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Serializable &params, StaticBuffer &buffer, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (StaticBuffer &buffer, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Serializable &params, uint32_t reserve, uint64_t cmd, uint32_t timeout)
 
static SWC_CAN_INLINE Ptr make (const Serializable &params, StaticBuffer &buffer, uint32_t reserve, uint64_t cmd, uint32_t timeout)
 
static SWC_CAN_INLINE Ptr make (const Event::Ptr &ev, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Event::Ptr &ev, const Serializable &params, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Event::Ptr &ev, const Serializable &params, StaticBuffer &buffer, uint32_t reserve=0)
 
static SWC_CAN_INLINE Ptr make (const Event::Ptr &ev, StaticBuffer &buffer, uint32_t reserve=0)
 
static Ptr create_error_message (const Event::Ptr &ev, int error, const char *msg, uint16_t len)
 

Public Attributes

Header header
 
int64_t expiry_ms
 
uint8_t * data_ptr
 

Private Attributes

uint8_t buf_header [Header::MAX_LENGTH]
 
StaticBuffer buf_data
 
StaticBuffer buf_ext
 

Detailed Description

Definition at line 20 of file Buffers.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Buffers> SWC::Comm::Buffers::Ptr

Definition at line 23 of file Buffers.h.

Constructor & Destructor Documentation

◆ Buffers() [1/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( uint32_t  reserve = 0)

Definition at line 190 of file Buffers.h.

References set_data().

Referenced by make().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Buffers() [2/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Serializable params,
uint32_t  reserve = 0 
)

Definition at line 198 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [3/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Serializable params,
StaticBuffer buffer,
uint32_t  reserve = 0 
)

Definition at line 205 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [4/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( StaticBuffer buffer,
uint32_t  reserve = 0 
)

Definition at line 213 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [5/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Serializable params,
uint32_t  reserve,
uint64_t  cmd,
uint32_t  timeout 
)

Definition at line 223 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [6/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Serializable params,
StaticBuffer buffer,
uint32_t  reserve,
uint64_t  cmd,
uint32_t  timeout 
)

Definition at line 231 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [7/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Event::Ptr ev,
uint32_t  reserve = 0 
)

Definition at line 242 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [8/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Event::Ptr ev,
const Serializable params,
uint32_t  reserve = 0 
)

Definition at line 250 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [9/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Event::Ptr ev,
StaticBuffer buffer,
uint32_t  reserve = 0 
)

Definition at line 267 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [10/12]

SWC_CAN_INLINE SWC::Comm::Buffers::Buffers ( const Event::Ptr ev,
const Serializable params,
StaticBuffer buffer,
uint32_t  reserve = 0 
)

Definition at line 258 of file Buffers.h.

References set_data().

+ Here is the call graph for this function:

◆ Buffers() [11/12]

SWC::Comm::Buffers::Buffers ( Buffers &&  )
delete

◆ Buffers() [12/12]

SWC::Comm::Buffers::Buffers ( const Buffers )
delete

◆ ~Buffers()

SWC::Comm::Buffers::~Buffers ( )
noexcept

Definition at line 16 of file Buffers.cc.

References buf_data, buf_ext, and SWC::Core::Buffer< T >::free().

+ Here is the call graph for this function:

Member Function Documentation

◆ append_i32()

SWC_CAN_INLINE void SWC::Comm::Buffers::append_i32 ( uint32_t  ival)
inlinenoexcept

Definition at line 139 of file Buffers.h.

References data_ptr, and SWC::Serialization::encode_i32().

+ Here is the call graph for this function:

◆ append_i8()

SWC_CAN_INLINE void SWC::Comm::Buffers::append_i8 ( uint8_t  ival)
inlinenoexcept

Definition at line 134 of file Buffers.h.

References data_ptr, and SWC::Serialization::encode_i8().

+ Here is the call graph for this function:

◆ create_error_message()

SWC_CAN_INLINE Buffers::Ptr SWC::Comm::Buffers::create_error_message ( const Event::Ptr ev,
int  error,
const char *  msg,
uint16_t  len 
)
static

Definition at line 180 of file Buffers.h.

References SWC::Serialization::encode_bytes(), SWC::Serialization::encode_i32(), SWC::Serialization::encoded_length_bytes(), and make().

Referenced by SWC::Comm::ConnHandler::send_error().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expired()

SWC_CAN_INLINE bool SWC::Comm::Buffers::expired ( ) const
inlinenoexcept

Definition at line 153 of file Buffers.h.

References expiry_ms, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ get_buffers()

Core::Vector< asio::const_buffer > SWC::Comm::Buffers::get_buffers ( )

Definition at line 37 of file Buffers.cc.

References SWC::Core::Buffer< T >::base, buf_data, buf_ext, buf_header, buffers, SWC::Comm::Header::encode(), SWC::Comm::Header::encoded_length(), header, and SWC::Core::Buffer< T >::size.

+ Here is the call graph for this function:

◆ make() [1/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Event::Ptr ev,
const Serializable params,
StaticBuffer buffer,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 75 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [2/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Event::Ptr ev,
const Serializable params,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 69 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [3/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Event::Ptr ev,
StaticBuffer buffer,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 82 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [4/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Event::Ptr ev,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 64 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [5/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Serializable params,
StaticBuffer buffer,
uint32_t  reserve,
uint64_t  cmd,
uint32_t  timeout 
)
inlinestatic

Definition at line 56 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [6/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Serializable params,
StaticBuffer buffer,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 37 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [7/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Serializable params,
uint32_t  reserve,
uint64_t  cmd,
uint32_t  timeout 
)
inlinestatic

Definition at line 50 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [8/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( const Serializable params,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 32 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [9/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( StaticBuffer buffer,
uint32_t  reserve = 0 
)
inlinestatic

Definition at line 43 of file Buffers.h.

References Buffers().

+ Here is the call graph for this function:

◆ make() [10/10]

static SWC_CAN_INLINE Ptr SWC::Comm::Buffers::make ( uint32_t  reserve = 0)
inlinestatic

Definition at line 27 of file Buffers.h.

References Buffers().

Referenced by SWC::Comm::Protocol::Bkr::Handler::Selector::add_cells(), SWC::Comm::Protocol::FsBroker::Handler::append(), SWC::Comm::Protocol::Bkr::Handler::ColumnCompact::callback(), SWC::Comm::Protocol::Bkr::Handler::ColumnGet::callback(), SWC::Comm::Protocol::Bkr::Handler::ColumnList::callback(), SWC::Comm::Protocol::Bkr::Handler::cells_select(), SWC::Comm::Protocol::Bkr::Handler::cells_update(), SWC::Comm::Protocol::FsBroker::Handler::close(), SWC::Comm::Protocol::Bkr::Handler::column_compact(), SWC::Comm::Protocol::Mngr::Handler::column_compact(), SWC::Comm::Protocol::Rgr::Handler::column_compact(), SWC::Comm::Protocol::Bkr::Handler::column_get(), SWC::Comm::Protocol::Bkr::Handler::column_list(), SWC::Comm::Protocol::Mngr::Handler::column_list(), SWC::Comm::Protocol::FsBroker::Handler::combi_pread(), SWC::Ranger::Callback::ColumnsUnload::complete(), SWC::Comm::Protocol::FsBroker::Handler::create(), SWC::Comm::Protocol::Mngr::Req::RgrMngId::create(), create_error_message(), SWC::Comm::Protocol::Mngr::Handler::do_echo(), SWC::Comm::Protocol::Mngr::Req::Echo::Echo(), SWC::Comm::Protocol::FsBroker::Handler::exists(), SWC::Comm::Protocol::FsBroker::Handler::flush(), SWC::Comm::Protocol::FsBroker::Handler::length(), SWC::Ranger::Callback::RangeLoad::loaded(), SWC::Comm::Protocol::Bkr::Req::CellsUpdate< DataT >::make(), SWC::Comm::Protocol::Rgr::Req::RangeQueryUpdate< DataT >::make(), SWC::Comm::Protocol::FsBroker::Handler::mkdirs(), SWC::Comm::Protocol::Mngr::Handler::mngr_active(), SWC::Comm::Protocol::Mngr::Handler::mngr_update_response(), SWC::Comm::Protocol::Common::Handler::not_implemented(), SWC::Comm::Protocol::FsBroker::Handler::open(), SWC::Comm::Protocol::Mngr::Handler::RangeCreate::operator()(), SWC::Comm::Protocol::Mngr::Handler::RangeRemove::operator()(), SWC::Comm::Protocol::Mngr::Handler::Report::operator()(), SWC::Comm::Protocol::Mngr::Handler::RgrMngId::operator()(), SWC::Comm::Protocol::Rgr::Handler::RangeLocate::operator()(), SWC::Comm::Protocol::Rgr::Handler::RangeQuerySelect::operator()(), SWC::Comm::Protocol::Rgr::Handler::Report::operator()(), SWC::Comm::Protocol::FsBroker::Handler::pread(), SWC::Comm::Protocol::Rgr::Handler::range_is_loaded(), SWC::Comm::Protocol::Rgr::Handler::range_query_update(), SWC::Comm::Protocol::Rgr::Handler::range_unload(), SWC::Comm::Protocol::Mngr::Handler::range_unloaded(), SWC::Comm::Protocol::FsBroker::Handler::read(), SWC::Comm::Protocol::FsBroker::Handler::readdir(), SWC::Comm::Protocol::FsBroker::Handler::remove(), SWC::Comm::Protocol::FsBroker::Handler::rename(), SWC::Ranger::Callback::RangeQueryUpdate::response(), SWC::Ranger::Callback::RangeLocateScan::response(), SWC::Ranger::Callback::RangeQuerySelect::response(), SWC::Comm::Protocol::Bkr::Handler::Selector::response(), SWC::Comm::Protocol::Bkr::Handler::Updater::response(), SWC::Comm::ConnHandler::response_ok(), SWC::Ranger::Callback::RangeUnload::response_params(), SWC::Comm::Protocol::Mngr::Handler::rgr_get(), SWC::Comm::Protocol::FsBroker::Handler::rmdir(), SWC::Comm::Protocol::FsBroker::Handler::seek(), SWC::Comm::Protocol::FsBroker::Handler::sync(), and SWC::Comm::Protocol::FsBroker::Handler::write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveout_buf_ext()

StaticBuffer&& SWC::Comm::Buffers::moveout_buf_ext ( )
inlinenoexcept

Definition at line 159 of file Buffers.h.

References buf_ext.

◆ operator=() [1/2]

Buffers& SWC::Comm::Buffers::operator= ( Buffers &&  )
delete

◆ operator=() [2/2]

Buffers& SWC::Comm::Buffers::operator= ( const Buffers )
delete

◆ prepare()

SWC_CAN_INLINE void SWC::Comm::Buffers::prepare ( Core::Encoder::Type  encoder)
inline

Definition at line 144 of file Buffers.h.

References buf_data, buf_ext, SWC::Comm::Header::data, SWC::Comm::Header::data_ext, SWC::Comm::BufferInfo::encode(), encoder, header, and SWC::Core::Buffer< T >::size.

+ Here is the call graph for this function:

◆ set_data() [1/2]

void SWC::Comm::Buffers::set_data ( const Serializable params,
uint32_t  reserve 
)

Definition at line 29 of file Buffers.cc.

References SWC::Core::Buffer< T >::base, buf_data, data_ptr, SWC::Comm::Serializable::encode(), SWC::Comm::Serializable::encoded_length(), and set_data().

+ Here is the call graph for this function:

◆ set_data() [2/2]

void SWC::Comm::Buffers::set_data ( uint32_t  sz)

Definition at line 21 of file Buffers.cc.

References SWC::Core::Buffer< T >::base, buf_data, SWC::Comm::Header::data, data_ptr, header, SWC::Core::Buffer< T >::reallocate(), SWC::Comm::BufferInfo::reset(), and SWC::Core::Buffer< T >::size.

Referenced by Buffers(), and set_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ buf_data

StaticBuffer SWC::Comm::Buffers::buf_data
private

Definition at line 170 of file Buffers.h.

Referenced by get_buffers(), prepare(), set_data(), and ~Buffers().

◆ buf_ext

StaticBuffer SWC::Comm::Buffers::buf_ext
private

Definition at line 171 of file Buffers.h.

Referenced by get_buffers(), moveout_buf_ext(), prepare(), and ~Buffers().

◆ buf_header

uint8_t SWC::Comm::Buffers::buf_header[Header::MAX_LENGTH]
private

Definition at line 169 of file Buffers.h.

Referenced by get_buffers().

◆ data_ptr

uint8_t* SWC::Comm::Buffers::data_ptr

Definition at line 165 of file Buffers.h.

Referenced by append_i32(), append_i8(), and set_data().

◆ expiry_ms

int64_t SWC::Comm::Buffers::expiry_ms

Definition at line 164 of file Buffers.h.

Referenced by expired().

◆ header

Header SWC::Comm::Buffers::header

Definition at line 163 of file Buffers.h.

Referenced by get_buffers(), prepare(), and set_data().


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