blob: 0ed5e2dc7279699f9cd9a7759c8f76f5c0e8bddf [file] [log] [blame]
Václav Kubernát48e9dfa2020-07-08 10:55:12 +02001/*
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 */
14class ProxyDatastore {
15public:
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;
28private:
29 std::shared_ptr<DatastoreAccess> m_datastore;
30};