SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
RangeQueryUpdate.h
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 #ifndef swcdb_db_protocol_rgr_params_RangeQueryUpdate_h
7 #define swcdb_db_protocol_rgr_params_RangeQueryUpdate_h
8 
9 #include "swcdb/core/Exception.h"
11 #include "swcdb/db/Cells/CellKey.h"
13 
14 
15 namespace SWC { namespace Comm { namespace Protocol {
16 namespace Rgr { namespace Params {
17 
18 class RangeQueryUpdateReq final : public Serializable {
19  public:
20 
22  RangeQueryUpdateReq() noexcept: cid(), rid() { }
23 
25  RangeQueryUpdateReq(cid_t a_cid, rid_t a_rid) noexcept
26  : cid(a_cid), rid(a_rid) {
27  }
28 
29  //~RangeQueryUpdateReq() { }
30 
31  void print(std::ostream& out) const;
32 
35 
36  private:
37 
38  size_t SWC_PURE_FUNC internal_encoded_length() const override;
39 
40  void internal_encode(uint8_t** bufp) const override;
41 
42  void internal_decode(const uint8_t** bufp, size_t* remainp) override;
43 
44 };
45 
46 
47 
48 class RangeQueryUpdateRsp final : public Serializable {
49  public:
50 
52  RangeQueryUpdateRsp(int a_err = Error::OK) noexcept
53  : err(a_err), cells_added(0),
55  }
56 
57  RangeQueryUpdateRsp(int err, const uint8_t* ptr, size_t remain) noexcept;
58 
60  ~RangeQueryUpdateRsp() noexcept { }
61 
62  void print(std::ostream& out) const;
63 
64  int32_t err;
65  uint32_t cells_added;
68 
69  private:
70 
71  size_t SWC_PURE_FUNC internal_encoded_length() const override;
72 
73  void internal_encode(uint8_t** bufp) const override;
74 
75  void internal_decode(const uint8_t** bufp, size_t* remainp) override;
76 
77 };
78 
79 
80 }}}}}
81 
82 
83 #ifdef SWC_IMPL_SOURCE
85 #endif
86 
87 #endif // swcdb_db_protocol_rgr_params_RangeQueryUpdate_h
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: RangeQueryUpdate.cc:66
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: RangeQueryUpdate.cc:32
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::RangeQueryUpdateReq
SWC_CAN_INLINE RangeQueryUpdateReq() noexcept
Definition: RangeQueryUpdate.h:22
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: RangeQueryUpdate.cc:27
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::cid
cid_t cid
Definition: RangeQueryUpdate.h:33
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::print
void print(std::ostream &out) const
Definition: RangeQueryUpdate.cc:18
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_encode
void internal_encode(uint8_t **bufp) const override
Definition: RangeQueryUpdate.cc:74
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::internal_encoded_length
size_t SWC_PURE_FUNC internal_encoded_length() const override
Definition: RangeQueryUpdate.cc:22
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::cells_added
uint32_t cells_added
Definition: RangeQueryUpdate.h:65
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_decode
void internal_decode(const uint8_t **bufp, size_t *remainp) override
Definition: RangeQueryUpdate.cc:83
SWC::DB::Cell::Key
Definition: CellKey.h:24
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::RangeQueryUpdateReq
SWC_CAN_INLINE RangeQueryUpdateReq(cid_t a_cid, rid_t a_rid) noexcept
Definition: RangeQueryUpdate.h:25
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp
Definition: RangeQueryUpdate.h:48
RangeQueryUpdate.cc
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::RangeQueryUpdateRsp
SWC_CAN_INLINE RangeQueryUpdateRsp(int a_err=Error::OK) noexcept
Definition: RangeQueryUpdate.h:52
SWC::Error::OK
@ OK
Definition: Error.h:45
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
Exception.h
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::range_prev_end
DB::Cell::Key range_prev_end
Definition: RangeQueryUpdate.h:66
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC_PURE_FUNC
#define SWC_PURE_FUNC
Definition: Compat.h:108
SWC::Comm::Serializable
Definition: Serializable.h:18
Identifiers.h
Serializable.h
SWC::cid_t
uint64_t cid_t
Definition: Identifiers.h:16
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq::rid
rid_t rid
Definition: RangeQueryUpdate.h:34
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::print
void print(std::ostream &out) const
Definition: RangeQueryUpdate.cc:54
SWC::rid_t
uint64_t rid_t
Definition: Identifiers.h:17
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateReq
Definition: RangeQueryUpdate.h:18
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::err
int32_t err
Definition: RangeQueryUpdate.h:64
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::~RangeQueryUpdateRsp
SWC_CAN_INLINE ~RangeQueryUpdateRsp() noexcept
Definition: RangeQueryUpdate.h:60
CellKey.h
SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::range_end
DB::Cell::Key range_end
Definition: RangeQueryUpdate.h:67