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> #include <string>
16#include <string>
17
18#include "audio/FactoryInterface.hpp"
19#include "control/FactoryInterface.hpp"
20#include "serial/FactoryInterface.hpp" #include "serial/FactoryInterface.hpp"
21#include "video/FactoryInterface.hpp" #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 virtual std::shared_ptr<ptr
120 virtual std::shared_ptr<TimestampInterface> CreateTimestamp(
121 std::intmax_t numerator, std::intmax_t denominator) = 0;
122
129 template <class Ratio>
130 std::shared_ptr<TimestampInterface> CreateTimestamp() {
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
virtual void OnLink()
The callback that is called when linked (linked) to a client process.
Definition ClientInterface.hpp:170
virtual void OnUnlink(bool stopped)
Callback that is called when a client process is unlinked (linked) to a client process....
Definition ClientInterface.hpp:179
virtual void OnDisconnectCloud()
Callback called when disconnected from the cloud side.
Definition ClientInterface.hpp:189
virtual void OnConnectCloud()
Callback called when connected to the cloud side.
Definition ClientInterface.hpp:184
Client control interface for endpoints.
Definition ClientInterface.hpp:33
virtual std::shared_future< void > GetCloudConnectionStatus() const =0
Get shared_future which returns the status of connection to the cloud.
virtual std::unique_ptr< control::FactoryInterface > CreateControlFactory()=0
Create a ControlFactory associated with this Client.
virtual std::shared_future< std::string > GetLinkStatus() const =0
Get shared_future which returns the status of establishment of the link (linkage).
virtual std::unique_ptr< audio::FactoryInterface > CreateAudioFactory()=0
Create an AudioFactory associated with this Client.
virtual void StopLink()=0
Break linkage with the currently linked (linked) client.
virtual bool IsLinked() const noexcept=0
Check whether the link (linkage) is currently established.
virtual const std::string & GetLinkPath() const noexcept=0
Get the path string (with prefix) to use for the link.
virtual void StartLink()=0
Initiate link (linkage) with client.
virtual void SetLinkPath(const std::string &link_path)=0
Set the path string (with prefix) to be used for the link.
virtual bool IsConnectedToCloud() const noexcept=0
Check if it is connected to the cloud.
virtual std::unique_ptr< serial::FactoryInterface > CreateSerialFactory()=0
Create a SerialFactory associated with this Client.
virtual std::unique_ptr< video::FactoryInterface > CreateVideoFactory()=0
Generate a VideoFactory associated with this Client.
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19