Version: 8.3.0
YACS::HMI::SubjectForLoop Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectForLoop:
Collaboration diagram for YACS::HMI::SubjectForLoop:

Public Member Functions

 SubjectForLoop (YACS::ENGINE::ForLoop *forLoop, Subject *parent)
 
virtual ~SubjectForLoop ()
 
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 setNbSteps (std::string nbSteps)
 
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 void loadChildren ()
 
virtual void loadLinks ()
 
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 ()
 
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 ()
 
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 removeExternalLinks ()
 
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 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 addSubjectReference (Subject *ref)
 
void localclean (Command *command=0)
 
void registerUndoDestroy ()
 
void askRegisterUndoDestroy ()
 
bool isDestructible ()
 
virtual void setProgress (std::string newProgress)
 
virtual std::string getProgress ()
 
- Public Member Functions inherited from YACS::ENGINE::Observer
virtual void notifyObserver2 (Node *object, const std::string &event, void *something)
 
virtual ~Observer ()
 

Protected Attributes

YACS::ENGINE::ForLoop_forLoop
 
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...
 
- 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)
 

Detailed Description

Definition at line 535 of file guiObservers.hxx.

Constructor & Destructor Documentation

SubjectForLoop::SubjectForLoop ( YACS::ENGINE::ForLoop forLoop,
Subject parent 
)

Definition at line 2907 of file guiObservers.cxx.

References _body.

2908  : SubjectComposedNode(forLoop, parent), _forLoop(forLoop)
2909 {
2910  _body = 0;
2911 }
SubjectForLoop::~SubjectForLoop ( )
virtual

Definition at line 2913 of file guiObservers.cxx.

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

2914 {
2915  DEBTRACE("SubjectForLoop::~SubjectForLoop " << getName());
2916 }

Member Function Documentation

SubjectNode * SubjectForLoop::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 2943 of file guiObservers.cxx.

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

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

2948 {
2949  DEBTRACE("SubjectForLoop::addNode("<<catalog<<","<<compo<<","<<type<<","<<name<<")");
2950  SubjectNode* body = 0;
2951  if (_body)
2952  {
2953  GuiContext::getCurrent()->_lastErrorMessage = "If you need several nodes in a loop, put the nodes in a bloc";
2954  return body;
2955  }
2956  body = createNode(catalog, compo, type, name, newCompoInst);
2957  return body;
2958 }
void SubjectForLoop::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 2918 of file guiObservers.cxx.

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

2919 {
2920  if (_askRegisterUndo)
2921  {
2922  _askRegisterUndo = false;
2924  }
2925  localclean(command);
2926  SubjectComposedNode::clean(command);
2927 }
void SubjectForLoop::completeChildrenSubjectList ( SubjectNode son)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 2968 of file guiObservers.cxx.

References _body.

2969 {
2970  _body = son;
2971 }
virtual SubjectNode* YACS::HMI::SubjectForLoop::getChild ( YACS::ENGINE::Node node = 0) const
inlinevirtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 547 of file guiObservers.hxx.

References _body.

547 { return _body; }
virtual TypeOfElem YACS::HMI::SubjectForLoop::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 554 of file guiObservers.hxx.

References YACS::HMI::FORLOOP.

554 {return FORLOOP;}
std::string SubjectForLoop::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 2992 of file guiObservers.cxx.

References _forLoop, YACS::ENGINE::ForLoop::edGetNbOfTimesInputPort(), and YACS::ENGINE::DataPort::getAsString().

2993 {
2995 }
bool SubjectForLoop::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 2987 of file guiObservers.cxx.

2988 {
2989  return true;
2990 }
void SubjectForLoop::houseKeepingAfterCutPaste ( bool  isCut,
SubjectNode son 
)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 2960 of file guiObservers.cxx.

References _body.

2961 {
2962  if (isCut)
2963  _body = 0;
2964  else
2965  _body = son;
2966 }
void SubjectForLoop::localclean ( Command command = 0)

Definition at line 2929 of file guiObservers.cxx.

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

Referenced by clean().

2930 {
2931  DEBTRACE("SubjectForLoop::localClean ");
2932  if (_body)
2933  erase(_body);
2934 }
void SubjectForLoop::recursiveUpdate ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 2936 of file guiObservers.cxx.

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

2937 {
2938  update(event, type, son);
2939  if (_body)
2940  _body->recursiveUpdate(event, type, son);
2941 }
bool SubjectForLoop::setNbSteps ( std::string  nbSteps)
virtual

Definition at line 2973 of file guiObservers.cxx.

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::EditionLoop::onNbStepsEdited().

2974 {
2975  DEBTRACE("SubjectForLoop::setNbSteps " << nbSteps);
2976  Proc *proc = GuiContext::getCurrent()->getProc();
2977  CommandSetForLoopSteps *command =
2978  new CommandSetForLoopSteps(proc->getChildName(getNode()), nbSteps);
2979  if (command->execute())
2980  {
2981  GuiContext::getCurrent()->getInvoc()->add(command);
2982  return true;
2983  }
2984  else delete command;
2985  return false;
2986 }

Member Data Documentation

SubjectNode* YACS::HMI::SubjectForLoop::_body
protected
YACS::ENGINE::ForLoop* YACS::HMI::SubjectForLoop::_forLoop
protected

Definition at line 556 of file guiObservers.hxx.

Referenced by getValue().


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