Version: 8.3.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 ~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)
 

Detailed Description

Definition at line 226 of file guiObservers.hxx.

Constructor & Destructor Documentation

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

Definition at line 3728 of file guiObservers.cxx.

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

3729  : SubjectDataPort(port, parent), _inputPort(port)
3730 {
3731  Node *node = _inputPort->getNode();
3732  if (ForLoop* forloop = dynamic_cast<ForLoop*>(node))
3733  {
3734  if (_inputPort->getName() == "nsteps") _destructible = false;
3735  }
3736  else if (WhileLoop* whileloop = dynamic_cast<WhileLoop*>(node))
3737  {
3738  if (_inputPort->getName() == "condition") _destructible = false;
3739  }
3740  else if (Switch* aSwitch = dynamic_cast<Switch*>(node))
3741  {
3742  if (_inputPort->getName() == "select") _destructible = false;
3743  }
3744  else if (ForEachLoop* foreach = dynamic_cast<ForEachLoop*>(node))
3745  {
3746  if (_inputPort->getName() == "nbBranches") _destructible = false;
3747  }
3748  else if (OptimizerLoop* optil = dynamic_cast<OptimizerLoop*>(node))
3749  {
3750  if (_inputPort->getName() == "nbBranches") _destructible = false;
3751  }
3752  else if (SplitterNode* split = dynamic_cast<SplitterNode*>(node))
3753  {
3754  if (_inputPort->getName() == "SmplsCollection") _destructible = false;
3755  }
3756 
3757 }
SubjectInputPort::~SubjectInputPort ( )
virtual

Definition at line 3759 of file guiObservers.cxx.

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

3760 {
3761  DEBTRACE("SubjectInputPort::~SubjectInputPort " << getName());
3762 }

Member Function Documentation

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 3764 of file guiObservers.cxx.

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

3765 {
3766  if (_askRegisterUndo)
3767  {
3768  _askRegisterUndo = false;
3770  }
3771  localclean(command);
3772  SubjectDataPort::clean(command);
3773 }
virtual TypeOfElem YACS::HMI::SubjectInputPort::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 234 of file guiObservers.hxx.

References YACS::HMI::INPUTPORT.

234 {return INPUTPORT;}
void SubjectInputPort::localclean ( Command command = 0)

Definition at line 3775 of file guiObservers.cxx.

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

Referenced by clean().

3776 {
3777  DEBTRACE("SubjectInputPort::localClean ");
3778  if (_parent)
3779  {
3780  SubjectElementaryNode* elem = dynamic_cast<SubjectElementaryNode*>(_parent);
3781  if (elem) elem->removePort(this);
3782  }
3783 }
bool SubjectInputPort::setValue ( std::string  value)
virtual

Generic method do nothing. Implementation in SubjectInputPort and SubjectOutputPort.

Reimplemented from YACS::HMI::SubjectDataPort.

Definition at line 3785 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::SubjectDataPort::getName(), YACS::HMI::SubjectDataPort::getPort(), and YACS::HMI::GuiContext::getProc().

3786 {
3787  DEBTRACE("SubjectInputPort::setValue " << value);
3788  Proc *proc = GuiContext::getCurrent()->getProc();
3789  CommandSetInPortValue *command =
3790  new CommandSetInPortValue(proc->getChildName(getPort()->getNode()), getName(), value);
3791  if (command->execute())
3792  {
3793  GuiContext::getCurrent()->getInvoc()->add(command);
3794  return true;
3795  }
3796  else delete command;
3797  return false;
3798 }

Member Data Documentation

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

Definition at line 236 of file guiObservers.hxx.

Referenced by SubjectInputPort().


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