SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
CellsUpdate.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 CellsUpdateReq::print(std::ostream& out) const {
17  out << "CellsUpdateReq(cid=" << cid << ')';
18 }
19 
22 }
23 
24 void CellsUpdateReq::internal_encode(uint8_t** bufp) const {
26 }
27 
28 void CellsUpdateReq::internal_decode(const uint8_t** bufp,
29  size_t* remainp) {
30  cid = Serialization::decode_vi64(bufp, remainp);
31 }
32 
33 
34 
35 CellsUpdateRsp::CellsUpdateRsp(int a_err, const uint8_t* ptr, size_t remain)
36  noexcept : err(a_err) {
37  if(!err) try {
38  decode(&ptr, &remain);
39  } catch(...) {
41  err = e.code();
43  }
44 }
45 
46 void CellsUpdateRsp::print(std::ostream& out) const {
47  Error::print(out << "CellsUpdateRsp(", err);
48  out << ')';
49 }
50 
53 }
54 
55 void CellsUpdateRsp::internal_encode(uint8_t** bufp) const {
57 }
58 
59 void CellsUpdateRsp::internal_decode(const uint8_t** bufp,
60  size_t* remainp) {
61  err = Serialization::decode_vi32(bufp, remainp);
62 }
63 
64 
65 
66 }}}}}
SWC::Error::Exception::code
constexpr SWC_CAN_INLINE int code() const noexcept
Definition: Exception.h:51
SWC::Comm::Protocol::Bkr::Params::CellsUpdateRsp::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: CellsUpdate.cc:55
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC::Comm::Protocol::Bkr::Params::CellsUpdateReq::print
void print(std::ostream &out) const
Definition: CellsUpdate.cc:16
SWC::Comm::Protocol::Bkr::Params::CellsUpdateReq::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: CellsUpdate.cc:20
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
SWC::Comm::Protocol::Bkr::Params::CellsUpdateRsp::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: CellsUpdate.cc:51
SWC::Serialization::encoded_length_vi32
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi32(uint32_t val) noexcept
Definition: Serialization.h:234
SWC::Comm::Protocol::Bkr::Params::CellsUpdateReq::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: CellsUpdate.cc:28
SWC::Comm::Protocol::Bkr::Params::CellsUpdateRsp::err
int32_t err
Definition: CellsUpdate.h:56
decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: HeaderBufferInfo.h:33
SWC::Comm::Protocol::Bkr::Params::CellsUpdateReq::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: CellsUpdate.cc:24
SWC_CURRENT_EXCEPTION
#define SWC_CURRENT_EXCEPTION(_msg_)
Definition: Exception.h:119
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
CellsUpdate.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::CellsUpdateReq::cid
cid_t cid
Definition: CellsUpdate.h:30
SWC::Comm::Protocol::Bkr::Params::CellsUpdateRsp::print
void print(std::ostream &out) const
Definition: CellsUpdate.cc:46
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::CellsUpdateRsp::CellsUpdateRsp
SWC_CAN_INLINE CellsUpdateRsp(int a_err=Error::OK) noexcept
Definition: CellsUpdate.h:48
SWC::Serialization::encode_vi64
constexpr SWC_CAN_INLINE void encode_vi64(uint8_t **bufp, uint64_t val)
Definition: Serialization.h:286
SWC::Error::print
void print(std::ostream &out, int err)
Definition: Error.cc:191
SWC::Error::Exception
Definition: Exception.h:21
SWC::Comm::Protocol::Bkr::Params::CellsUpdateRsp::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: CellsUpdate.cc:59
SWC::Serialization::decode_vi32
constexpr SWC_CAN_INLINE uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)
Definition: Serialization.h:254