summaryrefslogtreecommitdiffhomepage
path: root/options/base-value.cpp
diff options
context:
space:
mode:
authorStanisław Halik <sthalik@misaki.pl>2017-05-14 16:22:09 +0200
committerGitHub <noreply@github.com>2017-05-14 16:22:09 +0200
commit5c23666b58bb1dd4aea15c0d62a2f716d5be7f52 (patch)
treee6497e9b55c073be209ec673ef05e62bf57a2c8f /options/base-value.cpp
parent4701dd3b0c8323a11cf7d5ad09c579a9864a41bd (diff)
parentc392181211b245e74292424500265323c960c1aa (diff)
Merge branch 'unstable' into unstable
Diffstat (limited to 'options/base-value.cpp')
-rw-r--r--options/base-value.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/options/base-value.cpp b/options/base-value.cpp
new file mode 100644
index 00000000..29f4b496
--- /dev/null
+++ b/options/base-value.cpp
@@ -0,0 +1,27 @@
+#include "base-value.hpp"
+
+using namespace options;
+
+base_value::base_value(bundle b, const QString& name, base_value::comparator cmp, std::type_index type_idx) :
+ b(b),
+ self_name(name),
+ cmp(cmp),
+ type_index(type_idx)
+{
+ b->on_value_created(name, this);
+}
+
+base_value::~base_value()
+{
+ b->on_value_destructed(self_name, this);
+}
+
+void base_value::store(const QVariant& datum)
+{
+ b->store_kv(self_name, datum);
+}
+
+void ::options::detail::set_base_value_to_default(base_value* val)
+{
+ val->set_to_default();
+}