#include <swcdb/core/comm/Buffers.h>
Public Types | |
typedef std::shared_ptr< Buffers > | Ptr |
Public Member Functions | |
Buffers (uint32_t reserve=0) | |
Buffers (const Serializable ¶ms, uint32_t reserve=0) | |
Buffers (const Serializable ¶ms, StaticBuffer &buffer, uint32_t reserve=0) | |
Buffers (StaticBuffer &buffer, uint32_t reserve=0) | |
Buffers (const Serializable ¶ms, uint32_t reserve, uint64_t cmd, uint32_t timeout) | |
Buffers (const Serializable ¶ms, 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 ¶ms, uint32_t reserve=0) | |
Buffers (const Event::Ptr &ev, StaticBuffer &buffer, uint32_t reserve=0) | |
Buffers (const Event::Ptr &ev, const Serializable ¶ms, StaticBuffer &buffer, uint32_t reserve=0) | |
Buffers (Buffers &&)=delete | |
Buffers (const Buffers &)=delete | |
Buffers & | operator= (Buffers &&)=delete |
Buffers & | operator= (const Buffers &)=delete |
~Buffers () noexcept | |
void | set_data (uint32_t sz) |
void | set_data (const Serializable ¶ms, 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 ¶ms, uint32_t reserve=0) |
static SWC_CAN_INLINE Ptr | make (const Serializable ¶ms, 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 ¶ms, uint32_t reserve, uint64_t cmd, uint32_t timeout) |
static SWC_CAN_INLINE Ptr | make (const Serializable ¶ms, 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 ¶ms, uint32_t reserve=0) |
static SWC_CAN_INLINE Ptr | make (const Event::Ptr &ev, const Serializable ¶ms, 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 |
typedef std::shared_ptr<Buffers> SWC::Comm::Buffers::Ptr |
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().
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().
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().
SWC_CAN_INLINE SWC::Comm::Buffers::Buffers | ( | StaticBuffer & | buffer, |
uint32_t | reserve = 0 |
||
) |
Definition at line 213 of file Buffers.h.
References set_data().
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().
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().
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().
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().
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().
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().
|
delete |
|
delete |
|
noexcept |
Definition at line 16 of file Buffers.cc.
References buf_data, buf_ext, and SWC::Core::Buffer< T >::free().
|
inlinenoexcept |
Definition at line 139 of file Buffers.h.
References data_ptr, and SWC::Serialization::encode_i32().
|
inlinenoexcept |
Definition at line 134 of file Buffers.h.
References data_ptr, and SWC::Serialization::encode_i8().
|
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().
|
inlinenoexcept |
Definition at line 153 of file Buffers.h.
References expiry_ms, and SWC::Time::now_ms().
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.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
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().
|
inlinenoexcept |
|
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.
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().
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().
|
private |
Definition at line 170 of file Buffers.h.
Referenced by get_buffers(), prepare(), set_data(), and ~Buffers().
|
private |
Definition at line 171 of file Buffers.h.
Referenced by get_buffers(), moveout_buf_ext(), prepare(), and ~Buffers().
|
private |
Definition at line 169 of file Buffers.h.
Referenced by get_buffers().
uint8_t* SWC::Comm::Buffers::data_ptr |
Definition at line 165 of file Buffers.h.
Referenced by append_i32(), append_i8(), and set_data().
int64_t SWC::Comm::Buffers::expiry_ms |
Header SWC::Comm::Buffers::header |
Definition at line 163 of file Buffers.h.
Referenced by get_buffers(), prepare(), and set_data().