blob: 1ca813df4e1500400c5577ee35fc7a1340099ae5 [file] [log] [blame]
/*
* Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
* Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
*
* Written by Václav Kubernát <kubervac@fit.cvut.cz>
*
*/
#pragma once
#include <string>
#include "ast_commands.hpp"
#include "datastore_access.hpp"
/*! \class DatastoreAccess
* \brief Abstract class for accessing a datastore
*/
class Connection;
class Session;
class Schema;
class YangSchema;
class SysrepoAccess : public DatastoreAccess {
public:
~SysrepoAccess() override;
SysrepoAccess(const std::string& appname);
std::map<std::string, leaf_data_> getItems(const std::string& path) override;
void setLeaf(const std::string& path, leaf_data_ value) override;
void createPresenceContainer(const std::string& path) override;
void deletePresenceContainer(const std::string& path) override;
std::string fetchSchema(const char* module, const char* revision, const char* submodule);
std::vector<std::string> listImplementedSchemas();
void commitChanges() override;
std::shared_ptr<Schema> schema();
private:
std::shared_ptr<Connection> m_connection;
std::shared_ptr<Session> m_session;
std::shared_ptr<YangSchema> m_schema;
};