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);
83 virtual ~
Value() noexcept;
95 std::ostream& operator<<(std::ostream& ostream);
159 bool get() const noexcept {
188 uint8_t get() const noexcept {
217 uint16_t get() const noexcept {
246 int32_t get() const noexcept {
275 int64_t get() const noexcept {
304 double get() const noexcept {
333 std::
string get()
const {
346 typedef std::function<std::string(
int)>
Repr_t;
368 int32_t get() const noexcept {
491 bool get() const noexcept {
495 void set(
bool v) noexcept;
497 void on_change()
const;
499 void set_cb_on_chg(OnChg_t&& cb);
530 uint8_t get() const noexcept {
534 void on_change()
const;
536 void set_cb_on_chg(OnChg_t&& cb);
548 typedef std::function<void(uint16_t)>
OnChg_t;
567 uint16_t get() const noexcept {
571 void on_change()
const;
573 void set_cb_on_chg(OnChg_t&& cb);
605 int32_t get() const noexcept {
609 void on_change()
const;
611 void set_cb_on_chg(OnChg_t&& cb);
624 typedef std::function<void(uint64_t)>
OnChg_t;
643 uint64_t get() const noexcept {
647 void on_change()
const;
649 void set_cb_on_chg(OnChg_t&& cb);
687 int32_t get() const noexcept {
691 void set(int32_t nv);
693 void on_change()
const;
695 void set_cb_on_chg(OnChg_t&& cb);
731 size_t size() noexcept;
733 std::
string get_item(
size_t n);
735 void on_change() const;
737 void set_cb_on_chg(
OnChg_t&& cb);
739 mutable Core::MutexAtomic mutex;
752 #ifdef SWC_IMPL_SOURCE
756 #endif // swcdb_core_config_Property_h