Gocator API
 All Classes Files Functions Variables Typedefs Macros Groups Pages
GoTools.h
Go to the documentation of this file.
1 /**
2  * @file GoTools.h
3  * @brief Declares the GoTool classes.
4  *
5  * @internal
6  * Copyright (C) 2014 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef GO_TOOLS_H
11 #define GO_TOOLS_H
12 
13 #include <GoSdk/GoSdkDef.h>
14 #include <GoSdk/Tools/GoTool.h>
16 #include <GoSdk/Tools/GoRangeTools.h>
18 
20 
21 /**
22  * @class GoTools
23  * @extends kObject
24  * @ingroup GoSdk-Tools
25  * @brief Represents a collection of tools.
26  */
27 typedef kObject GoTools;
28 
29 /**
30  * Returns the current number of tools.
31  *
32  * @public @memberof GoTools
33  * @param tools GoTools object.
34  * @return The current tool count.
35  */
36 GoFx(kSize) GoTools_ToolCount(GoTools tools);
37 
38 /**
39  * Returns a tool handle at the given index.
40  *
41  * @public @memberof GoTools
42  * @param tools GoTools object.
43  * @param index The index with which to retrieve a tool.
44  * @return A handle to a tool at the given index or kNULL if the index is invalid.
45  */
46 GoFx(GoTool) GoTools_ToolAt(GoTools tools, kSize index);
47 
48 /**
49  * Adds a tool and returns a handle to it.
50  *
51  * @public @memberof GoTools
52  * @param tools GoTools object.
53  * @param type The tool type enumerator value representing the type of tool to add.
54  * @param tool A pointer to the newly added tool.
55  * @return Operation status.
56  */
57 GoFx(kStatus) GoTools_AddTool(GoTools tools, GoToolType type, GoTool* tool);
58 
59 /**
60  * Removes a tool at the given index.
61  *
62  * @public @memberof GoTools
63  * @param tools GoTools object.
64  * @param index The index with which to remove a tool.
65  * @return Operation status.
66  */
67 GoFx(kStatus) GoTools_RemoveTool(GoTools tools, kSize index);
68 
69 /**
70  * Removes all tools in the given GoTools instance.
71  *
72  * @public @memberof GoTools
73  * @param tools GoTools object.
74  * @return Operation status.
75  */
76 GoFx(kStatus) GoTools_ClearTools(GoTools tools);
77 
78 /**
79  * Returns an enabled measurement handle if the specified ID is valid.
80  *
81  * @public @memberof GoTools
82  * @param tools GoTools object.
83  * @param id The measurement ID to search for.
84  * @return A GoMeasurement object if an enabled measurement with the ID is found, otherwise kNULL.
85  */
86 GoFx(GoMeasurement) GoTools_FindMeasurementById(GoTool tools, k32u id);
87 
88 /**
89  * Automatically update a given measurement to use a valid ID within the set of tools contained in the GoTools object.
90  *
91  * @public @memberof GoTools
92  * @param tools GoTools object.
93  * @param measurement GoMeasurement object to update.
94  * @return Operation status.
95  */
96 GoFx(kStatus) GoTools_AssignMeasurementId(GoTools tools, GoMeasurement measurement);
97 
98 
99 /**
100  * @class GoScript
101  * @extends GoTool
102  * @ingroup GoSdk-Tools
103  * @brief Represents a script tool.
104  */
105 typedef GoTool GoScript;
106 
107 /**
108  * Gets the code for the script.
109  *
110  * @public @memberof GoScript
111  * @param tool GoScript object.
112  * @param code Receives a null-terminated string containing the script code.
113  * @return Operation status.
114  */
115 GoFx(kStatus) GoScript_Code(GoScript tool, kChar** code);
116 
117 /**
118  * Sets the code for the script.
119  *
120  * @public @memberof GoScript
121  * @param tool GoScript object.
122  * @param code The code to set.
123  * @return Operation status.
124  */
125 GoFx(kStatus) GoScript_SetCode(GoScript tool, kChar* code);
126 
127 /**
128  * Adds a script output.
129  *
130  * @public @memberof GoScript
131  * @param tool GoScript object.
132  * @param id An ID(must not already be used by other measurements) of the script output to add.
133  * @return Operation status.
134  */
135 GoFx(kStatus) GoScript_AddOutput(GoScript tool, k32u id);
136 
137 /**
138  * Removes a script output with the specific ID.
139  *
140  * @public @memberof GoScript
141  * @param tool GoScript object.
142  * @param id An ID of the script output to remove.
143  * @return Operation status.
144  */
145 GoFx(kStatus) GoScript_RemoveOutput(GoScript tool, k32u id);
146 
147 /**
148  * Returns the count of script tool outputs.
149  *
150  * @public @memberof GoScript
151  * @param tool GoScript object.
152  * @return Script output count.
153  */
154 GoFx(kSize) GoScript_OutputCount(GoScript tool);
155 
156 /**
157  * Returns a handle to a script output at the given index.
158  *
159  * @public @memberof GoScript
160  * @param tool GoScript object.
161  * @param index The index with which to return a corresponding script output.
162  * @return A GoScriptOutput object or kNULL if the index is invalid.
163  */
164 GoFx(GoScriptOutput) GoScript_OutputAt(GoScript tool, kSize index);
165 
166 kEndHeader()
167 #include <GoSdk/Tools/GoTools.x.h>
168 
169 #endif
Lists all tool types.
kStatus GoTools_AddTool(GoTools tools, GoToolType type, GoTool *tool)
Adds a tool and returns a handle to it.
kSize GoTools_ToolCount(GoTools tools)
Returns the current number of tools.
Declares the base GoTool class.
kSize GoScript_OutputCount(GoScript tool)
Returns the count of script tool outputs.
Represents the base class for a tool measurement or script output.
Definition: GoMeasurement.h:15
kStatus GoScript_AddOutput(GoScript tool, k32u id)
Adds a script output.
GoMeasurement GoTools_FindMeasurementById(GoTool tools, k32u id)
Returns an enabled measurement handle if the specified ID is valid.
kStatus GoScript_RemoveOutput(GoScript tool, k32u id)
Removes a script output with the specific ID.
kStatus GoScript_Code(GoScript tool, kChar **code)
Gets the code for the script.
Represents a script output for a Script Tool.
Declares all surface tools and their related classes.
Essential SDK declarations.
GoTool GoTools_ToolAt(GoTools tools, kSize index)
Returns a tool handle at the given index.
Represents the base tool class.
Definition: GoTool.h:16
kStatus GoTools_RemoveTool(GoTools tools, kSize index)
Removes a tool at the given index.
kStatus GoTools_AssignMeasurementId(GoTools tools, GoMeasurement measurement)
Automatically update a given measurement to use a valid ID within the set of tools contained in the G...
Represents a collection of tools.
Definition: GoTools.h:19
Declares all profile tools and their related classes.
kStatus GoTools_ClearTools(GoTools tools)
Removes all tools in the given GoTools instance.
Represents a script tool.
kBeginHeader() kStatus GoSdk_Construct(kAssembly *assembly)
Constructs the Gocator SDK library.
kStatus GoScript_SetCode(GoScript tool, kChar *code)
Sets the code for the script.
GoScriptOutput GoScript_OutputAt(GoScript tool, kSize index)
Returns a handle to a script output at the given index.