Zao SDK for Jetson / libzao-endpoint API リファレンス 1.5.0.0 (2024-09-25)
Loading...
Searching...
No Matches
ClientInterface.hpp
1#ifndef ZAO_ENDPOINT_CLIENT_INTERFACE_HPP_
2#define ZAO_ENDPOINT_CLIENT_INTERFACE_HPP_
3
4#include <cstdint>
5#include <future>
6#include <memory>
7#include <string>
8
9#include "EventSourceInterface.hpp"
10#include "audio/FactoryInterface.hpp"
11#include "control/FactoryInterface.hpp"
12#include "monitor/FactoryInterface.hpp"
13#include "serial/FactoryInterface.hpp"
14#include "video/FactoryInterface.hpp"
15
16namespace spdlog {
17class logger;
18}
19
20namespace zao {
21namespace endpoint {
22
23class TimestampInterface;
24class ClientCallbackInterface;
25
30class ClientInterface : public EventSourceInterface<ClientCallbackInterface> {
31 public:
41 virtual void SetLinkPath(const std::string& link_path) = 0;
42
49 virtual const std::string& GetLinkPath() const noexcept = 0;
50
60 virtual void StartLink() = 0;
61
66 virtual void StopLink() = 0;
67
77 virtual bool IsLinked() const noexcept = 0;
78
91 virtual std::shared_future<std::string> GetLinkStatus() const = 0;
92
97 virtual std::unique_ptr<video::FactoryInterface> CreateVideoFactory() = 0;
98
103 virtual std::unique_ptr<audio::FactoryInterface> CreateAudioFactory() = 0;
104
109 virtual std::unique_ptr<serial::FactoryInterface> CreateSerialFactory() = 0;
110
115 virtual std::unique_ptr<control::FactoryInterface> CreateControlFactory() = 0;
116
120 virtual std::unique_ptr<monitor::FactoryInterface> CreateMonitorFactory() = 0;
121
134 virtual std::shared_ptr<TimestampInterface> CreateTimestamp(
135 std::intmax_t numerator, std::intmax_t denominator) = 0;
136
149 template <class Ratio>
151 return CreateTimestamp(Ratio::num, Ratio::den);
152 }
153
154 virtual ~ClientInterface() noexcept = default;
155};
156
162 public:
169 virtual void OnLink() {}
170
183 virtual void OnUnlink(bool stopped) {}
184
185#if 0
190 virtual void OnConnectCloud(/*TODO*/) {}
191
196 virtual void OnDisconnectCloud() {}
197#endif
198
199 virtual ~ClientCallbackInterface() noexcept = default;
200};
201
202} // namespace endpoint
203} // namespace zao
204
205#endif // ZAO_ENDPOINT_CLIENT_INTERFACE_HPP_
クライアント制御のコールバックインターフェース
Definition ClientInterface.hpp:161
virtual void OnUnlink(bool stopped)
クライアントプロセスとリンク(連携)が解除された時に 呼び出されるコールバック。
Definition ClientInterface.hpp:183
virtual void OnLink()
クライアントプロセスとリンク(連携)されたときに 呼び出されるコールバック。
Definition ClientInterface.hpp:169
エンドポイントのクライアント制御インターフェース
Definition ClientInterface.hpp:30
virtual void StopLink()=0
現在リンク(連携)しているクライアントと連携を解除する
virtual void StartLink()=0
クライアントとのリンク(連携)を開始する
virtual std::shared_future< std::string > GetLinkStatus() const =0
リンク(連携)の確立状態を返却するshared_futureを取得する。
virtual std::unique_ptr< monitor::FactoryInterface > CreateMonitorFactory()=0
このClientに紐付いたMonitorFactoryを生成する。
virtual std::unique_ptr< video::FactoryInterface > CreateVideoFactory()=0
このClientに紐付いたVideoFactoryを生成する。
virtual bool IsLinked() const noexcept=0
現在リンク(連携)が成立しているか確認する。
virtual void SetLinkPath(const std::string &link_path)=0
リンクに用いるパス文字列(プレフィックス付き)を設定する。
virtual std::unique_ptr< serial::FactoryInterface > CreateSerialFactory()=0
このClientに紐付いたSerialFactoryを生成する。
virtual std::unique_ptr< audio::FactoryInterface > CreateAudioFactory()=0
このClientに紐付いたAudioFactoryを生成する。
std::shared_ptr< TimestampInterface > CreateTimestamp()
タイムスタンプ管理オブジェクトを std::ratioによる比率指示で生成する。
Definition ClientInterface.hpp:150
virtual const std::string & GetLinkPath() const noexcept=0
リンクに用いるパス文字列(プレフィックス付き)を取得する。
virtual std::unique_ptr< control::FactoryInterface > CreateControlFactory()=0
このClientに紐付いたControlFactoryを生成する。
イベントを生成するクラスの共通インターフェース
Definition EventSourceInterface.hpp:27
タイムスタンプ管理機能のインターフェース
Definition TimestampInterface.hpp:13
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11