SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
CellStoreBlockHeader.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 
7 #ifndef swcdb_ranger_db_CellStoreBlockHeader_h
8 #define swcdb_ranger_db_CellStoreBlockHeader_h
9 
10 
11 
12 namespace SWC { namespace Ranger {
13 
14 
16 namespace CellStore {
17 
18 
20 namespace Block {
21 
22 
23 struct Header final {
24  static const uint8_t SIZE = 21; // not-idx
25 
26  static const uint8_t ANY_BEGIN = 0x01;
27  static const uint8_t ANY_END = 0x2;
28 
29  uint64_t offset_data;
31  uint8_t is_any;
32 
34  uint32_t size_plain;
35  uint32_t size_enc;
36  uint32_t cells_count;
37  uint32_t checksum_data;
38 
39  Header(DB::Types::KeySeq key_seq) noexcept;
40 
41  Header(const Header& other);
42 
43  Header(Header&& other) noexcept;
44 
45  ~Header() noexcept { }
46 
47  void encode(uint8_t** bufp);
48 
49  void decode(const uint8_t** bufp, size_t* remainp);
50 
51  size_t encoded_length_idx() const;
52 
53  void encode_idx(uint8_t** bufp) const;
54 
55  void decode_idx(const uint8_t** bufp, size_t* remainp);
56 
57  void print(std::ostream& out) const;
58 
59 };
60 
61 
62 
63 }}}} // namespace SWC::Ranger::CellStore::Block
64 
65 #endif // swcdb_ranger_db_CellStoreBlockHeader_h
SWC::Ranger::CellStore::Block::Header
Definition: CellStoreBlockHeader.h:23
SWC::Ranger::CellStore::Block::Header::decode_idx
void decode_idx(const uint8_t **bufp, size_t *remainp)
Definition: CellStoreBlockHeader.cc:98
SWC::Ranger::CellStore::Block::Header::is_any
uint8_t is_any
Definition: CellStoreBlockHeader.h:31
SWC::Ranger::CellStore::Block::Header::offset_data
uint64_t offset_data
Definition: CellStoreBlockHeader.h:29
SWC::Core::Encoder::Type
Type
Definition: Encoder.h:28
SWC::Ranger::CellStore::Block::Header::interval
DB::Cells::Interval interval
Definition: CellStoreBlockHeader.h:30
SWC::Ranger::CellStore::Block::Header::encoded_length_idx
size_t encoded_length_idx() const
Definition: CellStoreBlockHeader.cc:75
SWC::Ranger::CellStore::Block::Header::ANY_BEGIN
static const uint8_t ANY_BEGIN
Definition: CellStoreBlockHeader.h:26
SWC::Ranger::CellStore::Block::Header::SIZE
static const uint8_t SIZE
Definition: CellStoreBlockHeader.h:24
SWC::DB::Types::KeySeq
KeySeq
Definition: KeySeq.h:13
SWC::Ranger::CellStore::Block::Header::cells_count
uint32_t cells_count
Definition: CellStoreBlockHeader.h:36
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Ranger::CellStore::Block::Header::decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: CellStoreBlockHeader.cc:65
SWC::Ranger::CellStore::Block::Header::checksum_data
uint32_t checksum_data
Definition: CellStoreBlockHeader.h:37
SWC::Ranger::CellStore::Block::Header::encoder
DB::Types::Encoder encoder
Definition: CellStoreBlockHeader.h:33
SWC::Ranger::CellStore::Block::Header::encode_idx
void encode_idx(uint8_t **bufp) const
Definition: CellStoreBlockHeader.cc:86
SWC::Ranger::CellStore::Block::Header::encode
void encode(uint8_t **bufp)
Definition: CellStoreBlockHeader.cc:51
SWC::Ranger::CellStore::Block::Header::Header
Header(DB::Types::KeySeq key_seq) noexcept
Definition: CellStoreBlockHeader.cc:15
SWC::Ranger::CellStore::Block::Header::~Header
~Header() noexcept
Definition: CellStoreBlockHeader.h:45
SWC::Ranger::CellStore::Block::Header::size_plain
uint32_t size_plain
Definition: CellStoreBlockHeader.h:34
SWC::DB::Cells::Interval
Definition: Interval.h:17
SWC::Ranger::CellStore::Block::Header::ANY_END
static const uint8_t ANY_END
Definition: CellStoreBlockHeader.h:27
SWC::Ranger::CellStore::Block::Header::size_enc
uint32_t size_enc
Definition: CellStoreBlockHeader.h:35
SWC::Ranger::CellStore::Block::Header::print
void print(std::ostream &out) const
Definition: CellStoreBlockHeader.cc:109