Request YANG schemas via sysrepo
The std::function that is fed into YangSchema::registerModuleCallback
does not have the same signature that libyang requires, because we would
have to include libyang in the sysrepo_access header file. We don't want this
class to know about libyang, so instead, we use an intermediate function,
that has string arguments and a string return type. In YangSchema, this
function is wrapped with another function, that has the required signature.
Change-Id: Ibd2dcb89344cf1454ba0b3970cac0c8e88ffa20d
diff --git a/src/sysrepo_access.hpp b/src/sysrepo_access.hpp
index 3630961..1ca813d 100644
--- a/src/sysrepo_access.hpp
+++ b/src/sysrepo_access.hpp
@@ -18,6 +18,8 @@
class Connection;
class Session;
+class Schema;
+class YangSchema;
class SysrepoAccess : public DatastoreAccess {
public:
@@ -27,10 +29,15 @@
void setLeaf(const std::string& path, leaf_data_ value) override;
void createPresenceContainer(const std::string& path) override;
void deletePresenceContainer(const std::string& path) override;
+ std::string fetchSchema(const char* module, const char* revision, const char* submodule);
+ std::vector<std::string> listImplementedSchemas();
void commitChanges() override;
+ std::shared_ptr<Schema> schema();
+
private:
std::shared_ptr<Connection> m_connection;
std::shared_ptr<Session> m_session;
+ std::shared_ptr<YangSchema> m_schema;
};