Version: 9.15.0
YACS::HMI::SubjectInputPort Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectInputPort:
Collaboration diagram for YACS::HMI::SubjectInputPort:

Public Member Functions

 SubjectInputPort (YACS::ENGINE::InputPort *port, Subject *parent)
 
virtual ~SubjectInputPort ()
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
virtual bool setValue (std::string value)
 
virtual TypeOfElem getType ()
 
- Public Member Functions inherited from YACS::HMI::SubjectDataPort
 SubjectDataPort (YACS::ENGINE::DataPort *port, Subject *parent)
 
virtual ~SubjectDataPort ()
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual YACS::ENGINE::DataPortgetPort ()
 
void localclean (Command *command=0)
 
void addSubjectLink (SubjectLink *subject)
 
void removeSubjectLink (SubjectLink *subject)
 
std::list< SubjectLink * > getListOfSubjectLink ()
 
void setExecValue (std::string value)
 
std::string getExecValue ()
 
void registerUndoDestroy ()
 
- 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 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)
 
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 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::InputPort_inputPort
 
- Protected Attributes inherited from YACS::HMI::SubjectDataPort
YACS::ENGINE::DataPort_dataPort
 
std::list< SubjectLink * > _listSubjectLink
 
std::string _execValue
 
- 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::SubjectDataPort
static bool tryCreateLink (SubjectDataPort *subOutport, SubjectDataPort *subInport, bool control=true)
 
- Static Public Member Functions inherited from YACS::HMI::Subject
static void erase (Subject *sub, Command *command=0, bool post=false)
 

Detailed Description

Definition at line 227 of file guiObservers.hxx.

Constructor & Destructor Documentation

◆ SubjectInputPort()

SubjectInputPort::SubjectInputPort ( YACS::ENGINE::InputPort port,
Subject parent 
)

Definition at line 3731 of file guiObservers.cxx.

3732  : SubjectDataPort(port, parent), _inputPort(port)
3733 {
3734  Node *node = _inputPort->getNode();
3735  if (ForLoop* forloop = dynamic_cast<ForLoop*>(node))
3736  {
3737  if (_inputPort->getName() == "nsteps") _destructible = false;
3738  }
3739  else if (WhileLoop* whileloop = dynamic_cast<WhileLoop*>(node))
3740  {
3741  if (_inputPort->getName() == "condition") _destructible = false;
3742  }
3743  else if (Switch* aSwitch = dynamic_cast<Switch*>(node))
3744  {
3745  if (_inputPort->getName() == "select") _destructible = false;
3746  }
3747  else if (ForEachLoopGen* foreach = dynamic_cast<ForEachLoopGen*>(node))
3748  {
3749  if (_inputPort->getName() == "nbBranches") _destructible = false;
3750  }
3751  else if (OptimizerLoop* optil = dynamic_cast<OptimizerLoop*>(node))
3752  {
3753  if (_inputPort->getName() == "nbBranches") _destructible = false;
3754  }
3755  else if (SplitterNode* split = dynamic_cast<SplitterNode*>(node))
3756  {
3757  if (_inputPort->getName() == "SmplsCollection") _destructible = false;
3758  }
3759 
3760 }
std::string getName() const
Definition: DataPort.hxx:55
Class for for loop node.
Definition: ForLoop.hxx:33
Base class for all nodes.
Definition: Node.hxx:70
class to build optimization loops
Node * getNode() const
Definition: Port.hxx:46
Control node that emulates the C switch.
Definition: Switch.hxx:85
Class for a while loop.
Definition: WhileLoop.hxx:39
SubjectDataPort(YACS::ENGINE::DataPort *port, Subject *parent)
YACS::ENGINE::InputPort * _inputPort

References YACS::HMI::Subject::_destructible, _inputPort, YACS::ENGINE::DataPort::getName(), and YACS::ENGINE::Port::getNode().

◆ ~SubjectInputPort()

SubjectInputPort::~SubjectInputPort ( )
virtual

Definition at line 3762 of file guiObservers.cxx.

3763 {
3764  DEBTRACE("SubjectInputPort::~SubjectInputPort " << getName());
3765 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual std::string getName()

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

Member Function Documentation

◆ clean()

void SubjectInputPort::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::SubjectDataPort.

Definition at line 3767 of file guiObservers.cxx.

3768 {
3769  if (_askRegisterUndo)
3770  {
3771  _askRegisterUndo = false;
3773  }
3774  localclean(command);
3775  SubjectDataPort::clean(command);
3776 }
virtual void clean(Command *command=0)
void localclean(Command *command=0)

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

◆ getType()

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

Reimplemented from YACS::HMI::Subject.

Definition at line 235 of file guiObservers.hxx.

235 {return INPUTPORT;}

References YACS::HMI::INPUTPORT.

◆ localclean()

void SubjectInputPort::localclean ( Command command = 0)

Definition at line 3778 of file guiObservers.cxx.

3779 {
3780  DEBTRACE("SubjectInputPort::localClean ");
3781  if (_parent)
3782  {
3783  SubjectElementaryNode* elem = dynamic_cast<SubjectElementaryNode*>(_parent);
3784  if (elem) elem->removePort(this);
3785  }
3786 }
virtual void removePort(SubjectDataPort *port)

References YACS::HMI::Subject::_parent, DEBTRACE, and YACS::HMI::SubjectElementaryNode::removePort().

Referenced by clean().

◆ setValue()

bool SubjectInputPort::setValue ( std::string  value)
virtual

Generic method do nothing. Implementation in SubjectInputPort and SubjectOutputPort.

Reimplemented from YACS::HMI::SubjectDataPort.

Definition at line 3788 of file guiObservers.cxx.

3789 {
3790  DEBTRACE("SubjectInputPort::setValue " << value);
3791  Proc *proc = GuiContext::getCurrent()->getProc();
3792  CommandSetInPortValue *command =
3793  new CommandSetInPortValue(proc->getChildName(getPort()->getNode()), getName(), value);
3794  if (command->execute())
3795  {
3796  GuiContext::getCurrent()->getInvoc()->add(command);
3797  return true;
3798  }
3799  else delete command;
3800  return false;
3801 }
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::ENGINE::Proc * getProc()
Definition: guiContext.hxx:50
YACS::HMI::ProcInvoc * getInvoc()
Definition: guiContext.hxx:51
static GuiContext * getCurrent()
Definition: guiContext.hxx:67
void add(Command *command)
Definition: commands.cxx:156
virtual YACS::ENGINE::DataPort * getPort()

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

Member Data Documentation

◆ _inputPort

YACS::ENGINE::InputPort* YACS::HMI::SubjectInputPort::_inputPort
protected

Definition at line 237 of file guiObservers.hxx.

Referenced by SubjectInputPort().


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