|
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_SpecsIntervalUpdate_h
8 #define swcdb_db_cells_SpecsIntervalUpdate_h
14 namespace SWC {
namespace DB {
namespace Specs {
22 return len ?
new uint8_t[len] :
nullptr;
26 static uint8_t*
copy_value(
const uint8_t* v, uint32_t len) {
28 ?
static_cast<uint8_t*
>(memcpy(
new uint8_t[len], v, len))
34 typedef std::unique_ptr<IntervalUpdate>
Ptr;
36 template<
typename... ArgsT>
57 uint8_t* a_value, uint32_t a_vlen,
58 int64_t a_timestamp,
const UpdateOP& op,
68 int64_t a_timestamp,
const UpdateOP& op)
72 reinterpret_cast<uint8_t*>(const_cast<char*>(v.c_str())),
103 other.value =
nullptr;
123 encoder = cell.get_value(_v,
false);
130 cell.value =
nullptr;
170 other.value =
nullptr;
193 encoder = cell.get_value(_v,
false);
200 cell.value =
nullptr;
208 return encoder == other.encoder &&
210 vlen == other.vlen &&
246 void print(std::ostream& out)
const {
253 void display(std::ostream& out,
bool pretty)
const {
256 out <<
") len=" <<
vlen;
262 for(
const uint8_t* ptr =
value; ptr < end; ++ptr) {
265 if(!pretty || (31 < *ptr && *ptr < 127)) {
268 sprintf(hex,
"0x%X", *ptr);
287 #endif // swcdb_db_cells_SpecsIntervalUpdate_h
static SWC_CAN_INLINE uint8_t * copy_value(const uint8_t *v, uint32_t len)
SWC_CAN_INLINE bool equal(const UpdateOP &other) 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 IntervalUpdate(const uint8_t **bufp, size_t *remainp)
constexpr SWC_CAN_INLINE size_t encoded_length_bytes(size_t len) noexcept
static SWC_CAN_INLINE uint8_t * alloc_value(uint32_t len)
constexpr SWC_CAN_INLINE const uint8_t * decode_bytes(const uint8_t **bufp, size_t *remainp, size_t *lenp)
IntervalUpdate(Types::Encoder a_encoder, uint8_t *a_value, uint32_t a_vlen, int64_t a_timestamp, const UpdateOP &op, bool cp)
SWC_CAN_INLINE void encode(uint8_t **bufp) const
IntervalUpdate(const IntervalUpdate &other)
constexpr SWC_CAN_INLINE void encode_i8(uint8_t **bufp, uint8_t val) noexcept
SWC_CAN_INLINE void encode(uint8_t **bufp) const
IntervalUpdate(DB::Cells::Cell &&cell)
SWC_CAN_INLINE void encode_bytes(uint8_t **bufp, const void *data, size_t len)
SWC_CAN_INLINE bool equal(const IntervalUpdate &other) const noexcept
IntervalUpdate & operator=(const DB::Cells::Cell &cell)
~IntervalUpdate() noexcept
IntervalUpdate & operator=(IntervalUpdate &&other) noexcept
The SWC-DB C++ namespace 'SWC'.
void print(std::ostream &out) const
Types::Encoder get_value(StaticBuffer &v, bool owner) const
IntervalUpdate(IntervalUpdate &&other) noexcept
IntervalUpdate & operator=(const IntervalUpdate &other)
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi64(uint64_t val) noexcept
constexpr const int64_t TIMESTAMP_NULL
IntervalUpdate(Types::Encoder a_encoder, int64_t a_timestamp=DB::Cells::TIMESTAMP_NULL) noexcept
IntervalUpdate(const DB::Cells::Cell &cell)
Core::Encoder::Type Encoder
constexpr SWC_CAN_INLINE int64_t get_timestamp() const noexcept
SWC_CAN_INLINE void free() noexcept
constexpr SWC_CAN_INLINE uint64_t decode_vi64(const uint8_t **bufp, size_t *remainp)
SWC_CAN_INLINE size_t encoded_length() const noexcept
const char *SWC_CONST_FUNC to_string(Type typ) noexcept
SWC_CAN_INLINE size_t encoded_length() const noexcept
IntervalUpdate(Types::Encoder a_encoder, const std::string &v, int64_t a_timestamp, const UpdateOP &op)
constexpr SWC_CAN_INLINE void encode_vi64(uint8_t **bufp, uint64_t val)
SWC_CAN_INLINE void _free() noexcept
SWC_CAN_INLINE void print(std::ostream &out) const
void display(std::ostream &out, bool pretty) const
void set(Types::Encoder a_encoder, uint8_t *a_value, uint32_t a_vlen, int64_t a_timestamp=DB::Cells::TIMESTAMP_NULL, bool cp=false)
constexpr SWC_CAN_INLINE uint8_t decode_i8(const uint8_t **bufp, size_t *remainp)
IntervalUpdate(Types::Encoder a_encoder, uint32_t a_vlen, int64_t a_timestamp=DB::Cells::TIMESTAMP_NULL)
static SWC_CAN_INLINE Ptr make(ArgsT &&... args)
SWC_CAN_INLINE void set(const UpdateOP &op) noexcept
std::unique_ptr< IntervalUpdate > Ptr
IntervalUpdate & operator=(DB::Cells::Cell &&cell) noexcept