summaryrefslogtreecommitdiffhomepage
path: root/options/base-value.cpp
blob: d900ad0fb307a195c0c948d8ebebd0dd1d1f4fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "base-value.hpp"

using namespace options;

value_::value_(bundle b, const QString& name, 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);
}

value_::~value_()
{
    b->on_value_destructed(self_name, this);
}

void value_::notify() const
{
    bundle_value_changed();
}

void value_::store(const QVariant& datum)
{
    b->store_kv(self_name, datum);
}

namespace options::detail {

void set_base_value_to_default(value_* val)
{
    val->set_to_default();
}

} // ns options::detail