Version: 8.3.0
YACS::HMI::SubjectControlLink Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectControlLink:
Collaboration diagram for YACS::HMI::SubjectControlLink:

Public Member Functions

 SubjectControlLink (SubjectNode *subOutNode, SubjectNode *subInNode, Subject *parent)
 
virtual ~SubjectControlLink ()
 
virtual std::string getName ()
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
SubjectNodegetSubjectOutNode ()
 
SubjectNodegetSubjectInNode ()
 
virtual TypeOfElem getType ()
 
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 setName (std::string name)
 
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

SubjectNode_subOutNode
 
SubjectNode_subInNode
 
std::string _name
 
YACS::ENGINE::ComposedNode_cla
 
- 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::Subject
static void erase (Subject *sub, Command *command=0, bool post=false)
 

Detailed Description

Definition at line 920 of file guiObservers.hxx.

Constructor & Destructor Documentation

SubjectControlLink::SubjectControlLink ( SubjectNode subOutNode,
SubjectNode subInNode,
Subject parent 
)

Definition at line 4119 of file guiObservers.cxx.

References _name, _subInNode, _subOutNode, DEBTRACE, YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::Node::getFather(), YACS::ENGINE::ComposedNode::getName(), YACS::HMI::SubjectNode::getName(), and YACS::HMI::SubjectNode::getNode().

4122  : Subject(parent),
4123  _subOutNode(subOutNode), _subInNode(subInNode)
4124 {
4125  _name = "";
4126  ComposedNode *cla = ComposedNode::getLowestCommonAncestor(_subOutNode->getNode()->getFather(),
4127  _subInNode->getNode()->getFather());
4130  DEBTRACE(cla->getName());
4131  _name += cla->getChildName(_subOutNode->getNode());
4132  _name += "-->>";
4133  _name += cla->getChildName(_subInNode->getNode());
4134  DEBTRACE("SubjectControlLink::SubjectControlLink " << _name);
4135 }
SubjectControlLink::~SubjectControlLink ( )
virtual

Definition at line 4137 of file guiObservers.cxx.

References _cla, _subInNode, _subOutNode, DEBTRACE, YACS::ENGINE::ComposedNode::edRemoveCFLink(), getName(), YACS::HMI::SubjectNode::getNode(), YACS::HMI::Subject::isDestructible(), and YACS::Exception::what().

4138 {
4139  DEBTRACE("SubjectControlLink::~SubjectControlLink " << getName());
4140  if (isDestructible())
4141  {
4142  try
4143  {
4144 
4146  }
4147  catch (YACS::Exception &e)
4148  {
4149  DEBTRACE("------------------------------------------------------------------------------");
4150  DEBTRACE("SubjectControlLink::~SubjectControlLink: edRemoveLink YACS exception " << e.what());
4151  DEBTRACE("------------------------------------------------------------------------------");
4152  }
4153  }
4154 }

Member Function Documentation

void SubjectControlLink::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::Subject.

Definition at line 4156 of file guiObservers.cxx.

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

4157 {
4158  if (_askRegisterUndo)
4159  {
4160  _askRegisterUndo = false;
4162  }
4163  localclean(command);
4164  Subject::clean(command);
4165 }
std::string SubjectControlLink::getName ( )
virtual

Reimplemented from YACS::HMI::Subject.

Definition at line 4181 of file guiObservers.cxx.

References _name.

Referenced by YACS::HMI::SubjectComposedNode::addSubjectControlLink(), localclean(), and ~SubjectControlLink().

4182 {
4183  return _name;
4184 }
SubjectNode* YACS::HMI::SubjectControlLink::getSubjectInNode ( )
inline
SubjectNode* YACS::HMI::SubjectControlLink::getSubjectOutNode ( )
inline
virtual TypeOfElem YACS::HMI::SubjectControlLink::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::Subject.

Definition at line 932 of file guiObservers.hxx.

References YACS::HMI::CONTROLLINK.

932 {return CONTROLLINK;}
void SubjectControlLink::localclean ( Command command = 0)

Definition at line 4167 of file guiObservers.cxx.

References _cla, YACS::HMI::Subject::_parent, DEBTRACE, YACS::HMI::Subject::getName(), getName(), and YASSERT.

Referenced by clean().

4168 {
4169  DEBTRACE("SubjectControlLink::localClean ");
4170  if (_parent)
4171  {
4172  DEBTRACE("clean control link: " << _parent->getName() << " " << getName());
4173  SubjectComposedNode* father = dynamic_cast<SubjectComposedNode*>(_parent);
4174  YASSERT(father);
4175  father->removeControlLink(this); // --- clean subjects first
4176  _cla = dynamic_cast<ComposedNode*>(father->getNode());
4177  YASSERT(_cla);
4178  }
4179 }
void SubjectControlLink::registerUndoDestroy ( )

Member Data Documentation

YACS::ENGINE::ComposedNode* YACS::HMI::SubjectControlLink::_cla
protected

Definition at line 938 of file guiObservers.hxx.

Referenced by localclean(), and ~SubjectControlLink().

std::string YACS::HMI::SubjectControlLink::_name
protected

Definition at line 937 of file guiObservers.hxx.

Referenced by getName(), and SubjectControlLink().

SubjectNode* YACS::HMI::SubjectControlLink::_subInNode
protected

Definition at line 936 of file guiObservers.hxx.

Referenced by getSubjectInNode(), SubjectControlLink(), and ~SubjectControlLink().

SubjectNode* YACS::HMI::SubjectControlLink::_subOutNode
protected

Definition at line 935 of file guiObservers.hxx.

Referenced by getSubjectOutNode(), SubjectControlLink(), and ~SubjectControlLink().


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