 |
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.
7 #ifndef swcdb_db_cells_SpecsValue_h
8 #define swcdb_db_cells_SpecsValue_h
15 namespace SWC {
namespace DB {
namespace Specs {
32 set(data_n, strlen(data_n), comp_n, owner);
36 explicit Value(
const char* data_n,
const uint32_t size_n,
41 set(data_n, size_n, comp_n, owner);
45 explicit Value(
const uint8_t* data_n,
const uint32_t size_n,
50 set(data_n, size_n, comp_n, owner);
62 explicit Value(
const uint8_t** bufp,
size_t* remainp,
bool owner)
73 ? static_cast<uint8_t*>(memcpy(new uint8_t[
size], *bufp,
size))
74 : const_cast<uint8_t*>(*bufp)
89 ? static_cast<uint8_t*>(memcpy(new uint8_t[
size], other.
data,
size))
97 :
own(other.own),
comp(other.comp),
102 other.data =
nullptr;
103 other.matcher =
nullptr;
125 set(data_n, strlen(data_n), comp_n, owner);
130 set(data_n.c_str(), data_n.length(), comp_n,
true);
134 void set(
const char* data_n, uint32_t size_n,
136 set(
reinterpret_cast<const uint8_t*
>(data_n), size_n, comp_n, owner);
143 void set(
const uint8_t* data_n,
const uint32_t size_n,
171 bool equal(
const Value &other)
const noexcept;
194 void decode(
const uint8_t** bufp,
size_t* remainp,
bool owner) {
201 ?
static_cast<uint8_t*
>(memcpy(
new uint8_t[
size], *bufp,
size))
202 :
const_cast<uint8_t*
>(*bufp);
213 case Types::Column::PLAIN:
217 case Types::Column::COUNTER_I64:
218 case Types::Column::COUNTER_I32:
219 case Types::Column::COUNTER_I16:
220 case Types::Column::COUNTER_I8:
237 std::stringstream ss;
247 bool pretty=
true)
const;
270 matcher = other.matcher;
272 other.data =
nullptr;
273 other.matcher =
nullptr;
281 uint8_t* ptr = data_n;
283 set(data_n, len, comp_n,
true);
287 void Value::set(
const uint8_t* data_n,
const uint32_t size_n,
294 ?
static_cast<uint8_t*
>(memcpy(
new uint8_t[
size], data_n,
size))
295 :
const_cast<uint8_t*
>(data_n);
301 size == other.size &&
302 ((!
data && !other.data) ||
310 #ifdef SWC_IMPL_SOURCE
314 #endif // swcdb_db_cells_SpecsValue_h
SWC_CAN_INLINE Value(const Value &other)
SWC_CAN_INLINE void _free() noexcept
SWC_CAN_INLINE void copy(const Value &other)
constexpr SWC_CAN_INLINE size_t encoded_length() const noexcept
bool mem_eq(const uint8_t *b1, const uint8_t *b2, size_t count) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
SWC_CAN_INLINE void set(const char *data_n, Condition::Comp comp_n, bool owner)
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi32(uint32_t val) noexcept
SWC_CAN_INLINE std::string to_string(Types::Column col_type) const
void print(Types::Column col_type, std::ostream &out) const
constexpr SWC_CAN_INLINE Value(Value &&other) noexcept
constexpr SWC_CAN_INLINE void encode_i8(uint8_t **bufp, uint8_t val) noexcept
SWC_CAN_INLINE void free() noexcept
SWC_CAN_INLINE Value(int64_t count, Condition::Comp comp_n)
SWC_CAN_INLINE Value(const char *data_n, const uint32_t size_n, Condition::Comp comp_n, bool owner)
SWC_CAN_INLINE bool is_matching(Types::Column col_type, const Cells::Cell &cell) const
The SWC-DB C++ namespace 'SWC'.
SWC_CAN_INLINE Value(const uint8_t **bufp, size_t *remainp, bool owner)
SWC_CAN_INLINE void set(const std::string &data_n, Condition::Comp comp_n)
void set_counter(int64_t count, Condition::Comp comp_n)
SWC_CAN_INLINE Value & operator=(Value &&other) noexcept
SWC_CAN_INLINE Value(const char *data_n, Condition::Comp comp_n, bool owner)
constexpr bool equal(const Value &other) const noexcept
SWC_CAN_INLINE void set(const char *data_n, uint32_t size_n, Condition::Comp comp_n, bool owner)
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi64(uint64_t val) noexcept
SWC_CAN_INLINE Value(const uint8_t *data_n, const uint32_t size_n, Condition::Comp comp_n, bool owner)
bool is_matching_counter(const Cells::Cell &cell) const
constexpr SWC_CAN_INLINE void encode_vi32(uint8_t **bufp, uint32_t val)
virtual ~TypeMatcher() noexcept
SWC_CAN_INLINE Value & operator=(const Value &other)
bool is_matching_serial(const Cells::Cell &cell) const
constexpr SWC_CAN_INLINE void encode_vi64(uint8_t **bufp, uint64_t val)
void move(Value &other) noexcept
constexpr SWC_CAN_INLINE bool empty() const noexcept
SWC_CAN_INLINE void decode(const uint8_t **bufp, size_t *remainp, bool owner)
bool is_matching_plain(const Cells::Cell &cell) const
constexpr SWC_CAN_INLINE Value(Condition::Comp a_comp=Condition::NONE) noexcept
constexpr SWC_CAN_INLINE uint8_t decode_i8(const uint8_t **bufp, size_t *remainp)
void display(Types::Column col_type, std::ostream &out, bool pretty=true) const
SWC_CAN_INLINE void encode(uint8_t **bufp) const
constexpr SWC_CAN_INLINE uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)