blob: 36681a686b3ff54ba31428e869eefcf624d940bc [file] [log] [blame]
Václav Kubernát73109382018-09-14 19:52:03 +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 <memory>
12
13namespace sysrepo {
14class Callback;
15class Connection;
16class Session;
17class Subscribe;
18}
19class YangSchema;
20
21class Recorder {
22public:
23 virtual ~Recorder();
24 virtual void write(const std::string& xpath, const std::string& oldValue, const std::string& newValue) = 0;
25};
26
27class SysrepoSubscription {
28public:
29 SysrepoSubscription(Recorder* rec);
30
31private:
32 std::shared_ptr<sysrepo::Connection> m_connection;
33 std::shared_ptr<sysrepo::Session> m_session;
34 std::shared_ptr<YangSchema> m_schema;
35 std::shared_ptr<sysrepo::Callback> m_callback;
36 std::shared_ptr<sysrepo::Subscribe> m_subscription;
37};