AuboStudio SDK  0.6.3
tcp_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOP_TCP_MODEL_H
2#define AUBO_SCOP_TCP_MODEL_H
3
4#include <vector>
5#include <functional>
7
8namespace arcs {
9namespace aubo_scope {
11
12/**
13 * @ingroup ApplicationApi
14 * \chinese
15 * TCP 模型
16 * 此接口提供对 AuboScope 中当前可用的 TCP 的访问。
17 * \endchinese
18 * \english
19 * TcpModel
20 * This interface provides access to the TCPs that are currently available in
21 * AuboScope.
22 * \endenglish
23 */
25{
26public:
29 virtual ~TcpModel();
30
31 /**
32 * @ingroup TcpModel
33 * \chinese
34 * 获取AuboScope中所有TCP的集合
35 * @return 所有TCP的集合。
36 * \endchinese
37 * \english
38 * Returns a collection of all the TCPs in AuboScope.
39 * @return A collection of all the TCPs in AuboScope.
40 * \endenglish
41 */
42 std::vector<TCPPtr> getAll();
43
44 /**
45 * @ingroup TcpModel
46 * @ref TCP
47 * \chinese
48 * 根据名称获取TCP
49 * @param name TCP名称。
50 * @return 对应名称的TCP。
51 * \endchinese
52 * \english
53 * Get a TCP by name.
54 * @param name the name of the TCP.
55 * @return the TCP with the given name.
56 * \endenglish
57 */
58 TCPPtr getTcp(const std::string &name);
59
60 /**
61 * @ingroup TcpModel
62 * @ref TCP
63 * \chinese
64 * 获取默认TCP
65 * @return 默认TCP。
66 * \endchinese
67 * \english
68 * Returns the default TCP.
69 * @return the default TCP.
70 * \endenglish
71 */
72 TCPPtr getDefaultTcp();
73
74 /**
75 * @ingroup TcpModel
76 * \chinese
77 * 注册变更回调
78 * @param receiver 接收者标识。
79 * @param slot 回调函数。
80 * @return 连接标识符。
81 * \endchinese
82 * \english
83 * Register callback for changed.
84 * @param receiver the receiver identifier.
85 * @param slot the callback function.
86 * @return the connection identifier.
87 * \endenglish
88 */
89 std::string connectedTo(const std::string &receiver,
90 const std::function<void(TcpModel *)> &slot);
91 /**
92 * @ingroup TcpModel
93 * \chinese
94 * 断开回调连接
95 * @param receiver 接收者标识。
96 * \endchinese
97 * \english
98 * Disconnect a callback.
99 * @param receiver the receiver identifier.
100 * \endenglish
101 */
102 void disconnectFrom(const std::string &receiver);
103
104private:
105 friend class DataSwitch;
107 void *d_{ nullptr };
108};
109
110} // namespace aubo_scope
111} // namespace arcs
112
113#endif // AUBO_SCOP_TCP_MODEL_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
\chinese TCP 模型 此接口提供对 AuboScope 中当前可用的 TCP 的访问。 \endchinese \english TcpModel This interface provide...
TCPPtr getTcp(const std::string &name)
TCP \chinese 根据名称获取TCP
void disconnectFrom(const std::string &receiver)
\chinese 断开回调连接
TCPPtr getDefaultTcp()
TCP \chinese 获取默认TCP
std::vector< TCPPtr > getAll()
\chinese 获取AuboScope中所有TCP的集合
std::string connectedTo(const std::string &receiver, const std::function< void(TcpModel *)> &slot)
\chinese 注册变更回调