SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
Property.h
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
7 #ifndef swcdb_core_config_Property_h
8 #define swcdb_core_config_Property_h
9 
10 
11 #include "swcdb/core/Compat.h"
12 #include "swcdb/core/MutexAtomic.h"
13 
14 
15 namespace SWC { namespace Config {
16 
20 
21 const uint64_t K = 1000;
22 const uint64_t KiB = 1024;
23 const uint64_t M = K * 1000;
24 const uint64_t MiB = KiB * 1024;
25 const uint64_t G = M * 1000;
26 const uint64_t GiB = MiB * 1024;
27 const uint64_t T = G * 1000;
28 const uint64_t TiB = GiB * 1024;
29 
30 
32 namespace Property {
33 
34 
35 class Value {
36  public:
37 
38  enum Type : uint8_t {
45 
48 
52 
60  };
61  static const char* SWC_CONST_FUNC to_string(Type type) noexcept;
62 
63  static const uint8_t SKIPPABLE = 0x01;
64  static const uint8_t GUARDED = 0x02;
65  static const uint8_t DEFAULT = 0x04;
66  static const uint8_t NO_TOKEN = 0x08;
67 
68  typedef Value* Ptr;
69 
70  template <typename T>
72  static T* get_pointer(Ptr ptr) {
73  assure_match(ptr->type(), T::value_type);
74  return static_cast<T*>(ptr);
75  }
76 
77  static void assure_match(Type t1, Type t2);
78 
79  Value(uint8_t flags=0) noexcept;
80 
81  Value(Ptr ptr) noexcept;
82 
83  Value(Value&&) = delete;
84  Value(const Value&) = delete;
85  Value& operator=(Value&&) = delete;
86  Value& operator=(const Value&) = delete;
87 
88  virtual ~Value() noexcept;
89 
90  virtual Ptr make_new(const Strings& values = Strings()) = 0;
91 
92  virtual Type type() const noexcept = 0;
93 
94  virtual void set_from(Ptr ptr) = 0;
95 
96  virtual void set_from(const Strings& values) = 0;
97 
98  virtual std::string to_string() const = 0;
99 
100  std::ostream& operator<<(std::ostream& ostream);
101 
102  bool is_skippable() const noexcept;
103 
104  bool is_guarded() const noexcept;
105 
106  Ptr default_value(bool defaulted) noexcept;
107 
108  bool is_default() const noexcept;
109 
110  Ptr zero_token() noexcept;
111 
112  bool is_zero_token() const noexcept;
113 
114  Core::Atomic<uint8_t> flags;
115 
116 };
117 
118 
123 void from_string(const char* s, double* value);
124 
125 void from_string(const char* s, int64_t* value);
126 
127 void from_string(const char* s, uint64_t* value);
128 
129 void from_string(const char* s, uint8_t* value);
130 
131 void from_string(const char* s, uint16_t* value);
132 
133 void from_string(const char* s, int32_t* value);
134 
135 template<typename T>
137 void from_string(const std::string& s, T value) {
138  from_string(s.c_str(), value);
139 }
140 
141 
142 
143 class Value_bool final : public Value {
144  public:
145  static const Type value_type = TYPE_BOOL;
146 
147  Value_bool(const bool& v, uint8_t flags=0) noexcept;
148 
149  Value_bool(Value_bool* ptr) noexcept;
150 
151  virtual ~Value_bool() noexcept;
152 
153  Ptr make_new(const Strings& values = Strings()) override;
154 
155  void set_from(Ptr ptr) override;
156 
157  void set_from(const Strings& values) override;
158 
159  Type SWC_CONST_FUNC type() const noexcept override;
160 
161  std::string to_string() const override;
162 
164  bool get() const noexcept {
165  return value;
166  }
167 
168  bool value;
169 };
170 
171 
172 class Value_uint8 final : public Value {
173  public:
174  static const Type value_type = TYPE_UINT8;
175 
176  Value_uint8(const uint8_t& v, uint8_t flags=0) noexcept;
177 
178  Value_uint8(Value_uint8* ptr) noexcept;
179 
180  virtual ~Value_uint8() noexcept;
181 
182  Ptr make_new(const Strings& values = Strings()) override;
183 
184  void set_from(Ptr ptr) override;
185 
186  void set_from(const Strings& values) override;
187 
188  Type SWC_CONST_FUNC type() const noexcept override;
189 
190  std::string to_string() const override;
191 
193  uint8_t get() const noexcept {
194  return value;
195  }
196 
197  uint8_t value;
198 };
199 
200 
201 class Value_uint16 final : public Value {
202  public:
203  static const Type value_type = TYPE_UINT16;
204 
205  Value_uint16(const uint16_t& v, uint8_t flags=0) noexcept;
206 
207  Value_uint16(Value_uint16* ptr) noexcept;
208 
209  virtual ~Value_uint16() noexcept;
210 
211  Ptr make_new(const Strings& values = Strings()) override;
212 
213  void set_from(Ptr ptr) override;
214 
215  void set_from(const Strings& values) override;
216 
217  Type SWC_CONST_FUNC type() const noexcept override;
218 
219  std::string to_string() const override;
220 
222  uint16_t get() const noexcept {
223  return value;
224  }
225 
226  uint16_t value;
227 };
228 
229 
230 class Value_int32 final : public Value {
231  public:
232  static const Type value_type = TYPE_INT32;
233 
234  Value_int32(const int32_t& v, uint8_t flags=0) noexcept;
235 
236  Value_int32(Value_int32* ptr) noexcept;
237 
238  virtual ~Value_int32() noexcept;
239 
240  Ptr make_new(const Strings& values = Strings()) override;
241 
242  void set_from(Ptr ptr) override;
243 
244  void set_from(const Strings& values) override;
245 
246  Type SWC_CONST_FUNC type() const noexcept override;
247 
248  std::string to_string() const override;
249 
251  int32_t get() const noexcept {
252  return value;
253  }
254 
255  int32_t value;
256 };
257 
258 
259 class Value_int64 final : public Value {
260  public:
261  static const Type value_type = TYPE_INT64;
262 
263  Value_int64(const int64_t& v, uint8_t flags=0) noexcept;
264 
265  Value_int64(Value_int64* ptr) noexcept;
266 
267  virtual ~Value_int64() noexcept;
268 
269  Ptr make_new(const Strings& values = Strings()) override;
270 
271  void set_from(Ptr ptr) override;
272 
273  void set_from(const Strings& values) override;
274 
275  Type SWC_CONST_FUNC type() const noexcept override;
276 
277  std::string to_string() const override;
278 
280  int64_t get() const noexcept {
281  return value;
282  }
283 
284  int64_t value;
285 };
286 
287 
288 class Value_double final : public Value {
289  public:
290  static const Type value_type = TYPE_DOUBLE;
291 
292  Value_double(const double& v, uint8_t flags=0) noexcept;
293 
294  Value_double(Value_double* ptr) noexcept;
295 
296  virtual ~Value_double() noexcept;
297 
298  Ptr make_new(const Strings& values = Strings()) override;
299 
300  void set_from(Ptr ptr) override;
301 
302  void set_from(const Strings& values) override;
303 
304  Type SWC_CONST_FUNC type() const noexcept override;
305 
306  std::string to_string() const override;
307 
309  double get() const noexcept {
310  return value;
311  }
312 
313  double value;
314 };
315 
316 
317 class Value_string final : public Value {
318  public:
319  static const Type value_type = TYPE_STRING;
320 
321  Value_string(std::string&& v, uint8_t flags=0) noexcept;
322 
324 
325  virtual ~Value_string() noexcept;
326 
327  Ptr make_new(const Strings& values = Strings()) override;
328 
329  void set_from(Ptr ptr) override;
330 
331  void set_from(const Strings& values) override;
332 
333  Type SWC_CONST_FUNC type() const noexcept override;
334 
335  std::string to_string() const override;
336 
338  std::string get() const {
339  return value;
340  }
341 
342  std::string value;
343 };
344 
345 
346 class Value_enum final : public Value {
347  public:
348  static const Type value_type = TYPE_ENUM;
349 
350  typedef std::function<int(const std::string&)> FromString_t;
351  typedef std::function<std::string(int)> Repr_t;
352 
353  Value_enum(const int32_t& v,
355  Repr_t&& repr,
356  uint8_t flags=0);
357 
358  Value_enum(Value_enum* ptr);
359 
360  virtual ~Value_enum() noexcept;
361 
362  Ptr make_new(const Strings& values = Strings()) override;
363 
364  void set_from(Ptr ptr) override;
365 
366  void set_from(const Strings& values) override;
367 
368  Type SWC_CONST_FUNC type() const noexcept override;
369 
370  std::string to_string() const override;
371 
373  int32_t get() const noexcept {
374  return value;
375  }
376 
377  int32_t value;
378  FromString_t call_from_string = nullptr;
379  Repr_t call_repr = nullptr;
380 };
381 
382 // lists
383 class Value_strings final : public Value {
384  public:
385  static const Type value_type = TYPE_STRINGS;
386 
387  Value_strings(Strings&& v, uint8_t flags=0) noexcept;
388 
390 
391  virtual ~Value_strings() noexcept;
392 
393  Ptr make_new(const Strings& values = Strings()) override;
394 
395  void set_from(Ptr ptr) override;
396 
397  void set_from(const Strings& values) override;
398 
399  Type SWC_CONST_FUNC type() const noexcept override;
400 
401  std::string to_string() const override;
402 
404  Strings get() const {
405  return value;
406  }
407 
409 };
410 
411 
412 class Value_int64s final : public Value {
413  public:
414  static const Type value_type = TYPE_INT64S;
415 
416  Value_int64s(Int64s&& v, uint8_t flags=0) noexcept;
417 
419 
420  virtual ~Value_int64s() noexcept;
421 
422  Ptr make_new(const Strings& values = Strings()) override;
423 
424  void set_from(Ptr ptr) override;
425 
426  void set_from(const Strings& values) override;
427 
428  Type SWC_CONST_FUNC type() const noexcept override;
429 
430  std::string to_string() const override;
431 
433  Int64s get() const {
434  return value;
435  }
436 
438 };
439 
440 
441 class Value_doubles final : public Value {
442  public:
443  static const Type value_type = TYPE_DOUBLES;
444 
445  Value_doubles(Doubles&& v, uint8_t flags=0) noexcept;
446 
448 
449  virtual ~Value_doubles() noexcept;
450 
451  Ptr make_new(const Strings& values = Strings()) override;
452 
453  void set_from(Ptr ptr) override;
454 
455  void set_from(const Strings& values) override;
456 
457  Type SWC_CONST_FUNC type() const noexcept override;
458 
459  std::string to_string() const override;
460 
462  Doubles get() const {
463  return value;
464  }
465 
467 };
468 
469 
470 
471 // Guarded Atomic
472 class Value_bool_g final : public Value {
473  public:
474  static const Type value_type = TYPE_BOOL_G;
475 
476  typedef Value_bool_g* Ptr;
477  typedef std::function<void(bool)> OnChg_t;
478 
479  Value_bool_g(const bool& v, OnChg_t&& cb, uint8_t flags=0);
480 
482 
483  virtual ~Value_bool_g() noexcept;
484 
485  Value::Ptr make_new(const Strings& values = Strings()) override;
486 
487  void set_from(Value::Ptr ptr) override;
488 
489  void set_from(const Strings& values) override;
490 
491  Type SWC_CONST_FUNC type() const noexcept override;
492 
493  std::string to_string() const override;
494 
496  bool get() const noexcept {
497  return value;
498  }
499 
500  void set(bool v) noexcept;
501 
502  void on_change() const;
503 
504  void set_cb_on_chg(OnChg_t&& cb);
505 
508 };
509 
510 
511 class Value_uint8_g final : public Value {
512  public:
513  static const Type value_type = TYPE_UINT8_G;
514 
515  typedef Value_uint8_g* Ptr;
516  typedef std::function<void(uint8_t)> OnChg_t;
517 
518  Value_uint8_g(const uint8_t& v, OnChg_t&& cb, uint8_t flags=0);
519 
521 
522  virtual ~Value_uint8_g() noexcept;
523 
524  Value::Ptr make_new(const Strings& values = Strings()) override;
525 
526  void set_from(Value::Ptr ptr) override;
527 
528  void set_from(const Strings& values) override;
529 
530  Type SWC_CONST_FUNC type() const noexcept override;
531 
532  std::string to_string() const override;
533 
535  uint8_t get() const noexcept {
536  return value;
537  }
538 
539  void on_change() const;
540 
541  void set_cb_on_chg(OnChg_t&& cb);
542 
545 };
546 
547 
548 class Value_uint16_g final : public Value {
549  public:
550  static const Type value_type = TYPE_UINT16_G;
551 
552  typedef Value_uint16_g* Ptr;
553  typedef std::function<void(uint16_t)> OnChg_t;
554 
555  Value_uint16_g(const uint16_t& v, OnChg_t&& cb, uint8_t flags=0);
556 
558 
559  virtual ~Value_uint16_g() noexcept;
560 
561  Value::Ptr make_new(const Strings& values = Strings()) override;
562 
563  void set_from(Value::Ptr ptr) override;
564 
565  void set_from(const Strings& values) override;
566 
567  Type SWC_CONST_FUNC type() const noexcept override;
568 
569  std::string to_string() const override;
570 
572  uint16_t get() const noexcept {
573  return value;
574  }
575 
576  void on_change() const;
577 
578  void set_cb_on_chg(OnChg_t&& cb);
579 
582 
583 };
584 
585 
586 class Value_int32_g final : public Value {
587  public:
588  static const Type value_type = TYPE_INT32_G;
589 
590  typedef Value_int32_g* Ptr;
591  typedef std::function<void(int32_t)> OnChg_t;
592 
593  Value_int32_g(const int32_t& v, OnChg_t&& cb, uint8_t flags=0);
594 
596 
597  virtual ~Value_int32_g() noexcept;
598 
599  Value::Ptr make_new(const Strings& values = Strings()) override;
600 
601  void set_from(Value::Ptr ptr) override;
602 
603  void set_from(const Strings& values) override;
604 
605  Type SWC_CONST_FUNC type() const noexcept override;
606 
607  std::string to_string() const override;
608 
610  int32_t get() const noexcept {
611  return value;
612  }
613 
614  void on_change() const;
615 
616  void set_cb_on_chg(OnChg_t&& cb);
617 
620 
621 };
622 
623 
624 class Value_uint64_g final : public Value {
625  public:
626  static const Type value_type = TYPE_UINT64_G;
627 
628  typedef Value_uint64_g* Ptr;
629  typedef std::function<void(uint64_t)> OnChg_t;
630 
631  Value_uint64_g(const uint64_t& v, OnChg_t&& cb, uint8_t flags=0);
632 
634 
635  virtual ~Value_uint64_g() noexcept;
636 
637  Value::Ptr make_new(const Strings& values = Strings()) override;
638 
639  void set_from(Value::Ptr ptr) override;
640 
641  void set_from(const Strings& values) override;
642 
643  Type SWC_CONST_FUNC type() const noexcept override;
644 
645  std::string to_string() const override;
646 
648  uint64_t get() const noexcept {
649  return value;
650  }
651 
652  void on_change() const;
653 
654  void set_cb_on_chg(OnChg_t&& cb);
655 
658 
659 };
660 
661 
662 class Value_enum_g final : public Value {
663  public:
664  static const Type value_type = TYPE_ENUM_G;
665 
666  typedef Value_enum_g* Ptr;
667  typedef std::function<void(int32_t)> OnChg_t;
670 
671  Value_enum_g(const int32_t& v,
672  OnChg_t&& cb,
674  Repr_t&& repr,
675  uint8_t flags=0);
676 
678 
679  virtual ~Value_enum_g() noexcept;
680 
681  Value::Ptr make_new(const Strings& values = Strings()) override;
682 
683  void set_from(Value::Ptr ptr) override;
684 
685  void set_from(const Strings& values) override;
686 
687  Type SWC_CONST_FUNC type() const noexcept override;
688 
689  std::string to_string() const override;
690 
692  int32_t get() const noexcept {
693  return value;
694  }
695 
696  void set(int32_t nv);
697 
698  void on_change() const;
699 
700  void set_cb_on_chg(OnChg_t&& cb);
701 
704  FromString_t call_from_string = nullptr;
705  Repr_t call_repr = nullptr;
706 };
707 
708 
709 
710 // Guarded Mutex
711 class Value_strings_g final : public Value {
712  public:
713  static const Type value_type = TYPE_STRINGS_G;
714 
716  typedef std::function<void()> OnChg_t;
717 
718  Value_strings_g(Strings&& v, OnChg_t&& cb, uint8_t flags=0) noexcept;
719 
721 
722  virtual ~Value_strings_g() noexcept;
723 
724  Value::Ptr make_new(const Strings& values = Strings()) override;
725 
726  void set_from(Value::Ptr ptr) override;
727 
728  void set_from(const Strings& values) override;
729 
730  Type SWC_CONST_FUNC type() const noexcept override;
731 
732  std::string to_string() const override;
733 
734  Strings get() const;
735 
736  size_t size() noexcept;
737 
738  std::string get_item(size_t n);
739 
740  void on_change() const;
741 
742  void set_cb_on_chg(OnChg_t&& cb);
743 
744  mutable Core::MutexAtomic mutex;
745  Strings value;
746  OnChg_t on_chg_cb;
747 
748 };
749 
750 
751 
752 
753 
754 }}} // namespace SWC::Config::Property
755 
756 
757 #ifdef SWC_IMPL_SOURCE
759 #endif
760 
761 #endif // swcdb_core_config_Property_h
SWC::Config::Property::Value_string::value
std::string value
Definition: Property.h:342
SWC::Config::Property::Value::type
virtual Type type() const noexcept=0
SWC::Config::Property::Value::is_skippable
bool is_skippable() const noexcept
Definition: Property.cc:75
SWC::Config::Property::Value_uint8_g::Ptr
Value_uint8_g * Ptr
Definition: Property.h:515
SWC::Config::Property::Value_uint64_g
Definition: Property.h:624
SWC::Config::Property::Value::TYPE_DOUBLES
@ TYPE_DOUBLES
Definition: Property.h:51
SWC::Config::Property::Value::default_value
Ptr default_value(bool defaulted) noexcept
Definition: Property.cc:83
SWC::Config::Property::Value::TYPE_ENUM_G
@ TYPE_ENUM_G
Definition: Property.h:58
SWC::Config::Property::Value_int64::value
int64_t value
Definition: Property.h:284
SWC::Config::GiB
const uint64_t GiB
Definition: Property.h:26
SWC::Core::AtomicBase< bool >
SWC::Config::Property::Value_uint16::value
uint16_t value
Definition: Property.h:226
SWC::Config::Property::Value_bool_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:507
SWC::Config::Property::Value::is_guarded
bool is_guarded() const noexcept
Definition: Property.cc:79
SWC::Config::Doubles
Core::Vector< double > Doubles
Definition: Property.h:19
SWC::Config::Property::Value::get_pointer
static SWC_CAN_INLINE T * get_pointer(Ptr ptr)
Definition: Property.h:72
SWC::Config::MiB
const uint64_t MiB
Definition: Property.h:24
SWC::Config::Property::Value_strings_g::OnChg_t
std::function< void()> OnChg_t
Definition: Property.h:716
SWC::Config::Property::Value::TYPE_UINT64_G
@ TYPE_UINT64_G
Definition: Property.h:57
SWC::Config::Property::Value_int64s::value
Int64s value
Definition: Property.h:437
Property.cc
SWC::Config::Property::Value::to_string
virtual std::string to_string() const =0
SWC::Core::Atomic< uint8_t >
SWC::Config::Strings
Core::Vector< std::string > Strings
Definition: Property.h:17
SWC::Config::Property::Value_uint8_g::OnChg_t
std::function< void(uint8_t)> OnChg_t
Definition: Property.h:516
SWC::Config::Property::Value::SKIPPABLE
static const uint8_t SKIPPABLE
Definition: Property.h:63
SWC::Config::Property::Value_uint16_g::Ptr
Value_uint16_g * Ptr
Definition: Property.h:552
SWC::Config::Property::Value::is_default
bool is_default() const noexcept
Definition: Property.cc:90
SWC::Config::Property::Value::TYPE_DOUBLE
@ TYPE_DOUBLE
Definition: Property.h:44
SWC::Config::Property::Value_enum_g::value
Core::Atomic< int32_t > value
Definition: Property.h:702
SWC::Config::Property::Value_strings
Definition: Property.h:383
SWC::Config::Property::Value_uint64_g::OnChg_t
std::function< void(uint64_t)> OnChg_t
Definition: Property.h:629
SWC::Config::Property::Value_uint8_g::value
Core::Atomic< uint8_t > value
Definition: Property.h:543
SWC::Config::Property::Value_uint16
Definition: Property.h:201
SWC::Config::Property::Value::TYPE_UINT8_G
@ TYPE_UINT8_G
Definition: Property.h:54
SWC::Config::Property::Value_bool
Definition: Property.h:143
SWC::Config::Property::Value_int32_g::value
Core::Atomic< int32_t > value
Definition: Property.h:618
SWC::Config::Property::Value::Value
Value(uint8_t flags=0) noexcept
Definition: Property.cc:65
SWC::Config::Property::Value::Ptr
Value * Ptr
Definition: Property.h:68
SWC::Config::Property::Value::TYPE_STRINGS_G
@ TYPE_STRINGS_G
Definition: Property.h:59
SWC::Config::Property::Value_enum::FromString_t
std::function< int(const std::string &)> FromString_t
Definition: Property.h:350
SWC::Config::Property::Value_int32
Definition: Property.h:230
SWC::Config::Property::Value::TYPE_STRING
@ TYPE_STRING
Definition: Property.h:46
SWC::Config::Property::Value_doubles
Definition: Property.h:441
SWC::Config::Property::Value_int32_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:619
SWC::Config::Property::Value_uint64_g::Ptr
Value_uint64_g * Ptr
Definition: Property.h:628
SWC::Config::Property::Value_strings_g
Definition: Property.h:711
SWC::Config::Property::Value_uint16_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:581
SWC::Config::Property::Value::TYPE_BOOL_G
@ TYPE_BOOL_G
Definition: Property.h:53
SWC_CONST_FUNC
#define SWC_CONST_FUNC
Definition: Compat.h:107
SWC::Config::Property::Value::DEFAULT
static const uint8_t DEFAULT
Definition: Property.h:65
SWC::Config::Property::Value_int64
Definition: Property.h:259
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC::Config::Property::Value::TYPE_INT32
@ TYPE_INT32
Definition: Property.h:42
SWC::Config::Property::Value_uint64_g::value
Core::Atomic< uint64_t > value
Definition: Property.h:656
SWC::Config::Property::Value_int32::value
int32_t value
Definition: Property.h:255
SWC::Config::Property::Value::TYPE_UINT16_G
@ TYPE_UINT16_G
Definition: Property.h:55
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Config::Property::Value::TYPE_STRINGS
@ TYPE_STRINGS
Definition: Property.h:49
SWC::Config::Property::Value::make_new
virtual Ptr make_new(const Strings &values=Strings())=0
SWC::Config::Property::Value_strings_g::Ptr
Value_strings_g * Ptr
Definition: Property.h:715
size
uint32_t size
Buffer size.
Definition: HeaderBufferInfo.h:47
Compat.h
SWC::Config::Property::Value_uint8::value
uint8_t value
Definition: Property.h:197
SWC::Config::Property::Value_enum::value
int32_t value
Definition: Property.h:377
SWC::Config::Property::Value::GUARDED
static const uint8_t GUARDED
Definition: Property.h:64
SWC::Config::K
const uint64_t K
Definition: Property.h:21
SWC::Config::Property::Value::TYPE_ENUM
@ TYPE_ENUM
Definition: Property.h:47
SWC::Config::Property::from_string
void from_string(const char *s, double *value)
Definition: Property.cc:109
SWC::Config::G
const uint64_t G
Definition: Property.h:25
SWC::Config::Property::Value::Type
Type
Definition: Property.h:38
SWC::Config::Property::Value_bool_g::Ptr
Value_bool_g * Ptr
Definition: Property.h:476
MutexAtomic.h
SWC::Config::Property::Value_bool_g::OnChg_t
std::function< void(bool)> OnChg_t
Definition: Property.h:477
SWC::Config::TiB
const uint64_t TiB
Definition: Property.h:28
SWC::Config::Property::Value_strings::value
Strings value
Definition: Property.h:408
SWC::Config::Property::Value::NO_TOKEN
static const uint8_t NO_TOKEN
Definition: Property.h:66
SWC::Config::Property::Value_uint8_g
Definition: Property.h:511
SWC::Config::Property::Value_string
Definition: Property.h:317
SWC::Config::Property::Value
Definition: Property.h:35
SWC::Config::Property::Value::flags
Core::Atomic< uint8_t > flags
Definition: Property.h:114
SWC::Config::Int64s
Core::Vector< int64_t > Int64s
Definition: Property.h:18
SWC::Config::Property::Value_enum_g
Definition: Property.h:662
set
void set(uint64_t cmd=0, uint32_t timeout=0) noexcept
Definition: Header.h:33
SWC::Config::Property::Value_uint16_g::value
Core::Atomic< uint16_t > value
Definition: Property.h:580
SWC::Core::Vector< std::string >
SWC::Config::Property::Value_enum::Repr_t
std::function< std::string(int)> Repr_t
Definition: Property.h:351
SWC::Config::Property::Value_uint16_g::OnChg_t
std::function< void(uint16_t)> OnChg_t
Definition: Property.h:553
SWC::Config::Property::Value_enum_g::Repr_t
Value_enum::Repr_t Repr_t
Definition: Property.h:669
SWC::Config::Property::Value::zero_token
Ptr zero_token() noexcept
Definition: Property.cc:94
SWC::Config::Property::Value_uint8
Definition: Property.h:172
SWC::Config::Property::Value_bool::value
bool value
Definition: Property.h:168
SWC::Config::T
const uint64_t T
Definition: Property.h:27
SWC::Config::Property::Value::TYPE_INT64
@ TYPE_INT64
Definition: Property.h:43
SWC::Config::Property::Value::TYPE_INT32_G
@ TYPE_INT32_G
Definition: Property.h:56
SWC::Config::Property::Value::set_from
virtual void set_from(Ptr ptr)=0
SWC::Config::Property::Value::TYPE_UINT16
@ TYPE_UINT16
Definition: Property.h:41
SWC::Config::Property::Value_int64s
Definition: Property.h:412
SWC::Config::Property::Value_uint16_g
Definition: Property.h:548
SWC::Config::Property::Value_enum_g::OnChg_t
std::function< void(int32_t)> OnChg_t
Definition: Property.h:667
SWC::Config::Property::Value_enum_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:703
SWC::Config::Property::Value_double::value
double value
Definition: Property.h:313
SWC::Config::Property::Value_doubles::value
Doubles value
Definition: Property.h:466
SWC::Config::Property::Value_double
Definition: Property.h:288
SWC::Config::Property::Value_int32_g::Ptr
Value_int32_g * Ptr
Definition: Property.h:590
SWC::Config::Property::Value::is_zero_token
bool is_zero_token() const noexcept
Definition: Property.cc:99
SWC::Config::Property::Value_bool_g
Definition: Property.h:472
SWC::Config::Property::Value_int32_g::OnChg_t
std::function< void(int32_t)> OnChg_t
Definition: Property.h:591
SWC::Config::Property::Value_enum_g::FromString_t
Value_enum::FromString_t FromString_t
Definition: Property.h:668
SWC::Config::Property::Value_enum
Definition: Property.h:346
SWC::Config::Property::Value_bool_g::value
Core::AtomicBool value
Definition: Property.h:506
SWC::Config::Property::Value_enum_g::Ptr
Value_enum_g * Ptr
Definition: Property.h:666
SWC::Config::KiB
const uint64_t KiB
Definition: Property.h:22
SWC::Config::M
const uint64_t M
Definition: Property.h:23
SWC::Config::Property::Value::TYPE_BOOL
@ TYPE_BOOL
Definition: Property.h:39
SWC::Config::Property::Value::TYPE_INT64S
@ TYPE_INT64S
Definition: Property.h:50
SWC::Config::Property::Value_int32_g
Definition: Property.h:586
SWC::Config::Property::Value::assure_match
static void assure_match(Type t1, Type t2)
Definition: Property.cc:57
SWC::Config::Property::Value::TYPE_UINT8
@ TYPE_UINT8
Definition: Property.h:40
SWC::Config::Property::Value_uint64_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:657
SWC::Config::Property::Value_uint8_g::on_chg_cb
OnChg_t on_chg_cb
Definition: Property.h:544