2 #ifndef _COMMANDSPROC_HXX_
3 #define _COMMANDSPROC_HXX_
5 #include "commands.hxx"
23 class InputDataStreamPort;
24 class OutputDataStreamPort;
26 class ComponentInstance;
68 class ProcInvoc: public Invocator
72 static TypeOfElem getTypeOfNode(YACS::ENGINE::Node* node);
73 static TypeOfElem getTypeOfPort(YACS::ENGINE::DataPort* port);
74 static std::string getTypeName(TypeOfElem type);
76 static std::map<int, std::string> _typeNameMap;
80 class CommandAddNodeFromCatalog: public Command
83 CommandAddNodeFromCatalog(YACS::ENGINE::Catalog *catalog,
89 YACS::ENGINE::Node *getNode();
91 virtual bool localExecute();
92 virtual bool localReverse();
93 YACS::ENGINE::Catalog* _catalog;
94 YACS::ENGINE::Node *_nodeToClone;
96 std::string _compoName;
97 std::string _typeName;
98 std::string _position;
101 YACS::ENGINE::Node *_node;
104 class CommandRenameNode: public Command
107 CommandRenameNode(std::string position, std::string name);
109 virtual bool localExecute();
110 virtual bool localReverse();
111 std::string _position;
115 class CommandAddDataTypeFromCatalog: public Command
118 CommandAddDataTypeFromCatalog(YACS::ENGINE::Catalog* catalog,
119 std::string typeName);
120 YACS::ENGINE::TypeCode *getTypeCode();
122 virtual bool localExecute();
123 virtual bool localReverse();
124 YACS::ENGINE::Catalog* _catalog;
125 std::string _typeName;
128 class CommandAddInputPortFromCatalog: public Command
131 CommandAddInputPortFromCatalog(YACS::ENGINE::Catalog *catalog,
135 YACS::ENGINE::InputPort *getInputPort();
137 virtual bool localExecute();
138 virtual bool localReverse();
139 YACS::ENGINE::Catalog* _catalog;
140 std::string _typePort;
143 YACS::ENGINE::InputPort *_inputPort;
146 class CommandAddOutputPortFromCatalog: public Command
149 CommandAddOutputPortFromCatalog(YACS::ENGINE::Catalog *catalog,
153 YACS::ENGINE::OutputPort *getOutputPort();
155 virtual bool localExecute();
156 virtual bool localReverse();
157 YACS::ENGINE::Catalog* _catalog;
158 std::string _typePort;
161 YACS::ENGINE::OutputPort *_outputPort;
164 class CommandAddIDSPortFromCatalog: public Command
167 CommandAddIDSPortFromCatalog(YACS::ENGINE::Catalog *catalog,
171 YACS::ENGINE::InputDataStreamPort *getIDSPort();
173 virtual bool localExecute();
174 virtual bool localReverse();
175 YACS::ENGINE::Catalog* _catalog;
176 std::string _typePort;
179 YACS::ENGINE::InputDataStreamPort *_IDSPort;
182 class CommandAddODSPortFromCatalog: public Command
185 CommandAddODSPortFromCatalog(YACS::ENGINE::Catalog *catalog,
189 YACS::ENGINE::OutputDataStreamPort *getODSPort();
191 virtual bool localExecute();
192 virtual bool localReverse();
193 YACS::ENGINE::Catalog* _catalog;
194 std::string _typePort;
197 YACS::ENGINE::OutputDataStreamPort *_ODSPort;
200 class CommandAddLink: public Command
203 CommandAddLink(std::string outNode, std::string outPort,
204 std::string inNode, std::string inPort);
206 virtual bool localExecute();
207 virtual bool localReverse();
208 std::string _outNode;
209 std::string _outPort;
214 class CommandAddControlLink: public Command
217 CommandAddControlLink(std::string outNode, std::string inNode);
219 virtual bool localExecute();
220 virtual bool localReverse();
221 std::string _outNode;
225 class CommandAddContainer: public Command
228 CommandAddContainer(std::string name,
229 std::string refContainer ="");
230 virtual YACS::ENGINE::Container* getContainer();
232 virtual bool localExecute();
233 virtual bool localReverse();
235 std::string _containerToClone;
236 YACS::ENGINE::Container* _container;
239 class CommandSetContainerProperties: public Command
242 CommandSetContainerProperties(std::string container,
243 std::map<std::string,std::string> properties);
245 virtual bool localExecute();
246 virtual bool localReverse();
247 std::string _container;
248 std::map<std::string,std::string> _properties;
251 class CommandSetDSPortProperties: public Command
254 CommandSetDSPortProperties(std::string node, std::string port, bool isInport,
255 std::map<std::string,std::string> properties);
257 virtual bool localExecute();
258 virtual bool localReverse();
259 std::string _nodeName;
260 std::string _portName;
262 std::map<std::string,std::string> _properties;
265 class CommandSetFuncNodeFunctionName: public Command
268 CommandSetFuncNodeFunctionName(std::string node, std::string funcName);
270 virtual bool localExecute();
271 virtual bool localReverse();
272 std::string _nodeName;
273 std::string _funcName;
276 class CommandSetInlineNodeScript: public Command
279 CommandSetInlineNodeScript(std::string node, std::string script);
281 virtual bool localExecute();
282 virtual bool localReverse();
283 std::string _nodeName;
287 class CommandAddComponentInstance: public Command
290 CommandAddComponentInstance(std::string compoName);
291 virtual YACS::ENGINE::ComponentInstance* getComponentInstance();
293 virtual bool localExecute();
294 virtual bool localReverse();
295 std::string _compoName;
296 YACS::ENGINE::ComponentInstance *_compoInst;
299 class CommandAssociateComponentToContainer: public Command
302 CommandAssociateComponentToContainer(std::pair<std::string,int> key,
303 std::string container);
305 virtual bool localExecute();
306 virtual bool localReverse();
307 std::pair<std::string,int> _key;
308 std::string _container;
311 class CommandAssociateServiceToComponent: public Command
314 CommandAssociateServiceToComponent(std::string service,
315 std::pair<std::string,int> key);
317 virtual bool localExecute();
318 virtual bool localReverse();
319 std::string _service;
320 std::pair<std::string,int> _key;
324 class CommandDestroy: public Command
327 CommandDestroy(std::string position, Subject* subject);
329 virtual bool localExecute();
330 virtual bool localReverse();
332 std::string _position;
336 class CommandDeleteNode: public Command
339 CommandDeleteNode(std::string node);
341 virtual bool localExecute();
342 virtual bool localReverse();
346 class CommandCutNode: public Command
349 CommandCutNode(std::string node);
351 virtual bool localExecute();
352 virtual bool localReverse();
356 class CommandCopyNode: public Command
359 CommandCopyNode(std::string node);
361 virtual bool localExecute();
362 virtual bool localReverse();
366 class CommandPasteNode: public Command
369 CommandPasteNode(std::string position);
371 virtual bool localExecute();
372 virtual bool localReverse();
376 class CommandDeleteInPort: public Command
379 CommandDeleteInPort(std::string node, std::string port);
381 virtual bool localExecute();
382 virtual bool localReverse();
387 class CommandDeleteOutPort: public Command
390 CommandDeleteOutPort(std::string node, std::string port);
392 virtual bool localExecute();
393 virtual bool localReverse();