Václav Kubernát | 7310938 | 2018-09-14 19:52:03 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | namespace sysrepo { |
| 14 | class Callback; |
| 15 | class Connection; |
| 16 | class Session; |
| 17 | class Subscribe; |
| 18 | } |
| 19 | class YangSchema; |
| 20 | |
| 21 | class Recorder { |
| 22 | public: |
| 23 | virtual ~Recorder(); |
| 24 | virtual void write(const std::string& xpath, const std::string& oldValue, const std::string& newValue) = 0; |
| 25 | }; |
| 26 | |
| 27 | class SysrepoSubscription { |
| 28 | public: |
| 29 | SysrepoSubscription(Recorder* rec); |
| 30 | |
| 31 | private: |
| 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 | }; |