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

Detailed Description

Definition at line 239 of file guiObservers.hxx.

Constructor & Destructor Documentation

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

Definition at line 3802 of file guiObservers.cxx.

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

3803  : SubjectDataPort(port, parent), _outputPort(port)
3804 {
3805  if (DynParaLoop* dynloop = dynamic_cast<DynParaLoop*>(_outputPort->getNode()))
3806  {
3807  if (_outputPort == dynloop->edGetSamplePort()) _destructible = false;
3808  }
3809 }
SubjectOutputPort::~SubjectOutputPort ( )
virtual

Definition at line 3811 of file guiObservers.cxx.

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

3812 {
3813  DEBTRACE("SubjectOutputPort::~SubjectOutputPort " << getName());
3814 }

Member Function Documentation

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

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

3817 {
3818  if (_askRegisterUndo)
3819  {
3820  _askRegisterUndo = false;
3822  }
3823  localclean(command);
3824  SubjectDataPort::clean(command);
3825 }
virtual TypeOfElem YACS::HMI::SubjectOutputPort::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 247 of file guiObservers.hxx.

References YACS::HMI::OUTPUTPORT.

247 {return OUTPUTPORT;}
void SubjectOutputPort::localclean ( Command command = 0)

Definition at line 3827 of file guiObservers.cxx.

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

Referenced by clean().

3828 {
3829  DEBTRACE("SubjectOutputPort::localClean ");
3830  if (_parent)
3831  {
3832  SubjectElementaryNode* elem = dynamic_cast<SubjectElementaryNode*>(_parent);
3833  if (elem) elem->removePort(this);
3834  }
3835 }
bool SubjectOutputPort::setValue ( std::string  value)
virtual

Generic method do nothing. Implementation in SubjectInputPort and SubjectOutputPort.

Reimplemented from YACS::HMI::SubjectDataPort.

Definition at line 3837 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().

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

Member Data Documentation

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

Definition at line 249 of file guiObservers.hxx.

Referenced by SubjectOutputPort().


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