SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
CellsSelect.cc
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
7 
9 
10 
11 namespace SWC { namespace Comm { namespace Protocol {
12 namespace Bkr { namespace Params {
13 
14 
15 
16 void CellsSelectReq::print(std::ostream& out) const {
17  out << "CellsSelectReq(cid=" << cid;
18  interval.print(out << ' ');
19  out << ')';
20 }
21 
25 }
26 
27 void CellsSelectReq::internal_encode(uint8_t** bufp) const {
29  interval.encode(bufp);
30 }
31 
32 void CellsSelectReq::internal_decode(const uint8_t** bufp,
33  size_t* remainp) {
34  cid = Serialization::decode_vi64(bufp, remainp);
35  interval.decode(bufp, remainp, true);
36 }
37 
38 
39 
40 
41 void CellsSelectReqRef::print(std::ostream& out) const {
42  out << "CellsSelectReq(cid=" << cid;
43  interval.print(out << ' ');
44  out << ')';
45 }
46 
50 }
51 
52 void CellsSelectReqRef::internal_encode(uint8_t** bufp) const {
54  interval.encode(bufp);
55 }
56 
57 
58 
59 CellsSelectRsp::CellsSelectRsp(int a_err, const uint8_t* ptr, size_t remain,
60  StaticBuffer& a_data) noexcept
61  : err(a_err), more(false),
62  offset(0), data(a_data) {
63  if(!err) try {
64  decode(&ptr, &remain);
65  } catch(...) {
67  err = e.code();
69  }
70 }
71 
72 void CellsSelectRsp::print(std::ostream& out) const {
73  Error::print(out << "CellsSelectRsp(", err);
74  out << " more=" << more
75  << " offset=" << offset
76  << " data.size=" << data.size
77  << ')';
78 }
79 
82  + 1
84 }
85 
86 void CellsSelectRsp::internal_encode(uint8_t** bufp) const {
90 }
91 
92 void CellsSelectRsp::internal_decode(const uint8_t** bufp,
93  size_t* remainp) {
94  err = Serialization::decode_vi32(bufp, remainp);
95  more = Serialization::decode_bool(bufp, remainp);
96  offset = Serialization::decode_vi64(bufp, remainp);
97 }
98 
99 
100 
101 }}}}}
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::CellsSelectRsp
SWC_CAN_INLINE CellsSelectRsp(int a_err=Error::OK, bool a_more=false, uint64_t a_offset=0) noexcept
Definition: CellsSelect.h:81
SWC::Error::Exception::code
constexpr SWC_CAN_INLINE int code() const noexcept
Definition: Exception.h:51
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC::Comm::Protocol::Bkr::Params::CellsSelectReqRef::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: CellsSelect.cc:47
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
data
T data
Definition: BitFieldInt.h:1
SWC::Comm::Protocol::Bkr::Params::CellsSelectReqRef::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: CellsSelect.cc:52
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::offset
uint64_t offset
Definition: CellsSelect.h:95
SWC::Serialization::encoded_length_vi32
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi32(uint32_t val) noexcept
Definition: Serialization.h:234
SWC::DB::Specs::Interval::encoded_length
size_t SWC_PURE_FUNC encoded_length() const noexcept
Definition: SpecsInterval.cc:154
SWC::DB::Specs::Interval::print
void print(std::ostream &out) const
Definition: SpecsInterval.cc:322
SWC::DB::Specs::Interval::encode
void encode(uint8_t **bufp) const
Definition: SpecsInterval.cc:166
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::interval
DB::Specs::Interval interval
Definition: CellsSelect.h:34
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::print
void print(std::ostream &out) const
Definition: CellsSelect.cc:72
SWC::Serialization::encode_bool
constexpr SWC_CAN_INLINE void encode_bool(uint8_t **bufp, bool bval) noexcept
Definition: Serialization.h:102
decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: HeaderBufferInfo.h:33
SWC_CURRENT_EXCEPTION
#define SWC_CURRENT_EXCEPTION(_msg_)
Definition: Exception.h:119
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: CellsSelect.cc:86
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::print
void print(std::ostream &out) const
Definition: CellsSelect.cc:16
SWC::Comm::Protocol::Bkr::Params::CellsSelectReqRef::interval
const DB::Specs::Interval & interval
Definition: CellsSelect.h:62
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::more
bool more
Definition: CellsSelect.h:94
SWC::Core::Buffer
Definition: Buffer.h:18
SWC::Core::Buffer::size
size_t size
Definition: Buffer.h:130
SWC::Serialization::decode_bool
constexpr SWC_CAN_INLINE bool decode_bool(const uint8_t **bufp, size_t *remainp)
Definition: Serialization.h:107
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: CellsSelect.cc:27
SWC::DB::Specs::Interval::decode
void decode(const uint8_t **bufp, size_t *remainp, bool owner)
Definition: SpecsInterval.cc:192
CellsSelect.h
SWC::Serialization::encoded_length_vi64
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi64(uint64_t val) noexcept
Definition: Serialization.h:272
SWC::LOG_ERROR
@ LOG_ERROR
Definition: Logger.h:32
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::err
int32_t err
Definition: CellsSelect.h:93
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: CellsSelect.cc:80
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: CellsSelect.cc:32
SWC::Serialization::decode_vi64
constexpr SWC_CAN_INLINE uint64_t decode_vi64(const uint8_t **bufp, size_t *remainp)
Definition: Serialization.h:302
SWC::Serialization::encode_vi32
constexpr SWC_CAN_INLINE void encode_vi32(uint8_t **bufp, uint32_t val)
Definition: Serialization.h:243
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: CellsSelect.cc:92
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: CellsSelect.cc:22
SWC::Comm::Protocol::Bkr::Params::CellsSelectReq::cid
cid_t cid
Definition: CellsSelect.h:33
SWC::Serialization::encode_vi64
constexpr SWC_CAN_INLINE void encode_vi64(uint8_t **bufp, uint64_t val)
Definition: Serialization.h:286
SWC::Comm::Protocol::Bkr::Params::CellsSelectReqRef::cid
cid_t cid
Definition: CellsSelect.h:61
SWC::Error::print
void print(std::ostream &out, int err)
Definition: Error.cc:191
SWC::Comm::Protocol::Bkr::Params::CellsSelectReqRef::print
void print(std::ostream &out) const
Definition: CellsSelect.cc:41
SWC::Error::Exception
Definition: Exception.h:21
SWC::Comm::Protocol::Bkr::Params::CellsSelectRsp::data
StaticBuffer data
Definition: CellsSelect.h:96
SWC::Serialization::decode_vi32
constexpr SWC_CAN_INLINE uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)
Definition: Serialization.h:254