blob: 363096168166e898b48a82e5ac05e0c1e3551fb3 [file] [log] [blame]
Václav Kubernát80aacc02018-08-22 17:41:54 +02001/*
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
19class Connection;
20class Session;
21
22class SysrepoAccess : public DatastoreAccess {
23public:
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át812ee282018-08-30 17:10:03 +020031 void commitChanges() override;
32
Václav Kubernát80aacc02018-08-22 17:41:54 +020033private:
34 std::shared_ptr<Connection> m_connection;
35 std::shared_ptr<Session> m_session;
36};