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 | |
Václav Kubernát | 812ee28 | 2018-08-30 17:10:03 +0200 | [diff] [blame] | 31 | void commitChanges() override; |
| 32 | |
Václav Kubernát | 80aacc0 | 2018-08-22 17:41:54 +0200 | [diff] [blame] | 33 | private: |
| 34 | std::shared_ptr<Connection> m_connection; |
| 35 | std::shared_ptr<Session> m_session; |
| 36 | }; |