AuboStudio SDK  0.6.3
program_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_PROGRAM_MODEL_H
2#define AUBO_SCOPE_PROGRAM_MODEL_H
3
7
8namespace arcs {
9namespace aubo_scope {
11
12/**
13 * @ingroup ProgramApi
14 * \chinese
15 * 程序模型
16 * <h1>概述</h1>
17 * 此接口使得修改 AuboStudio 插件的子树成为可能。树的结构与节点的内容相分离。
18 * {@link TreeNode} 接口关注树的结构,而 {@link ProgramNode} 接口处理树节点的具体内容。
19 *
20 * <h1>程序修改入门</h1>
21 * ProgramModel 包含:
22 * <ul>
23 * <li>getProgramNodeFactory() - 可以创建新的程序节点(包括 AuboScope
24 * 内置节点和 AuboCap 程序节点)。</li>
25 * <li>getRootTreeNode(ProgramNodeContribution root) - 返回给定 AuboCap
26 * ProgramNodeContribution 的子树</li>
27 * </ul>
28 *
29 * TreeNode 接口支持节点的插入和删除。使用它可以获取特定节点的子节点列表。对树节点
30 * 调用 lockChildSequence 会锁定该节点下的直接子节点。即终端用户无法重新排列、删除
31 * 子节点或将其他节点插入到子节点序列中。
32 * \endchinese
33 * \english
34 * ProgramModel
35 * <h1>Summary</h1>
36 * This interface makes it possible to modify sub-trees of aubo_studio plugins.
37 * The structure of trees is separated from the contents of the nodes.
38 * The {@link TreeNode} interface is concerned with the structure of trees
39 * whereas the {@link ProgramNode} interface deals with the concrete content of
40 * the nodes of the tree.
41 *
42 * <h1>Getting started with program modification</h1>
43 * A ProgramModel contains a:
44 * <ul>
45 * <li>getProgramNodeFactory() - that makes it possible to create new
46 * program nodes (both built-in AuboScope nodes and AuboCap program nodes).
47 * </li> <li>getRootTreeNode(ProgramNodeContribution root)} - returns the
48 * sub-tree of a given AuboCap ProgramNodeContribution</li>
49 * </ul>
50 *
51 * The TreeNode interface supports insertion and removal of nodes. With it you
52 * can retrieve the list of children of particular nodes. Calling
53 * lockChildSequence on a tree node, locks the immediate children under the
54 * node. I.e. children can not be rearranged, deleted or have other nodes
55 * inserted into the child sequence by the end user.
56 * \endenglish
57 */
59{
60public:
63 virtual ~ProgramModel();
64
65 /**
66 * \chinese
67 * 返回一个 ProgramNodeFactory 用于创建程序节点。
68 *
69 * @return 用于创建程序节点的工厂
70 * \endchinese
71 * \english
72 * This method returns a {@link ProgramNodeFactory} to create program nodes.
73 *
74 * @return the factory to create program nodes.
75 * \endenglish
76 */
77 ProgramNodeFactoryPtr getProgramNodeFactory();
78
79 /**
80 * \chinese
81 * 从 ProgramNodeContribution 获取 TreeNode 根节点。从这里可以添加子节点
82 * 以形成子树。
83 *
84 * @param root 要作为子树根的 AuboCap 程序节点
85 * @return TreeNode 根节点
86 * \endchinese
87 * \english
88 * Gets the {@link TreeNode} root from {@link ProgramNodeContribution}. From
89 * here, children can be added to form a sub-tree.
90 *
91 * @param root The AuboCap program node where a sub-tree is to be rooted.
92 * @return Returns a {@link TreeNode} root.
93 * \endenglish
94 */
96
97private:
98 friend class DataSwitch;
100 void *d_{ nullptr };
101};
102
103} // namespace aubo_scope
104} // namespace arcs
105
106#endif // AUBO_SCOPE_PROGRAM_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...
ProgramModel(ProgramModel &&f)
TreeNodePtr getTreeNode(ProgramNodeContribution *root)
\chinese 从 ProgramNodeContribution 获取 TreeNode 根节点。从这里可以添加子节点 以形成子树。
ProgramNodeFactoryPtr getProgramNodeFactory()
\chinese 返回一个 ProgramNodeFactory 用于创建程序节点。
\chinese 程序节点贡献 定义了在 AuboScope 中指定 AuboCap 程序节点所需的 API。 \endchinese \english ProgramNodeContribution ...