Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Václav Kubernát <kubernat@cesnet.cz> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #pragma once |
| 9 | #include "datastore_access.hpp" |
| 10 | |
| 11 | /*! \class ProxyDatastore |
| 12 | * \brief DatastoreAccess wrapper that handles RPC input |
| 13 | */ |
| 14 | class ProxyDatastore { |
| 15 | public: |
| 16 | ProxyDatastore(const std::shared_ptr<DatastoreAccess>& datastore); |
| 17 | [[nodiscard]] DatastoreAccess::Tree getItems(const std::string& path) const; |
| 18 | void setLeaf(const std::string& path, leaf_data_ value); |
| 19 | void createItem(const std::string& path); |
| 20 | void deleteItem(const std::string& path); |
| 21 | void moveItem(const std::string& source, std::variant<yang::move::Absolute, yang::move::Relative> move); |
| 22 | void commitChanges(); |
| 23 | void discardChanges(); |
| 24 | void copyConfig(const Datastore source, const Datastore destination); |
| 25 | [[nodiscard]] std::string dump(const DataFormat format) const; |
| 26 | |
| 27 | [[nodiscard]] std::shared_ptr<Schema> schema() const; |
| 28 | private: |
| 29 | std::shared_ptr<DatastoreAccess> m_datastore; |
| 30 | }; |