Version: 9.15.0
YACS::HMI::SubjectOutputPort Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectOutputPort:
Collaboration diagram for YACS::HMI::SubjectOutputPort:

Public Member Functions

 SubjectOutputPort (YACS::ENGINE::OutputPort *port, Subject *parent)
 
virtual ~SubjectOutputPort ()
 
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::OutputPort_outputPort
 
- 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 240 of file guiObservers.hxx.

Constructor & Destructor Documentation

◆ SubjectOutputPort()

SubjectOutputPort::SubjectOutputPort ( YACS::ENGINE::OutputPort port,
Subject parent 
)

Definition at line 3805 of file guiObservers.cxx.

3806  : SubjectDataPort(port, parent), _outputPort(port)
3807 {
3808  if (DynParaLoop* dynloop = dynamic_cast<DynParaLoop*>(_outputPort->getNode()))
3809  {
3810  if (_outputPort == dynloop->edGetSamplePort()) _destructible = false;
3811  }
3812 }
Base class for dynamically (fully or semifully) built graphs.
Definition: DynParaLoop.hxx:41
Node * getNode() const
Definition: Port.hxx:46
SubjectDataPort(YACS::ENGINE::DataPort *port, Subject *parent)
YACS::ENGINE::OutputPort * _outputPort

References YACS::HMI::Subject::_destructible, _outputPort, and YACS::ENGINE::Port::getNode().

◆ ~SubjectOutputPort()

SubjectOutputPort::~SubjectOutputPort ( )
virtual

Definition at line 3814 of file guiObservers.cxx.

3815 {
3816  DEBTRACE("SubjectOutputPort::~SubjectOutputPort " << getName());
3817 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual std::string getName()

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

Member Function Documentation

◆ clean()

void SubjectOutputPort::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 3819 of file guiObservers.cxx.

3820 {
3821  if (_askRegisterUndo)
3822  {
3823  _askRegisterUndo = false;
3825  }
3826  localclean(command);
3827  SubjectDataPort::clean(command);
3828 }
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::SubjectOutputPort::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 248 of file guiObservers.hxx.

248 {return OUTPUTPORT;}

References YACS::HMI::OUTPUTPORT.

◆ localclean()

void SubjectOutputPort::localclean ( Command command = 0)

Definition at line 3830 of file guiObservers.cxx.

3831 {
3832  DEBTRACE("SubjectOutputPort::localClean ");
3833  if (_parent)
3834  {
3835  SubjectElementaryNode* elem = dynamic_cast<SubjectElementaryNode*>(_parent);
3836  if (elem) elem->removePort(this);
3837  }
3838 }
virtual void removePort(SubjectDataPort *port)

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

Referenced by clean().

◆ setValue()

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

Generic method do nothing. Implementation in SubjectInputPort and SubjectOutputPort.

Reimplemented from YACS::HMI::SubjectDataPort.

Definition at line 3840 of file guiObservers.cxx.

3841 {
3842  DEBTRACE("SubjectOutputPort::setValue " << value);
3843  Proc *proc = GuiContext::getCurrent()->getProc();
3844  CommandSetOutPortValue *command =
3845  new CommandSetOutPortValue(proc->getChildName(getPort()->getNode()), getName(), value);
3846  if (command->execute())
3847  {
3848  GuiContext::getCurrent()->getInvoc()->add(command);
3849  return true;
3850  }
3851  else delete command;
3852  return false;
3853 }
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

◆ _outputPort

YACS::ENGINE::OutputPort* YACS::HMI::SubjectOutputPort::_outputPort
protected

Definition at line 250 of file guiObservers.hxx.

Referenced by SubjectOutputPort().


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