#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.
References _normalReverse, and _subCommands.
| void Command::addSubCommand | ( | Command * | command | ) |
Definition at line 134 of file commands.cxx.
References _subCommands.
|
virtual |
Reimplemented in YACS::HMI::CommandAddNodeFromCatalog, YACS::HMI::CommandReparentNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandRenameNode, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandAddLink, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddContainer, YACS::HMI::CommandAddHPContainer, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandSetContainer, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAddComponentFromCatalog, and YACS::HMI::CommandDestroy.
Definition at line 119 of file commands.cxx.
Referenced by recursiveDump().
|
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 YACS::HMI::Invocator::_commandsInProgress, _normalReverse, _subCommands, YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), yacsorb.CORBAEngineTest::i, YACS::HMI::Invocator::isSpecialReverse(), localExecute(), and YACS::HMI::GuiContext::setNotSaved().
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::SubjectComponent::associateToContainer(), 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 _subCommands, and yacsorb.CORBAEngineTest::i.
|
inline |
|
protectedpure virtual |
Implemented in YACS::HMI::CommandAddNodeFromCatalog, YACS::HMI::CommandReparentNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandRenameNode, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandAddLink, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddContainerBase, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandSetContainer, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAddComponentFromCatalog, and YACS::HMI::CommandDestroy.
|
protectedpure virtual |
Implemented in YACS::HMI::CommandAddNodeFromCatalog, YACS::HMI::CommandReparentNode, YACS::HMI::CommandPutInComposedNode, YACS::HMI::CommandCopyNode, YACS::HMI::CommandRenameNode, YACS::HMI::CommandRenameContainer, YACS::HMI::CommandRenameInDataPort, YACS::HMI::CommandRenameOutDataPort, YACS::HMI::CommandAddDataTypeFromCatalog, YACS::HMI::CommandAddInputPortFromCatalog, YACS::HMI::CommandAddOutputPortFromCatalog, YACS::HMI::CommandAddIDSPortFromCatalog, YACS::HMI::CommandAddODSPortFromCatalog, YACS::HMI::CommandOrderInputPorts, YACS::HMI::CommandOrderOutputPorts, YACS::HMI::CommandSetInPortValue, YACS::HMI::CommandSetOutPortValue, YACS::HMI::CommandSetSwitchSelect, YACS::HMI::CommandSetSwitchCase, YACS::HMI::CommandSetForLoopSteps, YACS::HMI::CommandSetWhileCondition, YACS::HMI::CommandSetForEachBranch, YACS::HMI::CommandSetAlgo, YACS::HMI::CommandAddLink, YACS::HMI::CommandAddControlLink, YACS::HMI::CommandAddContainerBase, YACS::HMI::CommandSetContainerProperties, YACS::HMI::CommandSetNodeProperties, YACS::HMI::CommandSetComponentInstanceProperties, YACS::HMI::CommandSetDSPortProperties, YACS::HMI::CommandSetLinkProperties, YACS::HMI::CommandSetFuncNodeFunctionName, YACS::HMI::CommandSetInlineNodeScript, YACS::HMI::CommandAddComponentInstance, YACS::HMI::CommandSetExecutionMode, YACS::HMI::CommandSetContainer, YACS::HMI::CommandAssociateComponentToContainer, YACS::HMI::CommandAssociateServiceToComponent, YACS::HMI::CommandAddComponentFromCatalog, and YACS::HMI::CommandDestroy.
Referenced by reverse().
| std::string Command::recursiveDump | ( | int | level = 0 | ) |
Definition at line 124 of file commands.cxx.
References _subCommands, dump(), yacsorb.CORBAEngineTest::i, and recursiveDump().
Referenced by recursiveDump().
|
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 _subCommands, yacsorb.CORBAEngineTest::i, localExecute(), and localReverse().
|
protected |
Definition at line 53 of file commands.hxx.
Referenced by Command(), YACS::HMI::CommandDestroy::CommandDestroy(), execute(), and isNormalReverse().
|
protected |
Definition at line 52 of file commands.hxx.
Referenced by addSubCommand(), Command(), execute(), executeSubOnly(), recursiveDump(), and reverse().