|
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_CellValueSerialFields_h
8 #define swcdb_db_cells_CellValueSerialFields_h
13 namespace SWC {
namespace DB {
namespace Cell {
70 void add(
uint24_t fid,
const std::vector<int64_t>& items);
74 void add(
uint24_t fid,
const std::vector<std::string>& items);
78 void add(
const int64_t& value) {
83 void add(
const long double& value) {
88 void add(
const uint8_t*
data, uint32_t len) {
94 add(
reinterpret_cast<const uint8_t*
>(
data.c_str()),
data.size());
99 add(fid,
reinterpret_cast<const uint8_t*
>(
data.c_str()),
data.size());
104 add(
reinterpret_cast<const uint8_t*
>(
data), len);
109 add(fid,
reinterpret_cast<const uint8_t*
>(
data), len);
123 void add(
const std::vector<int64_t>& items) {
133 void add(
const std::vector<std::string>& items) {
137 void print(std::ostream& out)
const;
149 static void print(
const uint8_t* ptr,
size_t remain, std::ostream& out);
151 static void display(
const uint8_t* ptr,
size_t remain, std::ostream& out);
167 other.field =
nullptr;
168 other.ufield =
nullptr;
176 std::swap(
field, other.field);
177 std::swap(
ufield, other.ufield);
187 operator bool() const noexcept {
196 :
private std::array<std::map<uint32_t, FieldUpdateOP>*, 7> {
210 decode(ptr, remain, take_ownership);
215 for(
auto it_t = cbegin() + 1; it_t != cend(); ++it_t) {
220 void decode(
const uint8_t* ptr,
size_t remain,
bool take_ownership) {
259 auto& typ_fields = (*this)[opfield.
field->
type()];
261 count += typ_fields->insert_or_assign(
266 typ_fields =
new std::map<uint32_t, FieldUpdateOP>();
267 (*typ_fields)[uint32_t(opfield.
field->
fid)] = std::move(opfield);
275 auto& typ_fields = (*this)[field->type()];
277 const auto it = typ_fields->find(field->fid);
278 if(it != typ_fields->cend()) {
287 for(
auto it_t = cbegin() + 1; it_t != cend(); ++it_t) {
290 for(
auto it_f = (*it_t)->cbegin(); it_f != (*it_t)->cend(); ++it_f) {
291 if(std::find(opfields.
cbegin(), opfields.
cend(), &it_f->second)
292 == opfields.
cend()) {
306 #ifdef SWC_IMPL_SOURCE
310 #endif // swcdb_db_cells_CellValueSerialFields_h
SWC_CAN_INLINE void add(const int64_t &value)
SWC_CAN_INLINE void add(Field *field, FieldUpdate *ufield)
virtual Type type() const noexcept=0
SWC_CAN_INLINE void add(const Core::Vector< std::string > &items)
void get_not_in(const FieldUpdateOpPtrs &opfields, FieldUpdateOpPtrs ¬_in) const
virtual SWC_CAN_INLINE uint24_t encoded_length() const noexcept
SWC_CAN_INLINE void add(const Key &key)
SWC_CAN_INLINE FieldUpdateOP() noexcept
SWC_CAN_INLINE void add(const long double &value)
SWC_CAN_INLINE void add(const std::string &data)
SWC_CAN_INLINE FieldUpdateOP(FieldUpdateOP &&other) noexcept
~FieldUpdateOP() noexcept
SWC_CAN_INLINE void ensure(size_t len)
FieldUpdateOP * find_matching_type_and_id(const Field *field) const noexcept
SWC_CAN_INLINE void add(FieldUpdate *ufield)
Core::Vector< const FieldUpdateOP * > FieldUpdateOpPtrs
SWC_CAN_INLINE void add(uint24_t fid, const char *data, uint32_t len)
SWC_CAN_INLINE void add(Field *field)
FieldUpdate_LIST_ITEMS< FieldUpdate_MATH, int64_t > FieldUpdate_LIST_INT64
void decode(const uint8_t *ptr, size_t remain, bool take_ownership)
Fields Reader with FieldsWriter & FieldUpdate serialization.
SWC_CAN_INLINE FieldUpdateOP & operator=(FieldUpdateOP &&other) noexcept
SWC_CAN_INLINE void add(const Core::Vector< int64_t > &items)
FieldUpdate_LIST_ITEMS< FieldUpdate_LIST, std::string > FieldUpdate_LIST_BYTES
The SWC-DB C++ namespace 'SWC'.
virtual SWC_CAN_INLINE void encode(uint8_t **bufp) const
constexpr SWC_CAN_INLINE FieldsWriter() noexcept
static void display(const uint8_t *ptr, size_t remain, std::ostream &out)
virtual size_t encoded_length() const noexcept
SWC_CAN_INLINE Type read_type(const uint8_t **bufp, size_t *remainp)
static void print(const uint8_t *ptr, size_t remain, std::ostream &out)
SWC_CAN_INLINE void add(const std::vector< std::string > &items)
constexpr SWC_CAN_INLINE const_iterator cend() const noexcept
SWC_CAN_INLINE void add(const char *data, uint32_t len)
SWC_CAN_INLINE ~FieldsUpdaterMap() noexcept
SWC_CAN_INLINE void add(uint24_t fid, const std::string &data)
SWC_CAN_INLINE void add(const uint8_t *data, uint32_t len)
virtual void encode(uint8_t **bufp) const =0
FieldUpdateOP & operator=(const FieldUpdateOP &)=delete
SWC_CAN_INLINE void add(const std::vector< int64_t > &items)
SWC_CAN_INLINE void push_back(ArgsT &&... args)
void print(std::ostream &out) const
constexpr SWC_CAN_INLINE const_iterator cbegin() const noexcept
SWC_CAN_INLINE FieldsUpdaterMap() noexcept
SWC_CAN_INLINE FieldsUpdaterMap(const uint8_t *ptr, size_t remain, bool take_ownership)
FieldUpdateOP(const FieldUpdateOP &)=delete