Implement SysrepoAccess
The class is currently only able to set leaf values and create and
delete presence containers.
Change-Id: I3b187fa359a766a7bec2da5772e50ebb6bde7b15
diff --git a/src/sysrepo_access.hpp b/src/sysrepo_access.hpp
new file mode 100644
index 0000000..0a9f57b
--- /dev/null
+++ b/src/sysrepo_access.hpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
+ * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
+ *
+ * Written by Václav Kubernát <kubervac@fit.cvut.cz>
+ *
+*/
+
+#pragma once
+
+#include <string>
+#include "ast_commands.hpp"
+#include "datastore_access.hpp"
+
+/*! \class DatastoreAccess
+ * \brief Abstract class for accessing a datastore
+ */
+
+class Connection;
+class Session;
+
+class SysrepoAccess : public DatastoreAccess {
+public:
+ ~SysrepoAccess() override;
+ SysrepoAccess(const std::string& appname);
+ std::map<std::string, leaf_data_> getItems(const std::string& path) override;
+ void setLeaf(const std::string& path, leaf_data_ value) override;
+ void createPresenceContainer(const std::string& path) override;
+ void deletePresenceContainer(const std::string& path) override;
+
+private:
+ std::shared_ptr<Connection> m_connection;
+ std::shared_ptr<Session> m_session;
+};