Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
ClientInterface.hpp
1/*
2 * Copyright (c) 2022-2023, Soliton Systems K.K. All rights reserved.
3 * Use in source and binary forms, with or without modification,
4 * is permitted provided that the following a condition is met:
5 *
6 * Use is permitted only in accordance with the terms and
7 * conditions set forth in the Software License Agreement available
8 * at https://zao-sdk.org/license-agreement/.
9 */
10#ifndef ZEP_CLIENT_INTERFACE_HPP_
11#define ZEP_CLIENT_INTERFACE_HPP_
12
13#include <cstdint>
14#include <future>
15#include <memory>
16#include <string>
17
18#include "audio/FactoryInterface.hpp"
19#include "control/FactoryInterface.hpp"
20#include "serial/FactoryInterface.hpp"
21#include "video/FactoryInterface.hpp"
22
23namespace spdlog { class logger; }
24
25namespace zep {
26
27class TimestampInterface;
29
34 public:
41 virtual void SetLinkPath(const std::string& link_path) = 0;
42
47 virtual const std::string& GetLinkPath() const noexcept = 0;
48
54 virtual void StartLink() = 0;
55
59 virtual void StopLink() = 0;
60
67 virtual bool IsLinked() const noexcept = 0;
68
75 virtual std::shared_future<std::string> GetLinkStatus() const = 0;
76
83 virtual bool IsConnectedToCloud() const noexcept = 0;
84
90 virtual std::shared_future<void /*TODO*/> GetCloudConnectionStatus()
91 const = 0;
92
96 virtual std::unique_ptr<video::FactoryInterface> CreateVideoFactory() = 0;
97
101 virtual std::unique_ptr<audio::FactoryInterface> CreateAudioFactory() = 0;
102
106 virtual std::unique_ptr<serial::FactoryInterface> CreateSerialFactory() = 0;
107
111 virtual std::unique_ptr<control::FactoryInterface> CreateControlFactory() = 0;
112
120 virtual std::shared_ptr<TimestampInterface> CreateTimestamp(
121 std::intmax_t numerator, std::intmax_t denominator) = 0;
122
129 template <class Ratio>
131 return CreateTimestamp(Ratio::num, Ratio::den);
132 }
133
143 virtual void RegisterCallback(
144 const std::shared_ptr<ClientCallbackInterface>& listener,
145 bool use_weak_ptr = false) = 0;
146
155 virtual void RegisterCallback(
156 std::unique_ptr<ClientCallbackInterface>&& listener) = 0;
157
158 virtual ~ClientInterface() noexcept = default;
159};
160
165 public:
170 virtual void OnLink() {}
171
179 virtual void OnUnlink(bool stopped) {}
180
184 virtual void OnConnectCloud(/*TODO*/) {}
185
189 virtual void OnDisconnectCloud() {}
190
191 virtual ~ClientCallbackInterface() noexcept = default;
192};
193
194} // namespace zep
195
196#endif // ZEP_CLIENT_INTERFACE_HPP_
Client control callback interface.
Definition ClientInterface.hpp:164
クライアント制御のコールバックインターフェース
Definition ClientInterface.hpp:164
virtual void OnConnectCloud()
クラウド側と接続されたときに呼び出されるコールバック。
Definition ClientInterface.hpp:184
virtual void OnDisconnectCloud()
クラウド側から切断されたときに呼び出されるコールバック。
Definition ClientInterface.hpp:189
virtual void OnUnlink(bool stopped)
クライアントプロセスとリンク(連携)が解除された時に 呼び出されるコールバック。
Definition ClientInterface.hpp:179
virtual void OnLink()
クライアントプロセスとリンク(連携)されたときに 呼び出されるコールバック。
Definition ClientInterface.hpp:170
エンドポイントのクライアント制御インターフェース
Definition ClientInterface.hpp:33
virtual std::unique_ptr< video::FactoryInterface > CreateVideoFactory()=0
このClientに紐付いたVideoFactoryを生成する。
virtual const std::string & GetLinkPath() const noexcept=0
リンクに用いるパス文字列(プレフィックス付き)を取得する。
virtual std::unique_ptr< audio::FactoryInterface > CreateAudioFactory()=0
このClientに紐付いたAudioFactoryを生成する。
virtual void RegisterCallback(std::unique_ptr< ClientCallbackInterface > &&listener)=0
コールバックの送信先をunique_ptrで登録する
virtual std::unique_ptr< serial::FactoryInterface > CreateSerialFactory()=0
このClientに紐付いたSerialFactoryを生成する。
virtual void SetLinkPath(const std::string &link_path)=0
リンクに用いるパス文字列(プレフィックス付き)を設定する。
std::shared_ptr< TimestampInterface > CreateTimestamp()
タイムスタンプ管理オブジェクトをstd::ratioによる比率指示で生成する。
Definition ClientInterface.hpp:130
virtual std::shared_future< std::string > GetLinkStatus() const =0
リンク(連携)の確立状態を返却するshared_futureを取得する。
virtual void StartLink()=0
クライアントとのリンク(連携)を開始する
virtual bool IsLinked() const noexcept=0
現在リンク(連携)が成立しているか確認する。
virtual void StopLink()=0
現在リンク(連携)しているクライアントと連携を解除する
virtual void RegisterCallback(const std::shared_ptr< ClientCallbackInterface > &listener, bool use_weak_ptr=false)=0
コールバックの送信先をshared_ptrまたはweak_ptrで登録する
virtual std::unique_ptr< control::FactoryInterface > CreateControlFactory()=0
このClientに紐付いたControlFactoryを生成する。
virtual bool IsConnectedToCloud() const noexcept=0
クラウドと接続されているか確認する。
virtual std::shared_future< void > GetCloudConnectionStatus() const =0
クラウドとの接続状態を返却するshared_futureを取得する。
Interface to timestamp management functions.
Definition TimestampInterface.hpp:20
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19