Version: 8.3.0
YACS::HMI::SubjectElementaryNode Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectElementaryNode:
Collaboration diagram for YACS::HMI::SubjectElementaryNode:

Public Member Functions

 SubjectElementaryNode (YACS::ENGINE::ElementaryNode *elementaryNode, Subject *parent)
 
virtual ~SubjectElementaryNode ()
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual SubjectDataPortaddInputPort (YACS::ENGINE::Catalog *catalog, std::string type, std::string name)
 
virtual SubjectDataPortaddOutputPort (YACS::ENGINE::Catalog *catalog, std::string type, std::string name)
 
virtual SubjectDataPortaddIDSPort (YACS::ENGINE::Catalog *catalog, std::string type, std::string name)
 
virtual SubjectDataPortaddODSPort (YACS::ENGINE::Catalog *catalog, std::string type, std::string name)
 
virtual bool OrderDataPorts (SubjectDataPort *portToMove, int isUp)
 
virtual void removePort (SubjectDataPort *port)
 
virtual void loadChildren ()
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
virtual void saveLinks ()
 
virtual void restoreLinks ()
 
- 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 removeExternalControlLinks ()
 
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 loadLinks ()
 
virtual void addSubjectReference (Subject *ref)
 
void localclean (Command *command=0)
 
void registerUndoDestroy ()
 
void askRegisterUndoDestroy ()
 
bool isDestructible ()
 
virtual TypeOfElem getType ()
 
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 ~Observer ()
 

Protected Attributes

YACS::ENGINE::ElementaryNode_elementaryNode
 
- 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::SubjectNode
static bool tryCreateLink (SubjectNode *subOutNode, SubjectNode *subInNode)
 
- 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
SubjectInputDataStreamPort
addSubjectIDSPort (YACS::ENGINE::InputDataStreamPort *port, std::string name="")
 
virtual
SubjectOutputDataStreamPort
addSubjectODSPort (YACS::ENGINE::OutputDataStreamPort *port, std::string name="")
 
virtual void notifyObserver (YACS::ENGINE::Node *object, const std::string &event)
 

Detailed Description

Definition at line 670 of file guiObservers.hxx.

Constructor & Destructor Documentation

SubjectElementaryNode::SubjectElementaryNode ( YACS::ENGINE::ElementaryNode elementaryNode,
Subject parent 
)

Definition at line 2058 of file guiObservers.cxx.

2060  : SubjectNode(elementaryNode, parent), _elementaryNode(elementaryNode)
2061 {
2062 }
SubjectElementaryNode::~SubjectElementaryNode ( )
virtual

all generic destruction is done in generic class SubjectNode

Definition at line 2067 of file guiObservers.cxx.

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

2068 {
2069  DEBTRACE("SubjectElementaryNode::~SubjectElementaryNode " << getName());
2070 }

Member Function Documentation

SubjectDataPort * SubjectElementaryNode::addIDSPort ( YACS::ENGINE::Catalog catalog,
std::string  type,
std::string  name 
)
virtual

Definition at line 2135 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_node, YACS::HMI::Invocator::add(), YACS::HMI::SubjectNode::CommandAddIDSPortFromCatalog, DEBTRACE, YACS::HMI::Command::execute(), YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::GuiContext::getProc(), YACS::HMI::CommandAddIDSPortFromCatalog::getSubjectIDSPort(), and YASSERT.

2136 {
2137  DEBTRACE("SubjectElementaryNode::addIDSPort( " << catalog << ", " << type << ", " << name << " )");
2138  Proc *proc = GuiContext::getCurrent()->getProc();
2139  string position = "";
2140  if (proc != dynamic_cast<Proc*>(_node)) position = proc->getChildName(_node);
2141  else YASSERT(0);
2143  type,
2144  position,
2145  name);
2146  if (command->execute())
2147  {
2148  GuiContext::getCurrent()->getInvoc()->add(command);
2150  return son;
2151  }
2152  else delete command;
2153  return 0;
2154 }
SubjectDataPort * SubjectElementaryNode::addInputPort ( YACS::ENGINE::Catalog catalog,
std::string  type,
std::string  name 
)
virtual

Definition at line 2093 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_node, YACS::HMI::Invocator::add(), YACS::HMI::SubjectNode::CommandAddInputPortFromCatalog, DEBTRACE, YACS::HMI::Command::execute(), YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::GuiContext::getProc(), YACS::HMI::CommandAddInputPortFromCatalog::getSubjectInputPort(), and YASSERT.

Referenced by YACS::HMI::GuiEditor::CreateInputPort().

2094 {
2095  DEBTRACE("SubjectElementaryNode::addInputPort( " << catalog << ", " << type << ", " << name << " )");
2096  Proc *proc = GuiContext::getCurrent()->getProc();
2097  string position = "";
2098  if (proc != dynamic_cast<Proc*>(_node)) position = proc->getChildName(_node);
2099  else YASSERT(0);
2101  type,
2102  position,
2103  name);
2104  if (command->execute())
2105  {
2106  GuiContext::getCurrent()->getInvoc()->add(command);
2107  SubjectInputPort *son = command->getSubjectInputPort();
2108  return son;
2109  }
2110  else delete command;
2111  return 0;
2112 }
SubjectDataPort * SubjectElementaryNode::addODSPort ( YACS::ENGINE::Catalog catalog,
std::string  type,
std::string  name 
)
virtual

Definition at line 2156 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_node, YACS::HMI::Invocator::add(), YACS::HMI::SubjectNode::CommandAddODSPortFromCatalog, DEBTRACE, YACS::HMI::Command::execute(), YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::GuiContext::getProc(), YACS::HMI::CommandAddODSPortFromCatalog::getSubjectODSPort(), and YASSERT.

2157 {
2158  DEBTRACE("SubjectElementaryNode::addODSPort( " << catalog << ", " << type << ", " << name << " )");
2159  Proc *proc = GuiContext::getCurrent()->getProc();
2160  string position = "";
2161  if (proc != dynamic_cast<Proc*>(_node)) position = proc->getChildName(_node);
2162  else YASSERT(0);
2164  type,
2165  position,
2166  name);
2167  if (command->execute())
2168  {
2169  GuiContext::getCurrent()->getInvoc()->add(command);
2171  return son;
2172  }
2173  else delete command;
2174  return 0;
2175 }
SubjectDataPort * SubjectElementaryNode::addOutputPort ( YACS::ENGINE::Catalog catalog,
std::string  type,
std::string  name 
)
virtual

Definition at line 2114 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_node, YACS::HMI::Invocator::add(), YACS::HMI::SubjectNode::CommandAddOutputPortFromCatalog, DEBTRACE, YACS::HMI::Command::execute(), YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::GuiContext::getProc(), YACS::HMI::CommandAddOutputPortFromCatalog::getSubjectOutputPort(), and YASSERT.

Referenced by YACS::HMI::GuiEditor::CreateOutputPort().

2115 {
2116  DEBTRACE("SubjectElementaryNode::addOutputPort( " << catalog << ", " << type << ", " << name << " )");
2117  Proc *proc = GuiContext::getCurrent()->getProc();
2118  string position = "";
2119  if (proc != dynamic_cast<Proc*>(_node)) position = proc->getChildName(_node);
2120  else YASSERT(0);
2122  type,
2123  position,
2124  name);
2125  if (command->execute())
2126  {
2127  GuiContext::getCurrent()->getInvoc()->add(command);
2128  SubjectOutputPort *son = command->getSubjectOutputPort();
2129  return son;
2130  }
2131  else delete command;
2132  return 0;
2133 }
void SubjectElementaryNode::loadChildren ( )
virtual

Reimplemented from YACS::HMI::Subject.

Definition at line 2228 of file guiObservers.cxx.

References _elementaryNode, YACS::HMI::SubjectNode::addSubjectIDSPort(), YACS::HMI::SubjectNode::addSubjectInputPort(), YACS::HMI::SubjectNode::addSubjectODSPort(), YACS::HMI::SubjectNode::addSubjectOutputPort(), YACS::ENGINE::ElementaryNode::getLocalInputPorts(), YACS::ENGINE::ElementaryNode::getLocalOutputPorts(), YACS::ENGINE::ElementaryNode::getSetOfInputDataStreamPort(), and YACS::ENGINE::ElementaryNode::getSetOfOutputDataStreamPort().

2229 {
2230  list<InputPort*> listInputPorts = _elementaryNode->getLocalInputPorts();
2231  list<OutputPort*> listOutputPorts = _elementaryNode->getLocalOutputPorts();
2232  list<InputDataStreamPort*> listIDSPorts = _elementaryNode->getSetOfInputDataStreamPort();
2233  list<OutputDataStreamPort*> listODSPorts = _elementaryNode->getSetOfOutputDataStreamPort();
2234  if (SplitterNode *splitterNode = dynamic_cast<SplitterNode*>(_elementaryNode))
2235  listInputPorts.push_back(splitterNode->getFather()->getInputPort("SmplsCollection"));
2236  list<InputPort*>::const_iterator iti;
2237  for (iti = listInputPorts.begin(); iti != listInputPorts.end(); ++iti)
2238  addSubjectInputPort(*iti);
2239  list<OutputPort*>::const_iterator ito;
2240  for (ito = listOutputPorts.begin(); ito != listOutputPorts.end(); ++ito)
2241  addSubjectOutputPort(*ito);
2242  list<InputDataStreamPort*>::const_iterator itids;
2243  for (itids = listIDSPorts.begin(); itids != listIDSPorts.end(); ++itids)
2244  addSubjectIDSPort(*itids);
2245  list<OutputDataStreamPort*>::const_iterator itods;
2246  for (itods = listODSPorts.begin(); itods != listODSPorts.end(); ++itods)
2247  addSubjectODSPort(*itods);
2248 }
void SubjectElementaryNode::localclean ( Command command = 0)

Definition at line 2083 of file guiObservers.cxx.

References DEBTRACE.

Referenced by clean().

2084 {
2085  DEBTRACE("SubjectElementaryNode::localClean ");
2086 }
bool SubjectElementaryNode::OrderDataPorts ( SubjectDataPort portToMove,
int  isUp 
)
virtual

Definition at line 2177 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_node, 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::GuiContext::getProc(), and YASSERT.

Referenced by YACS::HMI::TablePortsEdition::oncb_insert_activated(), and YACS::HMI::TablePortsEdition::upOrDown().

2178 {
2179  DEBTRACE("SubjectElementaryNode::OrderDataPorts");
2180  Proc *proc = GuiContext::getCurrent()->getProc();
2181  string position = "";
2182  if (proc != dynamic_cast<Proc*>(_node)) position = proc->getChildName(_node);
2183  else YASSERT(0);
2184 
2185  if (!portToMove) return false;
2186  string nameToMove = portToMove->getName();
2187 
2188  Command *command = 0;
2189  bool isInput = dynamic_cast<SubjectInputPort*>(portToMove);
2190  if (isInput)
2191  command = new CommandOrderInputPorts(position, nameToMove, isUp);
2192  else
2193  command = new CommandOrderOutputPorts(position, nameToMove, isUp);
2194 
2195  if (command->execute())
2196  {
2197  GuiContext::getCurrent()->getInvoc()->add(command);
2198  return true;
2199  }
2200  return false;
2201 }
void SubjectElementaryNode::recursiveUpdate ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 2088 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::update().

2089 {
2090  update(event, type, son);
2091 }
void SubjectElementaryNode::removePort ( SubjectDataPort port)
virtual

Definition at line 2203 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::_listSubjectIDSPort, YACS::HMI::SubjectNode::_listSubjectInputPort, YACS::HMI::SubjectNode::_listSubjectODSPort, YACS::HMI::SubjectNode::_listSubjectOutputPort, DEBTRACE, and YACS::HMI::SubjectDataPort::getName().

Referenced by YACS::HMI::SubjectInputPort::localclean(), and YACS::HMI::SubjectOutputPort::localclean().

2204 {
2205  DEBTRACE("SubjectElementaryNode::removePort " << port->getName());
2206  if (SubjectInputPort* inp = dynamic_cast<SubjectInputPort*>(port))
2207  {
2208  DEBTRACE("-");
2209  _listSubjectInputPort.remove(inp);
2210  }
2211  else if(SubjectOutputPort* outp = dynamic_cast<SubjectOutputPort*>(port))
2212  {
2213  DEBTRACE("--");
2214  _listSubjectOutputPort.remove(outp);
2215  }
2216  if (SubjectInputDataStreamPort* idsp = dynamic_cast<SubjectInputDataStreamPort*>(port))
2217  {
2218  DEBTRACE("---");
2219  _listSubjectIDSPort.remove(idsp);
2220  }
2221  else if(SubjectOutputDataStreamPort* odsp = dynamic_cast<SubjectOutputDataStreamPort*>(port))
2222  {
2223  DEBTRACE("----");
2224  _listSubjectODSPort.remove(odsp);
2225  }
2226 }
void SubjectElementaryNode::restoreLinks ( )
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 2255 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::restoreLinks().

2256 {
2258 }
void SubjectElementaryNode::saveLinks ( )
virtual

Reimplemented from YACS::HMI::SubjectNode.

Definition at line 2250 of file guiObservers.cxx.

References YACS::HMI::SubjectNode::saveLinks().

2251 {
2253 }

Member Data Documentation

YACS::ENGINE::ElementaryNode* YACS::HMI::SubjectElementaryNode::_elementaryNode
protected

Definition at line 688 of file guiObservers.hxx.

Referenced by loadChildren().


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