blob: ab9193c70dfc861e220e684f56e4212986ca2228 [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#include "proxy_datastore.hpp"
8
9ProxyDatastore::ProxyDatastore(const std::shared_ptr<DatastoreAccess>& datastore)
10 : m_datastore(datastore)
11{
12}
13
14DatastoreAccess::Tree ProxyDatastore::getItems(const std::string& path) const
15{
16 return m_datastore->getItems(path);
17}
18
19void ProxyDatastore::setLeaf(const std::string& path, leaf_data_ value)
20{
21 m_datastore->setLeaf(path, value);
22}
23
24void ProxyDatastore::createItem(const std::string& path)
25{
26 m_datastore->createItem(path);
27}
28
29void ProxyDatastore::deleteItem(const std::string& path)
30{
31 m_datastore->deleteItem(path);
32}
33
34void ProxyDatastore::moveItem(const std::string& source, std::variant<yang::move::Absolute, yang::move::Relative> move)
35{
36 m_datastore->moveItem(source, move);
37}
38
39void ProxyDatastore::commitChanges()
40{
41 m_datastore->commitChanges();
42}
43
44void ProxyDatastore::discardChanges()
45{
46 m_datastore->discardChanges();
47}
48
49void ProxyDatastore::copyConfig(const Datastore source, const Datastore destination)
50{
51 m_datastore->copyConfig(source, destination);
52}
53
54std::string ProxyDatastore::dump(const DataFormat format) const
55{
56 return m_datastore->dump(format);
57}
58
59std::shared_ptr<Schema> ProxyDatastore::schema() const
60{
61 return m_datastore->schema();
62}