7 #ifndef swcdb_core_config_Property_h
8 #define swcdb_core_config_Property_h
15 namespace SWC {
namespace Config {
21 const uint64_t
K = 1000;
22 const uint64_t
KiB = 1024;
23 const uint64_t
M =
K * 1000;
25 const uint64_t
G =
M * 1000;
27 const uint64_t
T =
G * 1000;
74 return static_cast<T*
>(ptr);
88 virtual ~
Value() noexcept;
100 std::ostream& operator<<(std::ostream& ostream);
164 bool get() const noexcept {
193 uint8_t get() const noexcept {
222 uint16_t get() const noexcept {
251 int32_t get() const noexcept {
280 int64_t get() const noexcept {
309 double get() const noexcept {
338 std::
string get()
const {
351 typedef std::function<std::string(
int)>
Repr_t;
373 int32_t get() const noexcept {
496 bool get() const noexcept {
500 void set(
bool v) noexcept;
502 void on_change()
const;
504 void set_cb_on_chg(OnChg_t&& cb);
535 uint8_t get() const noexcept {
539 void on_change()
const;
541 void set_cb_on_chg(OnChg_t&& cb);
553 typedef std::function<void(uint16_t)>
OnChg_t;
572 uint16_t get() const noexcept {
576 void on_change()
const;
578 void set_cb_on_chg(OnChg_t&& cb);
610 int32_t get() const noexcept {
614 void on_change()
const;
616 void set_cb_on_chg(OnChg_t&& cb);
629 typedef std::function<void(uint64_t)>
OnChg_t;
648 uint64_t get() const noexcept {
652 void on_change()
const;
654 void set_cb_on_chg(OnChg_t&& cb);
692 int32_t get() const noexcept {
696 void set(int32_t nv);
698 void on_change()
const;
700 void set_cb_on_chg(OnChg_t&& cb);
736 size_t size() noexcept;
738 std::
string get_item(
size_t n);
740 void on_change() const;
742 void set_cb_on_chg(
OnChg_t&& cb);
744 mutable Core::MutexAtomic mutex;
757 #ifdef SWC_IMPL_SOURCE
761 #endif // swcdb_core_config_Property_h