Václav Kubernát | 627f615 | 2018-08-29 13:23:56 +0200 | [diff] [blame] | 1 | /* |
| 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át | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 10 | #include <boost/optional.hpp> |
Václav Kubernát | 627f615 | 2018-08-29 13:23:56 +0200 | [diff] [blame] | 11 | #include <boost/variant.hpp> |
| 12 | |
| 13 | struct 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át | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 20 | struct 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át | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 27 | struct module_ { |
| 28 | bool operator==(const module_& b) const; |
| 29 | std::string m_name; |
| 30 | }; |
| 31 | |
| 32 | struct 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át | 627f615 | 2018-08-29 13:23:56 +0200 | [diff] [blame] | 41 | using leaf_data_ = boost::variant<enum_, |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 42 | binary_, |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 43 | identityRef_, |
Václav Kubernát | 627f615 | 2018-08-29 13:23:56 +0200 | [diff] [blame] | 44 | double, |
| 45 | bool, |
| 46 | int32_t, |
| 47 | uint32_t, |
| 48 | std::string>; |