AuboStudio SDK  0.6.3
io_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_IO_MODEL_H
2#define AUBO_SCOPE_IO_MODEL_H
3
4#include <vector>
5#include <functional>
8
9namespace arcs {
10namespace aubo_scope {
12
13/**
14 * @ingroup ApplicationApi
15 * \chinese
16 * IO 模型
17 * 提供从当前机器人安装中获取 I/O 的方法。
18 * \endchinese
19 * \english
20 * IoModel
21 * Provides methods that returns I/Os from the current robot installation.
22 * \endenglish
23 */
25{
26public:
30
31 /**
32 * @ingroup IoModel
33 * \chinese
34 * 获取所有可用的I/O集合
35 * @return 可用I/O的集合。
36 * \endchinese
37 * \english
38 * Returns the collection of available I/Os, including Modbus, EuroMap67 and
39 * named General Purpose Registers.
40 * @return the collection of available I/Os.
41 * \endenglish
42 */
43 std::vector<IoPtr> getAll();
44
45 /**
46 * @ingroup IoModel
47 * @ref Io
48 * \chinese
49 * 根据名称获取I/O
50 * @param name I/O名称。
51 * @return 对应名称的I/O。
52 * \endchinese
53 * \english
54 * Get an I/O by name.
55 * @param name the name of the I/O.
56 * @return the I/O with the given name.
57 * \endenglish
58 */
59 IoPtr getIo(const std::string &name);
60
61 /**
62 * @ingroup IoModel
63 * \chinese
64 * 使用过滤器获取I/O子集
65 * @param filter 过滤器。
66 * @return 被过滤器接受的I/O集合。
67 * \endchinese
68 * \english
69 * Get a subset of I/Os using a filter.
70 * @param filter see {@link IOFilterFactory}.
71 * @return the collection of IOs that are accepted by the filter.
72 * \endenglish
73 */
74 std::vector<IoPtr> getIos(std::function<bool(IoPtr)> filter);
75
76private:
77 friend class DataSwitch;
79 void *d_{ nullptr };
80};
81
82} // namespace aubo_scope
83} // namespace arcs
84#endif
#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 IO 模型 提供从当前机器人安装中获取 I/O 的方法。 \endchinese \english IoModel Provides methods that returns I/Os...
std::vector< IoPtr > getAll()
\chinese 获取所有可用的I/O集合
std::vector< IoPtr > getIos(std::function< bool(IoPtr)> filter)
\chinese 使用过滤器获取I/O子集
IoPtr getIo(const std::string &name)
Io \chinese 根据名称获取I/O