Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +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 | |
Václav Kubernát | 9456b5c | 2019-10-02 21:14:52 +0200 | [diff] [blame] | 9 | #include <boost/algorithm/string/predicate.hpp> |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 10 | #include "static_schema.hpp" |
| 11 | #include "utils.hpp" |
| 12 | |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 13 | StaticSchema::StaticSchema() |
| 14 | { |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 15 | m_nodes.emplace("/", std::unordered_map<std::string, NodeInfo>()); |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 16 | } |
| 17 | |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 18 | const std::unordered_map<std::string, NodeInfo>& StaticSchema::children(const std::string& name) const |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 19 | { |
| 20 | return m_nodes.at(name); |
| 21 | } |
| 22 | |
Václav Kubernát | 75877de | 2019-11-20 17:43:02 +0100 | [diff] [blame] | 23 | bool StaticSchema::isModule(const std::string& name) const |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 24 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 25 | return m_modules.find(name) != m_modules.end(); |
| 26 | } |
| 27 | |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 28 | void StaticSchema::addContainer(const std::string& location, const std::string& name, yang::ContainerTraits isPresence) |
| 29 | { |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 30 | m_nodes.at(location).emplace(name, NodeInfo{yang::container{isPresence}, yang::AccessType::Writable}); |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 31 | |
| 32 | //create a new set of children for the new node |
| 33 | std::string key = joinPaths(location, name); |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 34 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 35 | } |
| 36 | |
Václav Kubernát | e7248b2 | 2020-06-26 15:38:59 +0200 | [diff] [blame] | 37 | void StaticSchema::addRpc(const std::string& location, const std::string& name) |
| 38 | { |
| 39 | m_nodes.at(location).emplace(name, NodeInfo{yang::rpc{}, yang::AccessType::Writable}); |
| 40 | |
| 41 | //create a new set of children for the new node |
| 42 | std::string key = joinPaths(location, name); |
| 43 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
| 44 | } |
| 45 | |
Václav Kubernát | 3d787b1 | 2020-10-29 09:11:26 +0100 | [diff] [blame] | 46 | void StaticSchema::addAction(const std::string& location, const std::string& name) |
| 47 | { |
| 48 | m_nodes.at(location).emplace(name, NodeInfo{yang::action{}, yang::AccessType::Writable}); |
| 49 | |
| 50 | //create a new set of children for the new node |
| 51 | std::string key = joinPaths(location, name); |
| 52 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
| 53 | } |
| 54 | |
Václav Kubernát | 2db124c | 2020-05-28 21:58:36 +0200 | [diff] [blame] | 55 | bool StaticSchema::listHasKey(const schemaPath_& listPath, const std::string& key) const |
| 56 | { |
| 57 | return listKeys(listPath).count(key); |
| 58 | } |
| 59 | |
Václav Kubernát | 2db124c | 2020-05-28 21:58:36 +0200 | [diff] [blame] | 60 | std::string lastNodeOfSchemaPath(const std::string& path) |
| 61 | { |
| 62 | std::string res = path; |
| 63 | if (auto pos = res.find_last_of('/'); pos != res.npos) { |
| 64 | res.erase(0, pos + 1); |
| 65 | } |
| 66 | return res; |
| 67 | } |
| 68 | |
| 69 | const std::set<std::string> StaticSchema::listKeys(const schemaPath_& listPath) const |
| 70 | { |
| 71 | auto listPathString = pathToSchemaString(listPath, Prefixes::Always); |
| 72 | const auto& child = children(stripLastNodeFromPath(listPathString)).at(lastNodeOfSchemaPath(listPathString)); |
| 73 | const auto& list = std::get<yang::list>(child.m_nodeType); |
| 74 | return list.m_keys; |
| 75 | } |
| 76 | |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 77 | void StaticSchema::addList(const std::string& location, const std::string& name, const std::set<std::string>& keys) |
| 78 | { |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 79 | m_nodes.at(location).emplace(name, NodeInfo{yang::list{keys}, yang::AccessType::Writable}); |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 80 | |
Václav Kubernát | 1446fe1 | 2019-10-02 19:32:51 +0200 | [diff] [blame] | 81 | std::string key = joinPaths(location, name); |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 82 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 83 | } |
| 84 | |
Václav Kubernát | 3a99f00 | 2020-03-31 02:27:41 +0200 | [diff] [blame] | 85 | std::set<identityRef_> StaticSchema::validIdentities(std::string_view module, std::string_view value) |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 86 | { |
Václav Kubernát | 222ecff | 2020-05-14 23:14:35 +0200 | [diff] [blame] | 87 | std::set<identityRef_> identities; |
| 88 | getIdentSet(identityRef_{std::string{module}, std::string{value}}, identities); |
Václav Kubernát | 3a99f00 | 2020-03-31 02:27:41 +0200 | [diff] [blame] | 89 | |
Václav Kubernát | 222ecff | 2020-05-14 23:14:35 +0200 | [diff] [blame] | 90 | return identities; |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 91 | } |
| 92 | |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 93 | void StaticSchema::addLeaf(const std::string& location, const std::string& name, const yang::LeafDataType& type, const yang::AccessType accessType) |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 94 | { |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 95 | m_nodes.at(location).emplace(name, NodeInfo{yang::leaf{yang::TypeInfo{type, std::nullopt}}, accessType}); |
Václav Kubernát | e69133a | 2019-11-01 19:01:34 +0100 | [diff] [blame] | 96 | std::string key = joinPaths(location, name); |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 97 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
Václav Kubernát | 6a8d1d9 | 2019-04-24 20:30:36 +0200 | [diff] [blame] | 98 | } |
| 99 | |
Václav Kubernát | 5b8a8f3 | 2020-05-20 00:57:22 +0200 | [diff] [blame] | 100 | void StaticSchema::addLeafList(const std::string& location, const std::string& name, const yang::LeafDataType& type) |
| 101 | { |
| 102 | m_nodes.at(location).emplace(name, NodeInfo{yang::leaflist{yang::TypeInfo{type, std::nullopt}}, yang::AccessType::Writable}); |
| 103 | std::string key = joinPaths(location, name); |
| 104 | m_nodes.emplace(key, std::unordered_map<std::string, NodeInfo>()); |
| 105 | } |
| 106 | |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 107 | void StaticSchema::addModule(const std::string& name) |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 108 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 109 | m_modules.emplace(name); |
| 110 | } |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 111 | |
Václav Kubernát | 222ecff | 2020-05-14 23:14:35 +0200 | [diff] [blame] | 112 | void StaticSchema::addIdentity(const std::optional<identityRef_>& base, const identityRef_& name) |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 113 | { |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 114 | if (base) { |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 115 | m_identities.at(base.value()).emplace(name); |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 116 | } |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 117 | |
Václav Kubernát | 222ecff | 2020-05-14 23:14:35 +0200 | [diff] [blame] | 118 | m_identities.emplace(name, std::set<identityRef_>()); |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 119 | } |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 120 | |
Václav Kubernát | 222ecff | 2020-05-14 23:14:35 +0200 | [diff] [blame] | 121 | void StaticSchema::getIdentSet(const identityRef_& ident, std::set<identityRef_>& res) const |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 122 | { |
| 123 | res.insert(ident); |
| 124 | auto derivedIdentities = m_identities.at(ident); |
| 125 | for (auto it : derivedIdentities) { |
| 126 | getIdentSet(it, res); |
| 127 | } |
| 128 | } |
| 129 | |
Václav Kubernát | 13b23d7 | 2020-04-16 21:49:51 +0200 | [diff] [blame] | 130 | yang::TypeInfo StaticSchema::leafType(const schemaPath_& location, const ModuleNodePair& node) const |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 131 | { |
Václav Kubernát | efcac93 | 2020-01-10 15:26:32 +0100 | [diff] [blame] | 132 | std::string locationString = pathToSchemaString(location, Prefixes::Always); |
Václav Kubernát | 5b8a8f3 | 2020-05-20 00:57:22 +0200 | [diff] [blame] | 133 | auto nodeType = children(locationString).at(fullNodeName(location, node)).m_nodeType; |
Václav Kubernát | 4d8a9c2 | 2020-05-26 23:56:10 +0200 | [diff] [blame] | 134 | if (std::holds_alternative<yang::leaf>(nodeType)) { |
| 135 | return std::get<yang::leaf>(nodeType).m_type; |
Václav Kubernát | 5b8a8f3 | 2020-05-20 00:57:22 +0200 | [diff] [blame] | 136 | } |
| 137 | |
Václav Kubernát | 4d8a9c2 | 2020-05-26 23:56:10 +0200 | [diff] [blame] | 138 | if (std::holds_alternative<yang::leaflist>(nodeType)) { |
| 139 | return std::get<yang::leaflist>(nodeType).m_type; |
Václav Kubernát | 5b8a8f3 | 2020-05-20 00:57:22 +0200 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | throw std::logic_error("StaticSchema::leafType: Path is not a leaf or a leaflist"); |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 143 | } |
| 144 | |
Václav Kubernát | 13b23d7 | 2020-04-16 21:49:51 +0200 | [diff] [blame] | 145 | yang::TypeInfo StaticSchema::leafType(const std::string& path) const |
Václav Kubernát | 9bf3685 | 2020-02-18 17:47:56 +0100 | [diff] [blame] | 146 | { |
Václav Kubernát | 3a99f00 | 2020-03-31 02:27:41 +0200 | [diff] [blame] | 147 | auto locationString = stripLastNodeFromPath(path); |
| 148 | auto node = lastNodeOfSchemaPath(path); |
Václav Kubernát | 4d8a9c2 | 2020-05-26 23:56:10 +0200 | [diff] [blame] | 149 | return std::get<yang::leaf>(children(locationString).at(node).m_nodeType).m_type; |
Václav Kubernát | 989b5de | 2019-02-20 16:28:35 +0100 | [diff] [blame] | 150 | } |
| 151 | |
Václav Kubernát | 95b0887 | 2020-04-28 01:04:17 +0200 | [diff] [blame] | 152 | std::set<ModuleNodePair> StaticSchema::availableNodes(const boost::variant<dataPath_, schemaPath_, module_>& path, const Recursion recursion) const |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 153 | { |
Václav Kubernát | 3a823f4 | 2020-04-29 23:40:21 +0200 | [diff] [blame] | 154 | if (recursion == Recursion::Recursive) { |
| 155 | throw std::logic_error("Recursive StaticSchema::availableNodes is not implemented. It shouldn't be used in tests."); |
| 156 | } |
| 157 | |
Václav Kubernát | 95b0887 | 2020-04-28 01:04:17 +0200 | [diff] [blame] | 158 | std::set<ModuleNodePair> res; |
Václav Kubernát | 3a823f4 | 2020-04-29 23:40:21 +0200 | [diff] [blame] | 159 | if (path.type() == typeid(module_)) { |
| 160 | auto topLevelNodes = m_nodes.at(""); |
| 161 | auto modulePlusColon = boost::get<module_>(path).m_name + ":"; |
| 162 | for (const auto& it : topLevelNodes) { |
| 163 | if (boost::algorithm::starts_with(it.first, modulePlusColon)) { |
Václav Kubernát | 95b0887 | 2020-04-28 01:04:17 +0200 | [diff] [blame] | 164 | res.insert(splitModuleNode(it.first)); |
Václav Kubernát | 3a823f4 | 2020-04-29 23:40:21 +0200 | [diff] [blame] | 165 | } |
| 166 | } |
| 167 | return res; |
| 168 | } |
| 169 | |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 170 | auto getTopLevelModule = [](const auto& path) -> boost::optional<std::string> { |
Václav Kubernát | e2d629f | 2020-04-28 11:01:54 +0200 | [diff] [blame] | 171 | if (!path.m_nodes.empty()) { |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 172 | return path.m_nodes.begin()->m_prefix.flat_map([](const auto& module) { return boost::optional<std::string>(module.m_name); }); |
Václav Kubernát | e2d629f | 2020-04-28 11:01:54 +0200 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | return boost::none; |
| 176 | }; |
| 177 | |
| 178 | std::string locationString; |
| 179 | boost::optional<std::string> topLevelModule; |
| 180 | if (path.type() == typeid(schemaPath_)) { |
| 181 | locationString = pathToSchemaString(boost::get<schemaPath_>(path), Prefixes::Always); |
| 182 | topLevelModule = getTopLevelModule(boost::get<schemaPath_>(path)); |
| 183 | } else { |
| 184 | locationString = pathToSchemaString(boost::get<dataPath_>(path), Prefixes::Always); |
| 185 | topLevelModule = getTopLevelModule(boost::get<dataPath_>(path)); |
| 186 | } |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 187 | |
| 188 | auto childrenRef = children(locationString); |
| 189 | |
Václav Kubernát | e2d629f | 2020-04-28 11:01:54 +0200 | [diff] [blame] | 190 | std::transform(childrenRef.begin(), childrenRef.end(), std::inserter(res, res.end()), [path, topLevelModule](const auto& it) { |
| 191 | auto res = splitModuleNode(it.first); |
| 192 | if (topLevelModule == res.first) { |
| 193 | res.first = boost::none; |
| 194 | } |
| 195 | return res; |
Václav Kubernát | 95b0887 | 2020-04-28 01:04:17 +0200 | [diff] [blame] | 196 | }); |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 197 | return res; |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 198 | } |
Václav Kubernát | 9456b5c | 2019-10-02 21:14:52 +0200 | [diff] [blame] | 199 | |
Václav Kubernát | 19a368b | 2020-05-27 00:05:23 +0200 | [diff] [blame] | 200 | struct impl_nodeType { |
| 201 | |
| 202 | yang::NodeTypes operator()(const yang::container& cont) |
| 203 | { |
| 204 | if (cont.m_presence == yang::ContainerTraits::Presence) { |
| 205 | return yang::NodeTypes::PresenceContainer; |
| 206 | } |
| 207 | return yang::NodeTypes::Container; |
| 208 | } |
| 209 | yang::NodeTypes operator()(const yang::list&) |
| 210 | { |
| 211 | return yang::NodeTypes::List; |
| 212 | } |
| 213 | yang::NodeTypes operator()(const yang::leaf&) |
| 214 | { |
| 215 | return yang::NodeTypes::Leaf; |
Václav Kubernát | 19a368b | 2020-05-27 00:05:23 +0200 | [diff] [blame] | 216 | } |
| 217 | yang::NodeTypes operator()(const yang::leaflist&) |
| 218 | { |
| 219 | return yang::NodeTypes::LeafList; |
| 220 | } |
Václav Kubernát | e7248b2 | 2020-06-26 15:38:59 +0200 | [diff] [blame] | 221 | |
| 222 | yang::NodeTypes operator()(const yang::rpc) |
| 223 | { |
| 224 | return yang::NodeTypes::Rpc; |
| 225 | } |
Václav Kubernát | 3d787b1 | 2020-10-29 09:11:26 +0100 | [diff] [blame] | 226 | |
| 227 | yang::NodeTypes operator()(const yang::action) |
| 228 | { |
| 229 | return yang::NodeTypes::Action; |
| 230 | } |
Václav Kubernát | 19a368b | 2020-05-27 00:05:23 +0200 | [diff] [blame] | 231 | }; |
| 232 | |
Václav Kubernát | 34ee85a | 2020-02-18 17:12:12 +0100 | [diff] [blame] | 233 | yang::NodeTypes StaticSchema::nodeType(const schemaPath_& location, const ModuleNodePair& node) const |
| 234 | { |
| 235 | std::string locationString = pathToSchemaString(location, Prefixes::Always); |
| 236 | auto fullName = fullNodeName(location, node); |
| 237 | try { |
| 238 | auto targetNode = children(locationString).at(fullName); |
| 239 | |
Václav Kubernát | 19a368b | 2020-05-27 00:05:23 +0200 | [diff] [blame] | 240 | return std::visit(impl_nodeType{}, targetNode.m_nodeType); |
Václav Kubernát | 34ee85a | 2020-02-18 17:12:12 +0100 | [diff] [blame] | 241 | } catch (std::out_of_range&) { |
| 242 | throw InvalidNodeException(); |
| 243 | } |
| 244 | } |
| 245 | |
Václav Kubernát | abf5280 | 2020-05-19 01:31:17 +0200 | [diff] [blame] | 246 | std::string fullNodeName(const std::string& location, const std::string& node) |
| 247 | { |
| 248 | // If the node already contains a module name, just return it. |
| 249 | if (node.find_first_of(':') != std::string::npos) { |
| 250 | return node; |
| 251 | } |
| 252 | |
| 253 | // Otherwise take the module name from the first node of location. |
| 254 | return location.substr(location.find_first_not_of('/'), location.find_first_of(':') - 1) + ":" + node; |
| 255 | } |
| 256 | |
| 257 | bool StaticSchema::isConfig(const std::string& leafPath) const |
| 258 | { |
| 259 | auto locationString = stripLastNodeFromPath(leafPath); |
| 260 | |
| 261 | auto node = fullNodeName(locationString, lastNodeOfSchemaPath(leafPath)); |
| 262 | return children(locationString).at(node).m_configType == yang::AccessType::Writable; |
| 263 | } |
| 264 | |
Václav Kubernát | 1e09bd6 | 2020-02-17 15:13:38 +0100 | [diff] [blame] | 265 | std::optional<std::string> StaticSchema::description([[maybe_unused]] const std::string& path) const |
| 266 | { |
| 267 | throw std::runtime_error{"StaticSchema::description not implemented"}; |
| 268 | } |
| 269 | |
Václav Kubernát | a1c4c9e | 2020-04-22 00:37:52 +0200 | [diff] [blame] | 270 | yang::Status StaticSchema::status([[maybe_unused]] const std::string& location) const |
| 271 | { |
| 272 | throw std::runtime_error{"Internal error: StaticSchema::status(std::string) not implemented. The tests should not have called this overload."}; |
| 273 | } |
| 274 | |
Václav Kubernát | e811bfa | 2020-05-29 02:25:20 +0200 | [diff] [blame] | 275 | yang::NodeTypes StaticSchema::nodeType(const std::string& path) const |
Václav Kubernát | 34ee85a | 2020-02-18 17:12:12 +0100 | [diff] [blame] | 276 | { |
Václav Kubernát | e811bfa | 2020-05-29 02:25:20 +0200 | [diff] [blame] | 277 | auto locationString = stripLastNodeFromPath(path); |
| 278 | |
| 279 | auto node = fullNodeName(locationString, lastNodeOfSchemaPath(path)); |
| 280 | return std::visit(impl_nodeType{}, children(locationString).at(node).m_nodeType); |
Václav Kubernát | 34ee85a | 2020-02-18 17:12:12 +0100 | [diff] [blame] | 281 | } |
Václav Kubernát | ad87ece | 2020-02-19 15:20:56 +0100 | [diff] [blame] | 282 | |
Václav Kubernát | bd5e3c2 | 2020-02-19 15:22:00 +0100 | [diff] [blame] | 283 | std::string StaticSchema::leafrefPath([[maybe_unused]] const std::string& leafrefPath) const |
| 284 | { |
| 285 | throw std::runtime_error{"Internal error: StaticSchema::leafrefPath(std::string) not implemented. The tests should not have called this overload."}; |
| 286 | } |
Václav Kubernát | c386679 | 2020-02-20 14:12:56 +0100 | [diff] [blame] | 287 | |
| 288 | bool StaticSchema::leafIsKey([[maybe_unused]] const std::string& leafPath) const |
| 289 | { |
| 290 | throw std::runtime_error{"Internal error: StaticSchema::leafIsKey(std::string) not implemented. The tests should not have called this overload."}; |
| 291 | } |
Václav Kubernát | 6fcd028 | 2020-02-21 16:33:08 +0100 | [diff] [blame] | 292 | |
| 293 | std::optional<std::string> StaticSchema::leafTypeName([[maybe_unused]] const std::string& path) const |
| 294 | { |
| 295 | throw std::runtime_error{"Internal error: StaticSchema::leafTypeName(std::string) not implemented. The tests should not have called this overload."}; |
| 296 | } |
Václav Kubernát | 0599e9f | 2020-04-21 09:51:33 +0200 | [diff] [blame] | 297 | |
Václav Kubernát | b1a75c6 | 2020-04-21 15:20:16 +0200 | [diff] [blame] | 298 | std::optional<std::string> StaticSchema::defaultValue([[maybe_unused]] const std::string& leafPath) const |
| 299 | { |
| 300 | throw std::runtime_error{"Internal error: StaticSchema::defaultValue(std::string) not implemented. The tests should not have called this overload."}; |
| 301 | } |