Version: 9.16.0
YACS::HMI::SubjectWhileLoop Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectWhileLoop:
Collaboration diagram for YACS::HMI::SubjectWhileLoop:

Public Member Functions

 SubjectWhileLoop (YACS::ENGINE::WhileLoop *whileLoop, Subject *parent)
 
virtual ~SubjectWhileLoop ()
 
virtual SubjectNodeaddNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst)
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual void completeChildrenSubjectList (SubjectNode *son)
 
virtual SubjectNodegetChild (YACS::ENGINE::Node *node=0) const
 
virtual bool setCondition (std::string condition)
 
virtual bool hasValue ()
 
virtual std::string getValue ()
 
virtual void houseKeepingAfterCutPaste (bool isCut, SubjectNode *son)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
virtual TypeOfElem getType ()
 
- Public Member Functions inherited from YACS::HMI::SubjectComposedNode
 SubjectComposedNode (YACS::ENGINE::ComposedNode *composedNode, Subject *parent)
 
virtual ~SubjectComposedNode ()
 
virtual SubjectNodeaddNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst)
 
virtual SubjectNodegetChild (YACS::ENGINE::Node *node=0) const
 
virtual void loadChildren ()
 
virtual void loadLinks ()
 
virtual void completeChildrenSubjectList (SubjectNode *son)
 
SubjectNodeaddSubjectNode (YACS::ENGINE::Node *node, std::string name="", YACS::ENGINE::Catalog *catalog=0, std::string compo="", std::string type="")
 
SubjectLinkaddSubjectLink (SubjectNode *sno, SubjectDataPort *spo, SubjectNode *sni, SubjectDataPort *spi)
 
SubjectControlLinkaddSubjectControlLink (SubjectNode *sno, SubjectNode *sni)
 
virtual void removeLink (SubjectLink *link)
 
virtual void removeControlLink (SubjectControlLink *link)
 
virtual void removeExternalControlLinks ()
 
virtual void houseKeepingAfterCutPaste (bool isCut, SubjectNode *son)
 
virtual bool hasValue ()
 
virtual std::string getValue ()
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
- Public Member Functions inherited from YACS::HMI::SubjectNode
 SubjectNode (YACS::ENGINE::Node *node, Subject *parent)
 
virtual ~SubjectNode ()
 
virtual bool setProperties (std::map< std::string, std::string > properties)
 
virtual std::map< std::string, std::string > getProperties ()
 
virtual bool reparent (Subject *parent)
 
virtual bool copy (Subject *parent)
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual YACS::ENGINE::NodegetNode ()
 
virtual void clean (Command *command=0)
 
void registerUndoDestroy ()
 
SubjectControlLinkaddSubjectControlLink (SubjectControlLink *sub)
 
void removeSubjectControlLink (SubjectControlLink *sub)
 
std::list< SubjectLink * > getSubjectLinks () const
 
std::list< SubjectControlLink * > getSubjectControlLinks () const
 
std::list< SubjectInputPort * > getSubjectInputPorts () const
 
std::list< SubjectOutputPort * > getSubjectOutputPorts () const
 
std::list< SubjectInputDataStreamPort * > getSubjectInputDataStreamPorts () const
 
std::list< SubjectOutputDataStreamPort * > getSubjectOutputDataStreamPorts () const
 
void localclean (Command *command=0)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual void removeExternalLinks ()
 
virtual void removeExternalControlLinks ()
 
virtual void saveLinks ()
 
virtual void restoreLinks ()
 
virtual bool putInComposedNode (std::string name, std::string type, bool toSaveRestoreLinks=true)
 
virtual int isValid ()
 
void setExecState (int execState)
 
- Public Member Functions inherited from YACS::HMI::Subject
 Subject (Subject *parent=0)
 
virtual ~Subject ()
 
virtual void attach (GuiObserver *obs)
 
virtual void detach (GuiObserver *obs)
 
virtual void select (bool isSelected)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual bool setProperties (std::map< std::string, std::string > properties)
 
virtual std::map< std::string, std::string > getProperties ()
 
virtual std::vector< std::string > knownProperties ()
 
virtual SubjectgetParent ()
 
virtual void setParent (Subject *son)
 
virtual bool destroy (Subject *son)
 From user action in Ihm, destroy an object. More...
 
virtual void loadChildren ()
 
virtual void loadLinks ()
 
virtual void addSubjectReference (Subject *ref)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
void registerUndoDestroy ()
 
void askRegisterUndoDestroy ()
 
bool isDestructible ()
 
virtual TypeOfElem getType ()
 
virtual void setProgress (std::string newProgress)
 
virtual std::string getProgress ()
 
- Public Member Functions inherited from YACS::ENGINE::Observer
virtual void notifyObserver (Node *object, const std::string &event)
 
virtual void notifyObserver2 (Node *object, const std::string &event, void *something)
 
virtual void notifyObserverFromClone (Node *originalInstance, const std::string &event, Node *clonedInstanceGeneratingEvent)
 
virtual ~Observer ()
 

Protected Attributes

YACS::ENGINE::WhileLoop_whileLoop
 
SubjectNode_body
 
- Protected Attributes inherited from YACS::HMI::SubjectComposedNode
YACS::ENGINE::ComposedNode_composedNode
 
- Protected Attributes inherited from YACS::HMI::SubjectNode
YACS::ENGINE::Node_node
 
std::list< SubjectInputPort * > _listSubjectInputPort
 
std::list< SubjectOutputPort * > _listSubjectOutputPort
 
std::list< SubjectInputDataStreamPort * > _listSubjectIDSPort
 
std::list< SubjectOutputDataStreamPort * > _listSubjectODSPort
 
std::list< SubjectLink * > _listSubjectLink
 
std::list< SubjectControlLink * > _listSubjectControlLink
 
int _execState
 
std::list< YACS::ENGINE::OutGate * > loutgate
 
std::list< YACS::ENGINE::InGate * > singate
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataLinks
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataflowLinks
 
- Protected Attributes inherited from YACS::HMI::Subject
std::set< GuiObserver * > _setObs
 
Subject_parent
 
bool _destructible
 
bool _askRegisterUndo
 
std::string _progress
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::SubjectComposedNode
static SubjectComposedNodegetLowestCommonAncestor (SubjectNode *snode1, SubjectNode *snode2)
 Retrieves the lowest common ancestor of 2 nodes. More...
 
- Static Public Member Functions inherited from YACS::HMI::SubjectNode
static bool tryCreateLink (SubjectNode *subOutNode, SubjectNode *subInNode)
 
- Static Public Member Functions inherited from YACS::HMI::Subject
static void erase (Subject *sub, Command *command=0, bool post=false)
 
- Protected Member Functions inherited from YACS::HMI::SubjectComposedNode
virtual SubjectNodecreateNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst, int swCase=0)
 
- Protected Member Functions inherited from YACS::HMI::SubjectNode
virtual SubjectInputPortaddSubjectInputPort (YACS::ENGINE::InputPort *port, std::string name="")
 
virtual SubjectOutputPortaddSubjectOutputPort (YACS::ENGINE::OutputPort *port, std::string name="")
 
virtual SubjectInputDataStreamPortaddSubjectIDSPort (YACS::ENGINE::InputDataStreamPort *port, std::string name="")
 
virtual SubjectOutputDataStreamPortaddSubjectODSPort (YACS::ENGINE::OutputDataStreamPort *port, std::string name="")
 
virtual void notifyObserver (YACS::ENGINE::Node *object, const std::string &event)
 

Detailed Description

Definition at line 561 of file guiObservers.hxx.

Constructor & Destructor Documentation

◆ SubjectWhileLoop()

SubjectWhileLoop::SubjectWhileLoop ( YACS::ENGINE::WhileLoop whileLoop,
Subject parent 
)

Definition at line 2999 of file guiObservers.cxx.

3000 : SubjectComposedNode(whileLoop, parent), _whileLoop(whileLoop)
3001{
3002 _body = 0;
3003}
SubjectComposedNode(YACS::ENGINE::ComposedNode *composedNode, Subject *parent)
YACS::ENGINE::WhileLoop * _whileLoop

References _body.

◆ ~SubjectWhileLoop()

SubjectWhileLoop::~SubjectWhileLoop ( )
virtual

Definition at line 3005 of file guiObservers.cxx.

3006{
3007 DEBTRACE("SubjectWhileLoop::~SubjectWhileLoop " << getName());
3008}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual std::string getName()

References DEBTRACE, and YACS::HMI::SubjectNode::getName().

Member Function Documentation

◆ addNode()

SubjectNode * SubjectWhileLoop::addNode ( YACS::ENGINE::Catalog catalog,
std::string  compo,
std::string  type,
std::string  name,
bool  newCompoInst 
)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3035 of file guiObservers.cxx.

3040{
3041 DEBTRACE("SubjectWhileLoop::addNode(catalog, compo, type, name)");
3042 SubjectNode* body = 0;
3043 if (_body)
3044 {
3045 GuiContext::getCurrent()->_lastErrorMessage = "If you need several nodes in a loop, put the nodes in a bloc";
3046 return body;
3047 }
3048 body = createNode(catalog, compo, type, name, newCompoInst);
3049 return body;
3050}
static GuiContext * getCurrent()
Definition: guiContext.hxx:67
std::string _lastErrorMessage
Definition: guiContext.hxx:79
virtual SubjectNode * createNode(YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst, int swCase=0)

References _body, YACS::HMI::GuiContext::_lastErrorMessage, YACS::HMI::SubjectComposedNode::createNode(), DEBTRACE, and YACS::HMI::GuiContext::getCurrent().

Referenced by gui.GraphViewer.GraphViewer::popup().

◆ clean()

void SubjectWhileLoop::clean ( Command command = 0)
virtual

Clean process prior to delete is redefined in derived classes: a local clean treatment relative to the derived class, then a call to the parent class clean method.

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3010 of file guiObservers.cxx.

3011{
3012 if (_askRegisterUndo)
3013 {
3014 _askRegisterUndo = false;
3016 }
3017 localclean(command);
3019}
virtual void clean(Command *command=0)
void localclean(Command *command=0)

References YACS::HMI::Subject::_askRegisterUndo, YACS::HMI::SubjectComposedNode::clean(), localclean(), and YACS::HMI::SubjectNode::registerUndoDestroy().

◆ completeChildrenSubjectList()

void SubjectWhileLoop::completeChildrenSubjectList ( SubjectNode son)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3060 of file guiObservers.cxx.

3061{
3062 _body = son;
3063}

References _body.

◆ getChild()

virtual SubjectNode * YACS::HMI::SubjectWhileLoop::getChild ( YACS::ENGINE::Node node = 0) const
inlinevirtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 573 of file guiObservers.hxx.

573{ return _body; }

References _body.

◆ getType()

virtual TypeOfElem YACS::HMI::SubjectWhileLoop::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 580 of file guiObservers.hxx.

580{return WHILELOOP;}

References YACS::HMI::WHILELOOP.

◆ getValue()

std::string SubjectWhileLoop::getValue ( )
virtual

used in derived classes using a counter, a selector, or a condition: ForLoop, ForEachLoop, Switch, WhileLoop.

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3085 of file guiObservers.cxx.

3086{
3088}
virtual std::string getAsString()
returns port value as a string that can be used in a GUI for example
Definition: DataPort.cxx:84
InputPort * edGetConditionPort()
Definition: WhileLoop.hxx:48

References _whileLoop, YACS::ENGINE::WhileLoop::edGetConditionPort(), and YACS::ENGINE::DataPort::getAsString().

◆ hasValue()

bool SubjectWhileLoop::hasValue ( )
virtual

used in derived classes using a counter, a selector, or a condition: ForLoop, ForEachLoop, Switch, WhileLoop.

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3080 of file guiObservers.cxx.

3081{
3082 return true;
3083}

◆ houseKeepingAfterCutPaste()

void SubjectWhileLoop::houseKeepingAfterCutPaste ( bool  isCut,
SubjectNode son 
)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 3052 of file guiObservers.cxx.

3053{
3054 if (isCut)
3055 _body = 0;
3056 else
3057 _body = son;
3058}

References _body.

◆ localclean()

void SubjectWhileLoop::localclean ( Command command = 0)

Definition at line 3021 of file guiObservers.cxx.

3022{
3023 DEBTRACE("SubjectWhileLoop::localClean ");
3024 if (_body)
3025 erase(_body);
3026}
static void erase(Subject *sub, Command *command=0, bool post=false)

References _body, DEBTRACE, and YACS::HMI::Subject::erase().

Referenced by clean().

◆ recursiveUpdate()

void SubjectWhileLoop::recursiveUpdate ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 3028 of file guiObservers.cxx.

3029{
3030 update(event, type, son);
3031 if (_body)
3032 _body->recursiveUpdate(event, type, son);
3033}
virtual void update(GuiEvent event, int type, Subject *son)
virtual void recursiveUpdate(GuiEvent event, int type, Subject *son)

References _body, YACS::HMI::SubjectNode::recursiveUpdate(), and YACS::HMI::SubjectNode::update().

◆ setCondition()

bool SubjectWhileLoop::setCondition ( std::string  condition)
virtual

Definition at line 3065 of file guiObservers.cxx.

3066{
3067 DEBTRACE("SubjectWhileLoop::setCondition " << condition);
3068 Proc *proc = GuiContext::getCurrent()->getProc();
3069 CommandSetWhileCondition *command =
3070 new CommandSetWhileCondition(proc->getChildName(getNode()), condition);
3071 if (command->execute())
3072 {
3073 GuiContext::getCurrent()->getInvoc()->add(command);
3074 return true;
3075 }
3076 else delete command;
3077 return false;
3078}
std::string getChildName(const Node *node) const
Base class for all schema objects.
Definition: Proc.hxx:44
virtual bool execute()
the command is executed a first time after its registration for undo redo, then on redo
Definition: commands.cxx:51
YACS::HMI::ProcInvoc * getInvoc()
Definition: guiContext.hxx:51
YACS::ENGINE::Proc * getProc()
Definition: guiContext.hxx:50
void add(Command *command)
Definition: commands.cxx:156
virtual YACS::ENGINE::Node * getNode()

References YACS::HMI::Invocator::add(), DEBTRACE, YACS::HMI::Command::execute(), YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::SubjectNode::getNode(), and YACS::HMI::GuiContext::getProc().

Referenced by YACS::HMI::EditionWhile::onConditionEdited().

Member Data Documentation

◆ _body

SubjectNode* YACS::HMI::SubjectWhileLoop::_body
protected

◆ _whileLoop

YACS::ENGINE::WhileLoop* YACS::HMI::SubjectWhileLoop::_whileLoop
protected

Definition at line 582 of file guiObservers.hxx.

Referenced by getValue().


The documentation for this class was generated from the following files: