Version: 9.15.0
YACS::HMI::SubjectBloc Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectBloc:
Collaboration diagram for YACS::HMI::SubjectBloc:

Public Member Functions

 SubjectBloc (YACS::ENGINE::Bloc *bloc, Subject *parent)
 
virtual ~SubjectBloc ()
 
virtual SubjectNodeaddNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst)
 
virtual void removeNode (SubjectNode *child)
 
virtual void completeChildrenSubjectList (SubjectNode *son)
 
virtual SubjectNodegetChild (YACS::ENGINE::Node *node=0) const
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual void houseKeepingAfterCutPaste (bool isCut, SubjectNode *son)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
virtual TypeOfElem getType ()
 
- Public Member Functions inherited from YACS::HMI::SubjectComposedNode
 SubjectComposedNode (YACS::ENGINE::ComposedNode *composedNode, Subject *parent)
 
virtual ~SubjectComposedNode ()
 
virtual void loadChildren ()
 
virtual void loadLinks ()
 
SubjectNodeaddSubjectNode (YACS::ENGINE::Node *node, std::string name="", YACS::ENGINE::Catalog *catalog=0, std::string compo="", std::string type="")
 
SubjectLinkaddSubjectLink (SubjectNode *sno, SubjectDataPort *spo, SubjectNode *sni, SubjectDataPort *spi)
 
SubjectControlLinkaddSubjectControlLink (SubjectNode *sno, SubjectNode *sni)
 
virtual void removeLink (SubjectLink *link)
 
virtual void removeControlLink (SubjectControlLink *link)
 
virtual void removeExternalControlLinks ()
 
virtual bool hasValue ()
 
virtual std::string getValue ()
 
void localclean (Command *command=0)
 
- Public Member Functions inherited from YACS::HMI::SubjectNode
 SubjectNode (YACS::ENGINE::Node *node, Subject *parent)
 
virtual ~SubjectNode ()
 
virtual bool setProperties (std::map< std::string, std::string > properties)
 
virtual std::map< std::string, std::string > getProperties ()
 
virtual bool reparent (Subject *parent)
 
virtual bool copy (Subject *parent)
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual YACS::ENGINE::NodegetNode ()
 
void registerUndoDestroy ()
 
SubjectControlLinkaddSubjectControlLink (SubjectControlLink *sub)
 
void removeSubjectControlLink (SubjectControlLink *sub)
 
std::list< SubjectLink * > getSubjectLinks () const
 
std::list< SubjectControlLink * > getSubjectControlLinks () const
 
std::list< SubjectInputPort * > getSubjectInputPorts () const
 
std::list< SubjectOutputPort * > getSubjectOutputPorts () const
 
std::list< SubjectInputDataStreamPort * > getSubjectInputDataStreamPorts () const
 
std::list< SubjectOutputDataStreamPort * > getSubjectOutputDataStreamPorts () const
 
void localclean (Command *command=0)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual void removeExternalLinks ()
 
virtual void saveLinks ()
 
virtual void restoreLinks ()
 
virtual bool putInComposedNode (std::string name, std::string type, bool toSaveRestoreLinks=true)
 
virtual int isValid ()
 
void setExecState (int execState)
 
- 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 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 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 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::Bloc_bloc
 
std::set< SubjectNode * > _children
 
- Protected Attributes inherited from YACS::HMI::SubjectComposedNode
YACS::ENGINE::ComposedNode_composedNode
 
- Protected Attributes inherited from YACS::HMI::SubjectNode
YACS::ENGINE::Node_node
 
std::list< SubjectInputPort * > _listSubjectInputPort
 
std::list< SubjectOutputPort * > _listSubjectOutputPort
 
std::list< SubjectInputDataStreamPort * > _listSubjectIDSPort
 
std::list< SubjectOutputDataStreamPort * > _listSubjectODSPort
 
std::list< SubjectLink * > _listSubjectLink
 
std::list< SubjectControlLink * > _listSubjectControlLink
 
int _execState
 
std::list< YACS::ENGINE::OutGate * > loutgate
 
std::list< YACS::ENGINE::InGate * > singate
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataLinks
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataflowLinks
 
- 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::SubjectComposedNode
static SubjectComposedNodegetLowestCommonAncestor (SubjectNode *snode1, SubjectNode *snode2)
 Retrieves the lowest common ancestor of 2 nodes. More...
 
- Static Public Member Functions inherited from YACS::HMI::SubjectNode
static bool tryCreateLink (SubjectNode *subOutNode, SubjectNode *subInNode)
 
- Static Public Member Functions inherited from YACS::HMI::Subject
static void erase (Subject *sub, Command *command=0, bool post=false)
 
- Protected Member Functions inherited from YACS::HMI::SubjectComposedNode
virtual SubjectNodecreateNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst, int swCase=0)
 
- Protected Member Functions inherited from YACS::HMI::SubjectNode
virtual SubjectInputPortaddSubjectInputPort (YACS::ENGINE::InputPort *port, std::string name="")
 
virtual SubjectOutputPortaddSubjectOutputPort (YACS::ENGINE::OutputPort *port, std::string name="")
 
virtual SubjectInputDataStreamPortaddSubjectIDSPort (YACS::ENGINE::InputDataStreamPort *port, std::string name="")
 
virtual SubjectOutputDataStreamPortaddSubjectODSPort (YACS::ENGINE::OutputDataStreamPort *port, std::string name="")
 
virtual void notifyObserver (YACS::ENGINE::Node *object, const std::string &event)
 

Detailed Description

Definition at line 392 of file guiObservers.hxx.

Constructor & Destructor Documentation

◆ SubjectBloc()

SubjectBloc::SubjectBloc ( YACS::ENGINE::Bloc bloc,
Subject parent 
)

Definition at line 1710 of file guiObservers.cxx.

1711  : SubjectComposedNode(bloc, parent), _bloc(bloc)
1712 {
1713  _children.clear();
1714 }
YACS::ENGINE::Bloc * _bloc
std::set< SubjectNode * > _children
SubjectComposedNode(YACS::ENGINE::ComposedNode *composedNode, Subject *parent)

References _children.

◆ ~SubjectBloc()

SubjectBloc::~SubjectBloc ( )
virtual

all generic destruction is done in generic class SubjectNode

Definition at line 1719 of file guiObservers.cxx.

1720 {
1721  DEBTRACE("SubjectBloc::~SubjectBloc " << getName());
1722 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual std::string getName()

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

Member Function Documentation

◆ addNode()

SubjectNode * SubjectBloc::addNode ( YACS::ENGINE::Catalog catalog,
std::string  compo,
std::string  type,
std::string  name,
bool  newCompoInst 
)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 1744 of file guiObservers.cxx.

1749 {
1750  DEBTRACE("SubjectBloc::addNode( " << catalog << ", " << compo << ", " << type << ", " << name << " )");
1751  SubjectNode* child = createNode(catalog, compo, type, name, newCompoInst);
1752  return child;
1753 }
virtual SubjectNode * createNode(YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst, int swCase=0)

References YACS::HMI::SubjectComposedNode::createNode(), and DEBTRACE.

Referenced by YACS::HMI::GuiEditor::_createNode(), and gui.GraphViewer.GraphViewer::popup().

◆ clean()

void SubjectBloc::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::SubjectComposedNode.

Reimplemented in YACS::HMI::SubjectProc.

Definition at line 1724 of file guiObservers.cxx.

1725 {
1726  if (_askRegisterUndo)
1727  {
1728  _askRegisterUndo = false;
1730  }
1731  localclean(command);
1732  SubjectComposedNode::clean(command);
1733 }
void localclean(Command *command=0)
virtual void clean(Command *command=0)

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

Referenced by YACS::HMI::SubjectProc::clean().

◆ completeChildrenSubjectList()

void SubjectBloc::completeChildrenSubjectList ( SubjectNode son)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 1763 of file guiObservers.cxx.

1764 {
1765  _children.insert(son);
1766 }

References _children.

Referenced by houseKeepingAfterCutPaste().

◆ getChild()

SubjectNode * SubjectBloc::getChild ( YACS::ENGINE::Node node = 0) const
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 1773 of file guiObservers.cxx.

1774 {
1775  SubjectNode* aChild = 0;
1776 
1777  if (node)
1778  {
1779  set<SubjectNode*>::const_iterator it = _children.begin();
1780  for ( ; it != _children.end(); it++ )
1781  if ( (*it)->getNode() == node )
1782  {
1783  aChild = (*it);
1784  break;
1785  }
1786  }
1787 
1788  return aChild;
1789 }

References _children.

◆ getType()

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

Reimplemented from YACS::HMI::Subject.

Reimplemented in YACS::HMI::SubjectProc.

Definition at line 409 of file guiObservers.hxx.

409 {return BLOC;}

References YACS::HMI::BLOC.

◆ houseKeepingAfterCutPaste()

void SubjectBloc::houseKeepingAfterCutPaste ( bool  isCut,
SubjectNode son 
)
virtual

Reimplemented from YACS::HMI::SubjectComposedNode.

Definition at line 1755 of file guiObservers.cxx.

1756 {
1757  if (isCut)
1758  removeNode(son);
1759  else
1761 }
virtual void removeNode(SubjectNode *child)
virtual void completeChildrenSubjectList(SubjectNode *son)

References completeChildrenSubjectList(), and removeNode().

◆ localclean()

void SubjectBloc::localclean ( Command command = 0)

Definition at line 1735 of file guiObservers.cxx.

1736 {
1737  DEBTRACE("SubjectBloc::localClean ");
1738  set<SubjectNode*>::iterator it;
1739  set<SubjectNode*> copyChildren = _children;
1740  for (it = copyChildren.begin(); it !=copyChildren.end(); ++it)
1741  erase(*it);
1742 }
static void erase(Subject *sub, Command *command=0, bool post=false)

References _children, DEBTRACE, and YACS::HMI::Subject::erase().

Referenced by clean().

◆ recursiveUpdate()

void SubjectBloc::recursiveUpdate ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 1791 of file guiObservers.cxx.

1792 {
1793  update(event, type, son);
1794  set<SubjectNode*>::iterator it = _children.begin();
1795  for (; it != _children.end(); ++it)
1796  (*it)->recursiveUpdate(event, type, son);
1797 }
virtual void update(GuiEvent event, int type, Subject *son)

References _children, and YACS::HMI::SubjectNode::update().

◆ removeNode()

void SubjectBloc::removeNode ( SubjectNode child)
virtual

Definition at line 1768 of file guiObservers.cxx.

1769 {
1770  _children.erase(child);
1771 }

References _children.

Referenced by houseKeepingAfterCutPaste().

Member Data Documentation

◆ _bloc

YACS::ENGINE::Bloc* YACS::HMI::SubjectBloc::_bloc
protected

Definition at line 411 of file guiObservers.hxx.

◆ _children

std::set<SubjectNode*> YACS::HMI::SubjectBloc::_children
protected

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