AuboStudio SDK  0.6.3
program_node_contribution.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_PROGRAM_NODE_CONTRIBUTION_H
2#define AUBO_SCOPE_PROGRAM_NODE_CONTRIBUTION_H
3
4#include <string>
7
8namespace arcs {
9namespace aubo_scope {
11
12/**
13 * Defines an API required for specifying a AuboCap Program Node within
14 * AuboScope.
15 */
17{
18public:
19 virtual ~ProgramNodeContribution() = default;
20
21 /**
22 * Called when this node is selected in the program tree.
23 */
24 virtual void openView() = 0;
25
26 /**
27 * Called when this node is unselected in the program tree or when
28 * navigating to another view.
29 */
30 virtual void closeView() = 0;
31
32 /**
33 *
34 * @return The text displayed in the Program Tree for the program node.
35 * @throws IllegalStateException if the data model or child program
36 * sub-tree is modified
37 */
38 virtual std::string getTitle() = 0;
39
40 /**
41 * <p>
42 * Should return <code>true</code> if this program node is complete, and
43 * <code>false</code> otherwise.
44 * </p>
45 *
46 * <p>
47 * Undefined program nodes will be marked with yellow in the program
48 * tree. The user cannot start the program as long as it contains one or
49 * more undefined program nodes.
50 * </p>
51 *
52 * If this program node stores an unresolvable entity (e.g. {@link
53 * variable/PersistedVariable} or {@link tcp/TCP}) in its DataModel, the
54 * program node will be treated as undefined.
55 *
56 * @return <code>true</code> if this program node is complete and otherwise
57 * <code>false</code>.
58 * @throws IllegalStateException if the data model or child program
59 * sub-tree is modified.
60 */
61 virtual bool isDefined() = 0;
62
63 /**
64 * Defines the script code to be generated by this program node within
65 * the program.
66 *
67 * @param writer serves to add script commands that define the behaviour
68 * of this program node.
69 */
70 virtual void generateScript(ScriptWriterPtr script_writer) = 0;
71
72 /**
73 * @brief post
74 * @param pattern
75 * @param body
76 * @return
77 */
78 virtual std::string postAction(const char *pattern, const std::string &body)
79 {
80 return "";
81 }
82
83 /**
84 * @brief GET
85 * @param pattern
86 * @param body
87 * @return
88 */
89 virtual std::string getAction(const char *pattern, const std::string &body)
90 {
91 return "";
92 }
93};
94
95} // namespace aubo_scope
96} // namespace arcs
97
98#endif // AUBO_SCOPE_PROGRAM_NODE_CONTRIBUTION_H
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
Defines an API required for specifying a AuboCap Program Node within AuboScope.
virtual void openView()=0
Called when this node is selected in the program tree.
virtual void closeView()=0
Called when this node is unselected in the program tree or when navigating to another view.
virtual std::string postAction(const char *pattern, const std::string &body)
post
virtual std::string getAction(const char *pattern, const std::string &body)
GET
virtual void generateScript(ScriptWriterPtr script_writer)=0
Defines the script code to be generated by this program node within the program.