Move StaticSchema-specific stuff to static_schema.hpp
Change-Id: I44201d0e304095bad24d1b3b872b6719ec3229f8
diff --git a/src/schema.hpp b/src/schema.hpp
index 199cb96..64f743c 100644
--- a/src/schema.hpp
+++ b/src/schema.hpp
@@ -18,11 +18,6 @@
using ModuleValuePair = std::pair<boost::optional<std::string>, std::string>;
namespace yang {
-enum class ContainerTraits {
- Presence,
- None,
-};
-
enum class LeafDataTypes {
String,
Decimal,
@@ -39,22 +34,6 @@
Binary,
IdentityRef,
};
-
-struct container {
- yang::ContainerTraits m_presence;
-};
-struct list {
- std::set<std::string> m_keys;
-};
-
-struct leaf {
- yang::LeafDataTypes m_type;
- std::set<std::string> m_enumValues;
- ModuleValuePair m_identBase;
-};
-
-struct module {
-};
}
enum class Recursion {
@@ -67,8 +46,6 @@
WhenNeeded
};
-using NodeType = boost::variant<yang::container, yang::list, yang::leaf, yang::module>;
-
class InvalidNodeException : public std::invalid_argument {
public:
@@ -99,9 +76,4 @@
virtual const std::set<std::string> validIdentities(const schemaPath_& location, const ModuleNodePair& node, const Prefixes prefixes) const = 0;
virtual const std::set<std::string> enumValues(const schemaPath_& location, const ModuleNodePair& node) const = 0;
virtual std::set<std::string> childNodes(const schemaPath_& path, const Recursion recursion) const = 0;
-
-private:
- const std::unordered_map<std::string, NodeType>& children(const std::string& name) const;
-
- std::unordered_map<std::string, std::unordered_map<std::string, NodeType>> m_nodes;
};
diff --git a/src/static_schema.hpp b/src/static_schema.hpp
index 3121e0e..4af6793 100644
--- a/src/static_schema.hpp
+++ b/src/static_schema.hpp
@@ -13,6 +13,32 @@
#include "ast_path.hpp"
#include "schema.hpp"
+namespace yang {
+enum class ContainerTraits {
+ Presence,
+ None,
+};
+
+struct container {
+ yang::ContainerTraits m_presence;
+};
+struct list {
+ std::set<std::string> m_keys;
+};
+
+struct leaf {
+ yang::LeafDataTypes m_type;
+ std::set<std::string> m_enumValues;
+ ModuleValuePair m_identBase;
+};
+
+struct module {
+};
+}
+
+using NodeType = boost::variant<yang::container, yang::list, yang::leaf, yang::module>;
+
+
/*! \class StaticSchema
* \brief Static schema, used mainly for testing