Rework Schema::units into Schema::leafType
Change-Id: I9c1f039e7e054f84559a3d57812d0254db183a99
diff --git a/src/leaf_data_type.hpp b/src/leaf_data_type.hpp
index a86691b..470c435 100644
--- a/src/leaf_data_type.hpp
+++ b/src/leaf_data_type.hpp
@@ -82,16 +82,23 @@
yang::LeafRef,
yang::Union
>;
+struct TypeInfo;
struct LeafRef {
LeafRef(const LeafRef& src);
- LeafRef(const std::string& xpath, std::unique_ptr<LeafDataType>&& type);
+ LeafRef(const std::string& xpath, std::unique_ptr<TypeInfo>&& type);
bool operator==(const LeafRef& other) const;
std::string m_targetXPath;
- std::unique_ptr<LeafDataType> m_targetType;
+ std::unique_ptr<TypeInfo> m_targetType;
};
struct Union {
bool operator==(const Union& other) const;
- std::vector<LeafDataType> m_unionTypes;
+ std::vector<TypeInfo> m_unionTypes;
+};
+struct TypeInfo {
+ TypeInfo(const yang::LeafDataType& type, const std::optional<std::string> units = std::nullopt);
+ bool operator==(const TypeInfo& other) const;
+ yang::LeafDataType m_type;
+ std::optional<std::string> m_units;
};
}