#include <commands.hxx>
Public Member Functions | |
Command () | |
virtual bool | execute () |
the command is executed a first time after its registration for undo redo, then on redo More... | |
virtual bool | reverse (bool isNormal=true) |
Reverse action: undo. More... | |
virtual bool | executeSubOnly () |
execute only sub commands in a reverse action More... | |
virtual std::string | dump () |
std::string | recursiveDump (int level=0) |
void | addSubCommand (Command *command) |
bool | isNormalReverse () |
Protected Member Functions | |
virtual bool | localExecute ()=0 |
virtual bool | localReverse ()=0 |
Protected Attributes | |
std::vector< Command * > | _subCommands |
bool | _normalReverse |
Definition at line 38 of file commands.hxx.
Command::Command | ( | ) |
Definition at line 37 of file commands.cxx.
void Command::addSubCommand | ( | Command * | command | ) |
Definition at line 134 of file commands.cxx.
|
virtual |
Reimplemented in YACS::HMI::CommandDestroy, YACS::HMI::CommandAddComponentFromCatalog, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandSetContainer, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandAddHPContainer, YACS::HMI::CommandAddContainer, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddLink, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandReparentNode, and YACS::HMI::CommandAddNodeFromCatalog.
Definition at line 119 of file commands.cxx.
|
virtual |
the command is executed a first time after its registration for undo redo, then on redo
Execute may induce subcommands to be registered during its execution. Subcommands must be deleted before redo, to be recreated by redo. CommandDestroy is a special case, where subcommands are registered before Execute, and undo action calls executeSubOnly instead of reverse. Subcommands pf CommandDestroy must not be deleted.
Definition at line 51 of file commands.cxx.
References CORBAEngineTest::i, and PMMLBasicsTestLauncher::ret.
Referenced by YACS::HMI::SubjectProc::addComponent(), YACS::HMI::SubjectProc::addComSubjectDataType(), YACS::HMI::SubjectProc::addContainer(), YACS::HMI::SubjectProc::addDataType(), YACS::HMI::SubjectProc::addHPContainer(), YACS::HMI::SubjectElementaryNode::addIDSPort(), YACS::HMI::SubjectElementaryNode::addInputPort(), YACS::HMI::SubjectElementaryNode::addODSPort(), YACS::HMI::SubjectElementaryNode::addOutputPort(), YACS::HMI::SubjectServiceNode::associateToComponent(), YACS::HMI::SubjectNode::copy(), YACS::HMI::SubjectComposedNode::createNode(), YACS::HMI::Subject::destroy(), YACS::HMI::SubjectElementaryNode::OrderDataPorts(), YACS::HMI::SubjectNode::putInComposedNode(), YACS::HMI::SubjectNode::reparent(), YACS::HMI::SubjectOptimizerLoop::setAlgorithm(), YACS::HMI::SubjectSwitch::setCase(), YACS::HMI::SubjectServiceNode::setComponentFromCatalog(), YACS::HMI::SubjectWhileLoop::setCondition(), YACS::HMI::SubjectInlineNode::setContainer(), YACS::HMI::SubjectInlineNode::setExecutionMode(), YACS::HMI::SubjectPyFuncNode::setFunctionName(), YACS::HMI::SubjectDataPort::setName(), YACS::HMI::SubjectNode::setName(), YACS::HMI::SubjectContainerBase::setName(), YACS::HMI::SubjectDynParaLoop::setNbBranches(), YACS::HMI::SubjectForLoop::setNbSteps(), YACS::HMI::SubjectInputDataStreamPort::setProperties(), YACS::HMI::SubjectOutputDataStreamPort::setProperties(), YACS::HMI::SubjectNode::setProperties(), YACS::HMI::SubjectContainerBase::setProperties(), YACS::HMI::SubjectComponent::setProperties(), YACS::HMI::SubjectLink::setProperties(), YACS::HMI::SubjectInlineNode::setScript(), YACS::HMI::SubjectSwitch::setSelect(), YACS::HMI::SubjectInputPort::setValue(), YACS::HMI::SubjectOutputPort::setValue(), YACS::HMI::SubjectDataPort::tryCreateLink(), and YACS::HMI::SubjectNode::tryCreateLink().
|
virtual |
execute only sub commands in a reverse action
for undo of commandDestroy, only sub commands of commandDestroy must be executed, via subcommand->reverse(false)
Definition at line 105 of file commands.cxx.
References CORBAEngineTest::i, and PMMLBasicsTestLauncher::ret.
|
inline |
|
protectedpure virtual |
Implemented in YACS::HMI::CommandDestroy, YACS::HMI::CommandAddComponentFromCatalog, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandSetContainer, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandAddContainerBase, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddLink, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandReparentNode, and YACS::HMI::CommandAddNodeFromCatalog.
|
protectedpure virtual |
Implemented in YACS::HMI::CommandDestroy, YACS::HMI::CommandAddComponentFromCatalog, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandSetContainer, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandAddContainerBase, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddLink, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandReparentNode, and YACS::HMI::CommandAddNodeFromCatalog.
std::string Command::recursiveDump | ( | int | level = 0 | ) |
Definition at line 124 of file commands.cxx.
References CORBAEngineTest::i, and PMMLBasicsTestLauncher::ret.
|
virtual |
Reverse action: undo.
Recursive reverse of sub commands then local action
isNormal,: | true for ordinary command, false for command Destroy |
Definition at line 79 of file commands.cxx.
References CORBAEngineTest::i, and PMMLBasicsTestLauncher::ret.
|
protected |
Definition at line 53 of file commands.hxx.
Referenced by YACS::HMI::CommandDestroy::CommandDestroy(), and isNormalReverse().
|
protected |
Definition at line 52 of file commands.hxx.