 |
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.
13 namespace SWC {
namespace DB {
namespace Cells {
33 const char* ptr =
reinterpret_cast<const char*
>(rptr);
63 uint8_t* ptr = output.
base;
80 const uint8_t* ptr =
value;
101 return flag == other.flag &&
102 control == other.control &&
103 vlen == other.vlen &&
105 (!(control &
HAVE_REVISION) || revision == other.revision) &&
106 key.equal(other.key) &&
145 }
else if(meta && !bin) {
148 const uint8_t* ptr = v.
base;
149 size_t remain = v.
size;
152 de_key.
decode(&ptr, &remain,
false);
153 de_key.
display(out <<
"end=",
true);
157 de_key.
decode(&ptr, &remain,
false);
158 de_key.
display(out <<
" min=",
true);
160 de_key.
decode(&ptr, &remain,
false);
161 de_key.
display(out <<
" max=",
true);
171 const uint8_t* ptr = v.
base;
175 for(uint32_t i=v.
size; i; --i, ++ptr) {
176 if(!bin && (*ptr < 32 || *ptr > 126)) {
177 sprintf(hex,
"0x%X", *ptr);
190 out <<
" control=" << int(
control)
194 <<
" value=(len=" <<
vlen;
222 const uint8_t* ptr = v.
base;
223 for(uint32_t len = v.
size; len; --len, ++ptr) {
226 if(31 < *ptr && *ptr < 127) {
229 sprintf(hex,
"0x%X", *ptr);
SWC_CAN_INLINE void set_value(uint8_t *v, uint32_t len, bool owner)
SWC_CAN_INLINE void reallocate(size_t len)
bool mem_eq(const uint8_t *b1, const uint8_t *b2, size_t count) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
const char *SWC_CONST_FUNC to_string(Flag flag) noexcept
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi32(uint32_t val) noexcept
constexpr SWC_CAN_INLINE void encode_i8(uint8_t **bufp, uint8_t val) noexcept
void decode(const uint8_t **bufp, size_t *remainp, bool owner)
constexpr const uint8_t MASK_HAVE_ENCODER
void decode(int &err, Type encoder, const uint8_t *src, size_t sz_enc, uint8_t *dst, size_t sz)
The SWC-DB C++ namespace 'SWC'.
void display(std::ostream &out, Types::Column typ=Types::Column::PLAIN, uint8_t flags=0, bool meta=false) const
constexpr SWC_CAN_INLINE bool have_encoder() const noexcept
bool SWC_CONST_FUNC is_counter(const Column typ) noexcept
constexpr const uint8_t HAVE_ENCODER
constexpr const uint8_t HAVE_REVISION
Types::Encoder get_value(StaticBuffer &v, bool owner) const
SWC_CAN_INLINE std::string to_string() const
#define SWC_THROWF(_code_, _fmt_,...)
SWC_CAN_INLINE void _free() noexcept
constexpr const uint8_t HAVE_TIMESTAMP
constexpr const int64_t TIMESTAMP_NULL
SWC_CAN_INLINE void free() noexcept
static void display(const uint8_t *ptr, size_t remain, std::ostream &out)
void print(std::ostream &out, Types::Column typ) const
Core::Encoder::Type Encoder
constexpr SWC_CAN_INLINE size_t fill() const noexcept
constexpr SWC_CAN_INLINE int64_t get_timestamp() const noexcept
constexpr const uint8_t OP_EQUAL
SWC_CAN_INLINE void skip_type_and_id(const uint8_t **bufp, size_t *remainp)
constexpr SWC_CAN_INLINE int64_t get_counter() const
constexpr SWC_CAN_INLINE uint64_t decode_vi64(const uint8_t **bufp, size_t *remainp)
constexpr SWC_CAN_INLINE void encode_vi32(uint8_t **bufp, uint32_t val)
const char *SWC_CONST_FUNC to_string(Type typ) noexcept
void encode(int &err, Type encoder, const uint8_t *src, size_t src_sz, size_t *sz_enc, DynamicBuffer &output, uint32_t reserve, bool no_plain_out=false, bool ok_more=false)
SWC_CAN_INLINE uint8_t * _value(const uint8_t *v)
void print(std::ostream &out) const
bool SWC_PURE_FUNC equal(const Cell &other) const noexcept
Flag SWC_PURE_FUNC flag_from(const uint8_t *rptr, uint32_t len) noexcept
constexpr SWC_CAN_INLINE uint8_t decode_i8(const uint8_t **bufp, size_t *remainp)
std::string fmt_ns(int64_t ns)
bool str_case_eq(const char *s1, const char *s2, size_t count) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
void display(std::ostream &out, bool pretty=true, const char *sep=",") const
constexpr SWC_CAN_INLINE int64_t get_revision() const noexcept
constexpr SWC_CAN_INLINE uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)
void set(value_type *data, size_t len, bool take_ownership) noexcept