blob: 44e98af83661c592b894b041e45ff84198bb6961 [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,
Ivona Oboňová88c78ca2019-07-02 18:40:07 +020046 int8_t,
47 uint8_t,
48 int16_t,
49 uint16_t,
Václav Kubernát627f6152018-08-29 13:23:56 +020050 int32_t,
51 uint32_t,
Ivona Oboňová88c78ca2019-07-02 18:40:07 +020052 int64_t,
53 uint64_t,
Václav Kubernát627f6152018-08-29 13:23:56 +020054 std::string>;