|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
10 namespace SWC {
namespace DB {
namespace Cell {
17 if(other.
data && ++after_idx < other.
count) {
19 const uint8_t* ptr = other.
data;
20 for(; after_idx ; --after_idx)
32 const uint8_t* old =
data;
33 uint32_t old_size =
size;
36 size += uint32_t(len);
39 uint8_t* ptr =
data =
new uint8_t[
size];
41 memcpy(ptr, old, old_size);
47 memcpy(ptr, fraction, len);
58 uint32_t prev_size =
size;
60 size += uint32_t(len);
63 uint8_t* data_tmp =
new uint8_t[
size];
64 const uint8_t* ptr_tmp =
data;
66 uint8_t* fraction_ptr;
69 for(uint32_t pos = 0;; ++pos) {
72 memcpy(data_tmp,
data, offset);
73 fraction_ptr = data_tmp + offset;
75 memcpy(fraction_ptr, fraction, len);
80 offset += ptr_tmp -
data;
84 memcpy(fraction_ptr, ptr_tmp, prev_size-offset);
98 const uint8_t* ptr_tmp =
data;
106 begin =
const_cast<uint8_t*
>(ptr_tmp);
115 memmove(begin, ptr_tmp,
size-(ptr_tmp-
data));
116 size -= ptr_tmp-begin;
133 const uint8_t* ptr =
data;
134 for(uint32_t len; ; --idx, ptr += len) {
137 *fraction =
reinterpret_cast<const char*
>(ptr);
148 out <<
"size=" <<
size <<
" count=" <<
count <<
" fractions=";
152 void Key::display(std::ostream& out,
bool pretty,
const char* sep)
const {
159 const uint8_t* ptr =
data;
167 if(!pretty || (31 < *ptr && *ptr < 127)) {
170 sprintf(hex,
"0x%X", *ptr);
constexpr SWC_CAN_INLINE void encode_vi24(uint8_t **bufp, uint24_t val)
void get(uint32_t idx, const char **fraction, uint32_t *length) const
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi24(uint24_t val) noexcept
SWC_CAN_INLINE void insert(uint32_t idx, const std::string &fraction)
SWC_CAN_INLINE void add(const std::string_view &fraction)
void display_details(std::ostream &out, bool pretty=true) const
The SWC-DB C++ namespace 'SWC'.
SWC_CAN_INLINE void _free() noexcept
constexpr SWC_CAN_INLINE uint24_t decode_vi24(const uint8_t **bufp, size_t *remainp)
void copy(const Key &other)
void length(const ConnHandlerPtr &conn, const Event::Ptr &ev)
SWC_CAN_INLINE uint8_t * _data(const uint8_t *ptr)
void print(std::ostream &out) const
void remove(uint32_t idx, bool recursive=false)
void display(std::ostream &out, bool pretty=true, const char *sep=",") const