Zao SDK for Jetson / libzao-endpoint API リファレンス 1.2.0.0 (2023-10-30)
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 "audio/FactoryInterface.hpp"
10#include "control/FactoryInterface.hpp"
11#include "monitor/FactoryInterface.hpp"
12#include "serial/FactoryInterface.hpp"
13#include "video/FactoryInterface.hpp"
14
15namespace spdlog {
16class logger;
17}
18
19namespace zao {
20namespace endpoint {
21
22class TimestampInterface;
23class ClientCallbackInterface;
24
29 public:
36 virtual void SetLinkPath(const std::string& link_path) = 0;
37
42 virtual const std::string& GetLinkPath() const noexcept = 0;
43
50 virtual void StartLink() = 0;
51
55 virtual void StopLink() = 0;
56
63 virtual bool IsLinked() const noexcept = 0;
64
72 virtual std::shared_future<std::string> GetLinkStatus() const = 0;
73
77 virtual std::unique_ptr<video::FactoryInterface> CreateVideoFactory() = 0;
78
82 virtual std::unique_ptr<audio::FactoryInterface> CreateAudioFactory() = 0;
83
87 virtual std::unique_ptr<serial::FactoryInterface> CreateSerialFactory() = 0;
88
92 virtual std::unique_ptr<control::FactoryInterface> CreateControlFactory() = 0;
93
97 virtual std::unique_ptr<monitor::FactoryInterface> CreateMonitorFactory() = 0;
98
106 virtual std::shared_ptr<TimestampInterface> CreateTimestamp(
107 std::intmax_t numerator, std::intmax_t denominator) = 0;
108
116 template <class Ratio>
118 return CreateTimestamp(Ratio::num, Ratio::den);
119 }
120
131 virtual void RegisterCallback(
132 const std::shared_ptr<ClientCallbackInterface>& listener,
133 bool use_weak_ptr = false) = 0;
134
144 virtual void RegisterCallback(
145 std::unique_ptr<ClientCallbackInterface>&& listener) = 0;
146
147 virtual ~ClientInterface() noexcept = default;
148};
149
154 public:
159 virtual void OnLink() {}
160
168 virtual void OnUnlink(bool stopped) {}
169
170#if 0
174 virtual void OnConnectCloud(/*TODO*/) {}
175
179 virtual void OnDisconnectCloud() {}
180#endif
181
182 virtual ~ClientCallbackInterface() noexcept = default;
183};
184
185} // namespace endpoint
186} // namespace zao
187
188#endif // ZAO_ENDPOINT_CLIENT_INTERFACE_HPP_
クライアント制御のコールバックインターフェース
Definition ClientInterface.hpp:153
virtual void OnUnlink(bool stopped)
クライアントプロセスとリンク(連携)が解除された時に 呼び出されるコールバック。
Definition ClientInterface.hpp:168
virtual void OnLink()
クライアントプロセスとリンク(連携)されたときに 呼び出されるコールバック。
Definition ClientInterface.hpp:159
エンドポイントのクライアント制御インターフェース
Definition ClientInterface.hpp:28
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 void RegisterCallback(std::unique_ptr< ClientCallbackInterface > &&listener)=0
コールバックの送信先をunique_ptrで登録する
virtual std::unique_ptr< audio::FactoryInterface > CreateAudioFactory()=0
このClientに紐付いたAudioFactoryを生成する。
std::shared_ptr< TimestampInterface > CreateTimestamp()
タイムスタンプ管理オブジェクトを std::ratioによる比率指示で生成する。
Definition ClientInterface.hpp:117
virtual const std::string & GetLinkPath() const noexcept=0
リンクに用いるパス文字列(プレフィックス付き)を取得する。
virtual std::unique_ptr< control::FactoryInterface > CreateControlFactory()=0
このClientに紐付いたControlFactoryを生成する。
virtual void RegisterCallback(const std::shared_ptr< ClientCallbackInterface > &listener, bool use_weak_ptr=false)=0
コールバックの送信先をshared_ptrまたはweak_ptrで登録する
タイムスタンプ管理機能のインターフェース
Definition TimestampInterface.hpp:12
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11