Václav Kubernát | 80aacc0 | 2018-08-22 17:41:54 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/ |
| 3 | * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/ |
| 4 | * |
| 5 | * Written by Václav Kubernát <kubervac@fit.cvut.cz> |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include <string> |
| 12 | #include "ast_commands.hpp" |
| 13 | #include "datastore_access.hpp" |
| 14 | |
| 15 | /*! \class DatastoreAccess |
| 16 | * \brief Abstract class for accessing a datastore |
| 17 | */ |
| 18 | |
| 19 | class Connection; |
| 20 | class Session; |
| 21 | |
| 22 | class SysrepoAccess : public DatastoreAccess { |
| 23 | public: |
| 24 | ~SysrepoAccess() override; |
| 25 | SysrepoAccess(const std::string& appname); |
| 26 | std::map<std::string, leaf_data_> getItems(const std::string& path) override; |
| 27 | void setLeaf(const std::string& path, leaf_data_ value) override; |
| 28 | void createPresenceContainer(const std::string& path) override; |
| 29 | void deletePresenceContainer(const std::string& path) override; |
| 30 | |
| 31 | private: |
| 32 | std::shared_ptr<Connection> m_connection; |
| 33 | std::shared_ptr<Session> m_session; |
| 34 | }; |