Zao SDK for Jetson / libzao-endpoint API リファレンス 1.1.0.0 (2023-08-17)
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 "serial/FactoryInterface.hpp"
12#include "video/FactoryInterface.hpp"
13
14namespace spdlog {
15class logger;
16}
17
18namespace zao {
19namespace endpoint {
20
21class TimestampInterface;
22class ClientCallbackInterface;
23
28 public:
35 virtual void SetLinkPath(const std::string& link_path) = 0;
36
41 virtual const std::string& GetLinkPath() const noexcept = 0;
42
48 virtual void StartLink() = 0;
49
53 virtual void StopLink() = 0;
54
61 virtual bool IsLinked() const noexcept = 0;
62
69 virtual std::shared_future<std::string> GetLinkStatus() const = 0;
70
74 virtual std::unique_ptr<video::FactoryInterface> CreateVideoFactory() = 0;
75
79 virtual std::unique_ptr<audio::FactoryInterface> CreateAudioFactory() = 0;
80
84 virtual std::unique_ptr<serial::FactoryInterface> CreateSerialFactory() = 0;
85
89 virtual std::unique_ptr<control::FactoryInterface> CreateControlFactory() = 0;
90
98 virtual std::shared_ptr<TimestampInterface> CreateTimestamp(
99 std::intmax_t numerator, std::intmax_t denominator) = 0;
100
107 template <class Ratio>
109 return CreateTimestamp(Ratio::num, Ratio::den);
110 }
111
121 virtual void RegisterCallback(
122 const std::shared_ptr<ClientCallbackInterface>& listener,
123 bool use_weak_ptr = false) = 0;
124
133 virtual void RegisterCallback(
134 std::unique_ptr<ClientCallbackInterface>&& listener) = 0;
135
136 virtual ~ClientInterface() noexcept = default;
137};
138
143 public:
148 virtual void OnLink() {}
149
157 virtual void OnUnlink(bool stopped) {}
158
159#if 0
163 virtual void OnConnectCloud(/*TODO*/) {}
164
168 virtual void OnDisconnectCloud() {}
169#endif
170
171 virtual ~ClientCallbackInterface() noexcept = default;
172};
173
174} // namespace endpoint
175} // namespace zao
176
177#endif // ZAO_ENDPOINT_CLIENT_INTERFACE_HPP_
クライアント制御のコールバックインターフェース
Definition ClientInterface.hpp:142
virtual void OnUnlink(bool stopped)
クライアントプロセスとリンク(連携)が解除された時に 呼び出されるコールバック。
Definition ClientInterface.hpp:157
virtual void OnLink()
クライアントプロセスとリンク(連携)されたときに 呼び出されるコールバック。
Definition ClientInterface.hpp:148
エンドポイントのクライアント制御インターフェース
Definition ClientInterface.hpp:27
virtual void StopLink()=0
現在リンク(連携)しているクライアントと連携を解除する
virtual void StartLink()=0
クライアントとのリンク(連携)を開始する
virtual std::shared_future< std::string > GetLinkStatus() const =0
リンク(連携)の確立状態を返却するshared_futureを取得する。
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:108
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