 |
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.
11 namespace SWC {
namespace Config {
namespace Property {
32 return "TYPE_STRINGS";
36 return "TYPE_DOUBLES";
40 return "TYPE_UINT8_G";
42 return "TYPE_UINT16_G";
44 return "TYPE_INT32_G";
46 return "TYPE_UINT64_G";
50 return "TYPE_STRINGS_G";
60 "Value-Type mismatch expectation t1=%s == t2=%s",
111 double res = strtod(s, &last);
118 case 'K': res *= 1000LL;
break;
120 case 'M': res *= 1000000LL;
break;
122 case 'G': res *= 1000000000LL;
break;
126 "Bad Value %s unknown suffix %s", s, last);
134 *value = strtoll(s, &last, 0);
141 "Bad Value %s, number out of range of 64-bit integer", s);
145 case 'K': *value *= 1000LL;
break;
147 case 'M': *value *= 1000000LL;
break;
149 case 'G': *value *= 1000000000LL;
break;
153 "Bad Value %s unknown suffix %s", s, last);
160 *value = strtoull(s, &last, 0);
167 "Bad Value %s, number out of range of unsigned 64-bit integer", s);
171 case 'K': *value *= 1000LL;
break;
173 case 'M': *value *= 1000000LL;
break;
175 case 'G': *value *= 1000000000LL;
break;
179 "Bad Value %s unknown suffix %s", s, last);
187 if (res > UINT8_MAX || res < 0)
189 "Bad Value %s, number out of range of 8-bit unsigned integer", s);
198 if (res > UINT16_MAX || res < 0)
200 "Bad Value %s, number out of range of 16-bit unsigned integer", s);
208 if (res > INT32_MAX || res < INT32_MIN)
210 "Bad Value %s, number out of range of 32-bit integer", s);
219 :
Value(a_flags), value(v) {
229 ptr->set_from(values);
234 auto from = get_pointer<Value_bool>(ptr);
241 value = (
str.length() == 1 && *
str.data() ==
'1') ||
251 return value ?
"true" :
"false";
257 :
Value(a_flags), value(v) {
267 ptr->set_from(values);
272 auto from = get_pointer<Value_uint8>(ptr);
292 :
Value(a_flags), value(v) { }
301 ptr->set_from(values);
306 auto from = get_pointer<Value_uint16>(ptr);
326 :
Value(a_flags), value(v) { }
335 ptr->set_from(values);
340 auto from = get_pointer<Value_int32>(ptr);
360 :
Value(a_flags), value(v) { }
369 ptr->set_from(values);
374 auto from = get_pointer<Value_int64>(ptr);
394 :
Value(a_flags), value(v) { }
403 ptr->set_from(values);
408 auto from = get_pointer<Value_double>(ptr);
428 :
Value(a_flags), value(std::move(v)) {
438 ptr->set_from(values);
443 auto from = get_pointer<Value_string>(ptr);
466 :
Value(a_flags), value(v),
468 call_repr(std::move(repr)) {
472 :
Value(ptr), value(ptr->get()),
473 call_from_string(ptr->call_from_string),
474 call_repr(ptr->call_repr) {
482 ptr->set_from(values);
487 auto from = get_pointer<Value_enum>(ptr);
499 "Bad Value %s, no from_string cb set", values.
back().c_str());
504 "Bad Value %s, no corresponding enum", values.
back().c_str());
522 :
Value(a_flags), value(std::move(v)) {
532 ptr->set_from(values);
537 auto from = get_pointer<Value_strings>(ptr);
557 :
Value(a_flags), value(std::move(v)) {
567 ptr->set_from(values);
572 auto from = get_pointer<Value_int64s>(ptr);
580 for(
const std::string& s: values) {
597 :
Value(a_flags), value(std::move(v)) {
607 ptr->set_from(values);
612 auto from = get_pointer<Value_doubles>(ptr);
620 for(
const std::string& s: values) {
639 value(v), on_chg_cb(std::move(cb)) {
644 value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
652 ptr->set_from(values);
657 auto from = get_pointer<Value_bool_g>(ptr);
680 return value ?
"true" :
"false";
701 value(v), on_chg_cb(std::move(cb)) {
706 value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
714 ptr->set_from(values);
719 auto from = get_pointer<Value_uint8_g>(ptr);
757 value(v), on_chg_cb(std::move(cb)) {
762 value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
770 ptr->set_from(values);
775 auto from = get_pointer<Value_uint16_g>(ptr);
812 value(v), on_chg_cb(std::move(cb)) {
817 value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
825 ptr->set_from(values);
830 auto from = get_pointer<Value_int32_g>(ptr);
868 value(v), on_chg_cb(std::move(cb)) {
873 value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
881 ptr->set_from(values);
886 auto from = get_pointer<Value_uint64_g>(ptr);
927 on_chg_cb(std::move(cb)),
929 call_repr(std::move(repr)) {
933 :
Value(ptr), value(ptr->get()),
934 on_chg_cb(ptr->on_chg_cb),
935 call_from_string(ptr->call_from_string),
936 call_repr(ptr->call_repr) {
944 ptr->set_from(values);
949 auto from = get_pointer<Value_enum_g>(ptr);
967 "Bad Value %s, no from_string cb set", values.
back().c_str());
971 "Bad Value %s, no corresponding enum", values.
back().c_str());
1003 uint8_t a_flags) noexcept
1005 mutex(), value(std::move(v)), on_chg_cb(std::move(cb)) {
1010 mutex(), value(ptr->get()), on_chg_cb(ptr->on_chg_cb) {
1018 ptr->set_from(values);
1023 auto from = get_pointer<Value_strings_g>(ptr);
void set_from(Value::Ptr ptr) override
static const Type value_type
static const Type value_type
static const Type value_type
Value_uint64_g(const uint64_t &v, OnChg_t &&cb, uint8_t flags=0)
Value_int64(const int64_t &v, uint8_t flags=0) noexcept
bool is_skippable() const noexcept
SWC_CAN_INLINE uint8_t get() const noexcept
Ptr make_new(const Strings &values=Strings()) override
static const Type value_type
virtual ~Value_bool_g() noexcept
Value_uint16(const uint16_t &v, uint8_t flags=0) noexcept
Value_uint8(const uint8_t &v, uint8_t flags=0) noexcept
Value::Ptr make_new(const Strings &values=Strings()) override
Value_uint16_g(const uint16_t &v, OnChg_t &&cb, uint8_t flags=0)
void set_from(Value::Ptr ptr) override
SWC_CAN_INLINE uint64_t get() const noexcept
Value::Ptr make_new(const Strings &values=Strings()) override
Ptr make_new(const Strings &values=Strings()) override
std::string to_string() const override
virtual ~Value_int32_g() noexcept
std::string to_string() const override
Ptr default_value(bool defaulted) noexcept
Value_strings(Strings &&v, uint8_t flags=0) noexcept
void set_cb_on_chg(OnChg_t &&cb)
virtual ~Value_enum() noexcept
std::string to_string() const override
void set_from(Value::Ptr ptr) override
SWC_CAN_INLINE uint16_t get() const noexcept
SWC_CAN_INLINE void clear() noexcept(_NoExceptDestructor)
std::string to_string() const override
bool is_guarded() const noexcept
std::function< void()> OnChg_t
virtual std::string to_string() const =0
virtual ~Value_int64() noexcept
void set_from(Value::Ptr ptr) override
std::string to_string() const override
static const Type value_type
static const Type value_type
std::function< void(uint8_t)> OnChg_t
Ptr make_new(const Strings &values=Strings()) override
static const uint8_t SKIPPABLE
void set_from(Ptr ptr) override
void set_from(Ptr ptr) override
Value_int32_g(const int32_t &v, OnChg_t &&cb, uint8_t flags=0)
Value::Ptr make_new(const Strings &values=Strings()) override
bool is_default() const noexcept
static const Type value_type
#define SWC_ASSERTF(_e_, _fmt_,...)
virtual ~Value_string() noexcept
Type SWC_CONST_FUNC type() const noexcept override
Core::Atomic< int32_t > value
Ptr make_new(const Strings &values=Strings()) override
std::function< void(uint64_t)> OnChg_t
void set_cb_on_chg(OnChg_t &&cb)
Value::Ptr make_new(const Strings &values=Strings()) override
Ptr make_new(const Strings &values=Strings()) override
Core::Atomic< uint8_t > value
static const Type value_type
Type SWC_CONST_FUNC type() const noexcept override
Value_bool_g(const bool &v, OnChg_t &&cb, uint8_t flags=0)
Type SWC_CONST_FUNC type() const noexcept override
Core::Atomic< int32_t > value
std::string to_string() const override
SWC_CAN_INLINE int32_t get() const noexcept
Type SWC_CONST_FUNC type() const noexcept override
static const Type value_type
Value(uint8_t flags=0) noexcept
std::string to_string() const override
Ptr make_new(const Strings &values=Strings()) override
Type SWC_CONST_FUNC type() const noexcept override
std::string to_string() const override
std::string to_string() const override
virtual ~Value_uint8_g() noexcept
std::string to_string() const override
std::string to_string() const override
std::function< int(const std::string &)> FromString_t
Type SWC_CONST_FUNC type() const noexcept override
std::string to_string() const override
constexpr SWC_CAN_INLINE void store(T v) noexcept
virtual ~Value_strings() noexcept
static const uint8_t DEFAULT
constexpr SWC_CAN_INLINE bool empty() const noexcept
void set_from(Ptr ptr) override
Type SWC_CONST_FUNC type() const noexcept override
constexpr SWC_CAN_INLINE reference back() noexcept
Type SWC_CONST_FUNC type() const noexcept override
std::string to_string() const override
Core::Atomic< uint64_t > value
std::string to_string() const override
void set_from(Ptr ptr) override
The SWC-DB C++ namespace 'SWC'.
Value_strings_g(Strings &&v, OnChg_t &&cb, uint8_t flags=0) noexcept
Type SWC_CONST_FUNC type() const noexcept override
Ptr make_new(const Strings &values=Strings()) override
static const Type value_type
FromString_t call_from_string
void set_cb_on_chg(OnChg_t &&cb)
virtual ~Value() noexcept
SWC_CAN_INLINE int32_t get() const noexcept
Type SWC_CONST_FUNC type() const noexcept override
static const Type value_type
void set(bool v) noexcept
static const Type value_type
virtual ~Value_int32() noexcept
#define SWC_THROWF(_code_, _fmt_,...)
Value_string(std::string &&v, uint8_t flags=0) noexcept
std::ostream & operator<<(std::ostream &ostream)
static const uint8_t GUARDED
Value::Ptr make_new(const Strings &values=Strings()) override
Property::Value_string::Ptr str(std::string &&v)
void from_string(const char *s, double *value)
static const Type value_type
FromString_t call_from_string
Type SWC_CONST_FUNC type() const noexcept override
virtual ~Value_uint64_g() noexcept
std::function< void(bool)> OnChg_t
static const uint8_t NO_TOKEN
virtual ~Value_int64s() noexcept
void set_cb_on_chg(OnChg_t &&cb)
Value::Ptr make_new(const Strings &values=Strings()) override
SWC_CAN_INLINE bool get() const noexcept
Ptr make_new(const Strings &values=Strings()) override
Type SWC_CONST_FUNC type() const noexcept override
void set_from(Ptr ptr) override
virtual ~Value_double() noexcept
Core::Atomic< uint8_t > flags
Ptr make_new(const Strings &values=Strings()) override
static const Type value_type
Type SWC_CONST_FUNC type() const noexcept override
std::string to_string() const override
std::string format(const char *fmt,...) __attribute__((format(printf
Core::Atomic< uint16_t > value
std::string to_string() const override
std::string SWC_PRAGMA_DIAGNOSTIC_PUSH SWC_PRAGMA_DIAGNOSTIC_IGNORED("-Wformat-nonliteral") std SWC_PRAGMA_DIAGNOSTIC_POP std::string format_list(const SequenceT &seq, const char *sep=", ")
Value_bool(const bool &v, uint8_t flags=0) noexcept
std::function< std::string(int)> Repr_t
std::function< void(uint16_t)> OnChg_t
Value_enum_g(const int32_t &v, OnChg_t &&cb, FromString_t &&from_string, Repr_t &&repr, uint8_t flags=0)
Value_enum::Repr_t Repr_t
Ptr zero_token() noexcept
Comp from(const char **buf, uint32_t *remainp, uint8_t extended=0x00) noexcept
Type SWC_CONST_FUNC type() const noexcept override
virtual ~Value_uint8() noexcept
void set_from(Ptr ptr) override
virtual ~Value_bool() noexcept
void set_from(Ptr ptr) override
std::string get_item(size_t n)
Type SWC_CONST_FUNC type() const noexcept override
Type SWC_CONST_FUNC type() const noexcept override
void set_from(Value::Ptr ptr) override
std::function< void(int32_t)> OnChg_t
virtual ~Value_enum_g() noexcept
Value_doubles(Doubles &&v, uint8_t flags=0) noexcept
Ptr make_new(const Strings &values=Strings()) override
void set_from(Ptr ptr) override
virtual ~Value_uint16_g() noexcept
void set_from(Ptr ptr) override
void set_from(Ptr ptr) override
Value::Ptr make_new(const Strings &values=Strings()) override
std::string to_string() const override
Type SWC_CONST_FUNC type() const noexcept override
static const Type value_type
void set_cb_on_chg(OnChg_t &&cb)
void set_cb_on_chg(OnChg_t &&cb)
Value_int64s(Int64s &&v, uint8_t flags=0) noexcept
Value_int32(const int32_t &v, uint8_t flags=0) noexcept
bool is_zero_token() const noexcept
virtual ~Value_strings_g() noexcept
SWC_CAN_INLINE void push_back(ArgsT &&... args)
Value_enum(const int32_t &v, FromString_t &&from_string, Repr_t &&repr, uint8_t flags=0)
SWC_CAN_INLINE std::string to_string(const BitFieldInt< T, SZ > &v)
std::string to_string() const override
std::function< void(int32_t)> OnChg_t
static const Type value_type
Value_enum::FromString_t FromString_t
static const Type value_type
constexpr SWC_CAN_INLINE size_type size() const noexcept
void set_cb_on_chg(OnChg_t &&cb)
void set_from(Value::Ptr ptr) override
bool str_case_eq(const char *s1, const char *s2, size_t count) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
virtual ~Value_uint16() noexcept
Value_double(const double &v, uint8_t flags=0) noexcept
virtual ~Value_doubles() noexcept
void set_from(Value::Ptr ptr) override
static const Type value_type
Value_uint8_g(const uint8_t &v, OnChg_t &&cb, uint8_t flags=0)
static void assure_match(Type t1, Type t2)
void set_from(Ptr ptr) override
Type SWC_CONST_FUNC type() const noexcept override
SWC_CAN_INLINE int32_t get() const noexcept
constexpr SWC_CAN_INLINE T fetch_xor(T v) noexcept
Ptr make_new(const Strings &values=Strings()) override