blob: 350fc8d7b245597d16bb214cc2142cf235b0cbab [file] [log] [blame]
Václav Kubernát627f6152018-08-29 13:23:56 +02001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
3 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
4 *
5 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
6 *
7*/
8#pragma once
9
Václav Kubernáteeb38842019-03-20 19:46:05 +010010#include <boost/optional.hpp>
Václav Kubernát627f6152018-08-29 13:23:56 +020011#include <boost/variant.hpp>
12
13struct enum_ {
14 enum_();
15 enum_(const std::string& value);
16 bool operator==(const enum_& b) const;
17 std::string m_value;
18};
19
Václav Kubernátab538992019-03-06 15:30:50 +010020struct binary_ {
21 binary_();
22 binary_(const std::string& value);
23 bool operator==(const binary_& b) const;
24 std::string m_value;
25};
26
Václav Kubernáteeb38842019-03-20 19:46:05 +010027struct module_ {
28 bool operator==(const module_& b) const;
29 std::string m_name;
30};
31
32struct identityRef_ {
33 identityRef_();
34 identityRef_(const std::string& module, const std::string& value);
35 identityRef_(const std::string& value);
36 bool operator==(const identityRef_& b) const;
37 boost::optional<module_> m_prefix;
38 std::string m_value;
39};
40
Václav Kubernát627f6152018-08-29 13:23:56 +020041using leaf_data_ = boost::variant<enum_,
Václav Kubernátab538992019-03-06 15:30:50 +010042 binary_,
Václav Kubernáteeb38842019-03-20 19:46:05 +010043 identityRef_,
Václav Kubernát627f6152018-08-29 13:23:56 +020044 double,
45 bool,
46 int32_t,
47 uint32_t,
48 std::string>;