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