blob: b2f2c3a5a36bf63a00917190bfdde786f15faf26 [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át144729d2020-01-08 15:20:35 +010041enum class SpecialValue {
42 List,
43 Container,
44 PresenceContainer
45};
46
47struct special_ {
48 bool operator==(const special_& b) const;
49 SpecialValue m_value;
50};
51
52std::string specialValueToString(const special_& value);
53
Václav Kubernát627f6152018-08-29 13:23:56 +020054using leaf_data_ = boost::variant<enum_,
Václav Kubernátab538992019-03-06 15:30:50 +010055 binary_,
Václav Kubernáteeb38842019-03-20 19:46:05 +010056 identityRef_,
Václav Kubernát144729d2020-01-08 15:20:35 +010057 special_,
Václav Kubernát627f6152018-08-29 13:23:56 +020058 double,
59 bool,
Ivona Oboňová88c78ca2019-07-02 18:40:07 +020060 int8_t,
61 uint8_t,
62 int16_t,
63 uint16_t,
Václav Kubernát627f6152018-08-29 13:23:56 +020064 int32_t,
65 uint32_t,
Ivona Oboňová88c78ca2019-07-02 18:40:07 +020066 int64_t,
67 uint64_t,
Václav Kubernát627f6152018-08-29 13:23:56 +020068 std::string>;