Clean up DatastoreAccess' interface
The schema() getter is supposed to be a part of the public interface.
The other methods within SysrepoAccess are just an implementation
detail, though.
Change-Id: I0599dcd1609568c45aecd8dec4c5df4d1b629e6d
diff --git a/src/datastore_access.hpp b/src/datastore_access.hpp
index 67b3d29..72e3553 100644
--- a/src/datastore_access.hpp
+++ b/src/datastore_access.hpp
@@ -34,6 +34,8 @@
std::string m_what;
};
+class Schema;
+
class DatastoreAccess {
public:
virtual ~DatastoreAccess() = 0;
@@ -44,6 +46,8 @@
virtual void createListInstance(const std::string& path) = 0;
virtual void deleteListInstance(const std::string& path) = 0;
+ virtual std::shared_ptr<Schema> schema() = 0;
+
virtual void commitChanges() = 0;
virtual void discardChanges() = 0;
};
diff --git a/src/sysrepo_access.hpp b/src/sysrepo_access.hpp
index 97d229e..a771360 100644
--- a/src/sysrepo_access.hpp
+++ b/src/sysrepo_access.hpp
@@ -34,17 +34,18 @@
void deletePresenceContainer(const std::string& path) override;
void createListInstance(const std::string& path) override;
void deleteListInstance(const std::string& path) override;
- std::string fetchSchema(const char* module, const char* revision, const char* submodule);
- std::vector<std::string> listImplementedSchemas();
+
+ std::shared_ptr<Schema> schema() override;
void commitChanges() override;
void discardChanges() override;
- std::shared_ptr<Schema> schema();
-
private:
[[noreturn]] void reportErrors();
+ std::string fetchSchema(const char* module, const char* revision, const char* submodule);
+ std::vector<std::string> listImplementedSchemas();
+
std::shared_ptr<sysrepo::Connection> m_connection;
std::shared_ptr<sysrepo::Session> m_session;
std::shared_ptr<YangSchema> m_schema;