summaryrefslogtreecommitdiffhomepage
path: root/options/value.cpp
blob: af0da89f82b0b4a43f6d98c31e6e88f0151a9fb8 (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
/* Copyright (c) 2015-2016, Stanislaw Halik <sthalik@misaki.pl>

 * Permission to use, copy, modify, and/or distribute this
 * software for any purpose with or without fee is hereby granted,
 * provided that the above copyright notice and this permission
 * notice appear in all copies.
 */

#define OTR_OPTIONS_VALUE_TEMPLATE_UNIT
#include "value.hpp"

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);
}

namespace detail
{
    void set_base_value_to_default(base_value* val)
    {
        val->set_to_default();
    }
}

} // ns options