AuboStudio SDK  0.6.3
contribution_provider.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_CONTRIBUTION_PROVIDER_H
2#define AUBO_SCOPE_CONTRIBUTION_PROVIDER_H
3
4#include <memory>
6
7namespace arcs {
8namespace aubo_scope {
9
10/**
11 * \chinese
12 * 贡献提供者
13 * 此接口提供对贡献的访问。
14 *
15 * 注意:此接口不适用于具有基于 HTML 用户界面的贡献。
16 *
17 * @tparam <T> 表示接口提供访问的贡献类型的(通用)类型参数
18 * \endchinese
19 * \english
20 * ContributionProvider
21 * This interfaces provides access to a contribution.
22 *
23 * NOTE: This interface is not relevant for contributions with a HTML-based user
24 * interface.
25 *
26 * @tparam <T> the (generic) type parameter for the interface representing the
27 * type of contribution the interface provides access to
28 * \endenglish
29 */
30template <class T>
32{
33public:
34 virtual ~ContributionProvider() = default;
35
36 /**
37 * \chinese
38 * 获取一个贡献。在用户操作的结果中调用此方法以获取当前选中的节点。
39 *
40 * @return 相关的贡献
41 * \endchinese
42 * \english
43 * Gets a contribution. Call this as the result of a user action to get the
44 * currently selected node.
45 *
46 * @return the relevant contribution
47 * \endenglish
48 */
49 virtual T *get() = 0;
50};
51
52template <class T>
53using ContributionProviderPtr = std::shared_ptr<ContributionProvider<T>>;
54
55} // namespace aubo_scope
56} // namespace arcs
57
58#endif // AUBO_SCOPE_CONTRIBUTION_PROVIDER_H
\chinese 贡献提供者 此接口提供对贡献的访问。
virtual T * get()=0
\chinese 获取一个贡献。在用户操作的结果中调用此方法以获取当前选中的节点。
std::shared_ptr< ContributionProvider< T > > ContributionProviderPtr