Version: 9.15.0
YACS::ENGINE::ElementaryNode Class Reference

Base class for all calculation nodes. More...

#include <ElementaryNode.hxx>

Inheritance diagram for YACS::ENGINE::ElementaryNode:
Collaboration diagram for YACS::ENGINE::ElementaryNode:

Public Member Functions

virtual ~ElementaryNode ()
 
void exUpdateState ()
 Update the node state. More...
 
void init (bool start=true)
 
bool isDeployable () const
 
ComponentInstancegetComponent ()
 
const ComponentInstancegetComponent () const
 
ContainergetContainer ()
 
YACS::StatesForNode getState () const
 
void getReadyTasks (std::vector< Task * > &tasks)
 
void edRemovePort (Port *port)
 
std::list< ElementaryNode * > getRecursiveConstituents () const
 
std::list< ProgressWeightgetProgressWeight () const
 Get the progress weight for all elementary nodes. More...
 
NodegetChildByName (const std::string &name) const
 
virtual void checkBasicConsistency () const
 
ComposedNodegetDynClonerIfExists (const ComposedNode *levelToStop) const
 
int getNumberOfInputPorts () const
 
int getNumberOfOutputPorts () const
 
std::string getInPortName (const InPort *) const
 
std::string getOutPortName (const OutPort *) const
 
InputPortgetInputPort (const std::string &name) const
 
OutputPortgetOutputPort (const std::string &name) const
 
std::list< InputPort * > getSetOfInputPort () const
 
std::list< OutputPort * > getSetOfOutputPort () const
 
std::list< InputPort * > getLocalInputPorts () const
 
std::list< OutputPort * > getLocalOutputPorts () const
 
std::set< OutPort * > getAllOutPortsLeavingCurrentScope () const
 
std::set< InPort * > getAllInPortsComingFromOutsideOfCurrentScope () const
 
virtual std::vector< std::pair< OutPort *, InPort * > > getSetOfLinksLeavingCurrentScope () const
 
virtual std::vector< std::pair< InPort *, OutPort * > > getSetOfLinksComingInCurrentScope () const
 
std::list< InputDataStreamPort * > getSetOfInputDataStreamPort () const
 
std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort () const
 
InputDataStreamPortgetInputDataStreamPort (const std::string &name) const
 
OutputDataStreamPortgetOutputDataStreamPort (const std::string &name) const
 
virtual InputPortcreateInputPort (const std::string &inputPortName, TypeCode *type)
 
virtual OutputPortcreateOutputPort (const std::string &outputPortName, TypeCode *type)
 
virtual InputDataStreamPortcreateInputDataStreamPort (const std::string &inputPortDSName, TypeCode *type)
 
virtual OutputDataStreamPortcreateOutputDataStreamPort (const std::string &outputPortDSName, TypeCode *type)
 
virtual InputPortedAddInputPort (const std::string &inputPortName, TypeCode *type)
 
virtual OutputPortedAddOutputPort (const std::string &outputPortName, TypeCode *type)
 
virtual InputDataStreamPortedAddInputDataStreamPort (const std::string &inputPortDSName, TypeCode *type)
 
virtual OutputDataStreamPortedAddOutputDataStreamPort (const std::string &outputPortDSName, TypeCode *type)
 
virtual void edOrderInputPorts (const std::list< InputPort * > &ports)
 
virtual void edOrderOutputPorts (const std::list< OutputPort * > &ports)
 
virtual std::string typeName ()
 
virtual void edUpdateState ()
 update the status of the node More...
 
virtual void ensureLoading ()
 Put this node into TOLOAD state when possible. More...
 
int getMaxLevelOfParallelism () const
 
ComplexWeightgetWeight ()
 
void setWeight (double elementaryWeight)
 
void getWeightRegardingDPL (ComplexWeight *weight)
 
void partitionRegardingDPL (const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap)
 
void begin ()
 
bool isReady ()
 
void finished ()
 
void aborted ()
 
void loaded ()
 Notify this node that it is loaded. More...
 
void connected ()
 Notify this node that it is connected. More...
 
virtual std::string getErrorDetails ()
 Give a description of error when node status is ERROR. More...
 
virtual void initService ()
 
virtual void connectService ()
 
virtual void disconnectService ()
 
virtual void load ()
 
virtual void getCoupledTasks (std::set< Task * > &coupledSet)
 Calls getCoupledNodes for Task interface. More...
 
virtual void getCoupledNodes (std::set< Task * > &coupledSet)
 Put all nodes that are coupled to this node in coupledSet. More...
 
void accept (Visitor *visitor)
 
virtual void addDatastreamPortToInitMultiService (const std::string &port_name, int number)
 
- Public Member Functions inherited from YACS::ENGINE::Node
virtual ~Node ()
 
virtual void shutdown (int level)
 Stop all pending activities of the node. More...
 
virtual void resetState (int level)
 Reset the node state depending on the parameter level. More...
 
Nodeclone (ComposedNode *father, bool editionOnly=true) const
 This method MUST NEVER BE VIRTUAL More...
 
NodecloneWithoutCompAndContDeepCpy (ComposedNode *father, bool editionOnly=true) const
 This method MUST NEVER BE VIRTUAL More...
 
void setState (YACS::StatesForNode theState)
 Sets the given state for node. More...
 
virtual YACS::StatesForNode getEffectiveState () const
 Return the node state in the context of its father. More...
 
virtual YACS::StatesForNode getEffectiveState (const Node *) const
 Return the effective state of a node in the context of this one (its father) More...
 
std::string getColorState (YACS::StatesForNode state) const
 Return the color associated to a state. More...
 
InGategetInGate ()
 
OutGategetOutGate ()
 
const std::string & getName () const
 
void setName (const std::string &name)
 Change the name of the node. More...
 
ComposedNodegetFather () const
 
const std::string getId () const
 
bool exIsControlReady () const
 
std::list< Node * > getOutNodes () const
 
virtual void writeDot (std::ostream &os) const
 Dump to the input stream a dot representation of the node. More...
 
void writeDotInFile (const std::string &fileName) const
 
virtual void exFailedState ()
 Notify this node that its execution has failed. More...
 
virtual void exDisabledState ()
 Notify this node that it has been disabled. More...
 
std::list< InPort * > getSetOfInPort () const
 
std::list< OutPort * > getSetOfOutPort () const
 
virtual std::set< InputPort * > edGetSetOfUnitializedInputPort () const
 Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More...
 
virtual bool edAreAllInputPortInitialized () const
 Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More...
 
InPortgetInPort (const std::string &name) const
 
InPropertyPortgetInPropertyPort () const
 
virtual OutPortgetOutPort (const std::string &name) const
 
std::list< ComposedNode * > getAllAscendanceOf (ComposedNode *levelToStop=0) const
 
bool operator> (const Node &other) const
 
bool operator< (const Node &other) const
 
std::string getImplementation () const
 
DynParaLoopgetClosestDPLAmongAncestors () const
 
virtual ComposedNodegetRootNode () const
 
virtual void setProperty (const std::string &name, const std::string &value)
 
virtual std::string getProperty (const std::string &name)
 
std::map< std::string, std::string > getProperties ()
 
std::map< std::string, std::string > getPropertyMap ()
 
virtual void setProperties (std::map< std::string, std::string > properties)
 
virtual ProcgetProc ()
 
virtual const ProcgetProc () const
 
std::string getQualifiedName () const
 same as Node::getName() in most cases, but differs for children of switch More...
 
int getNumId ()
 return node instance identifiant, unique for each node instance More...
 
std::vector< std::pair< std::string, int > > getDPLScopeInfo (ComposedNode *gfn)
 
virtual void applyDPLScope (ComposedNode *gfn)
 
virtual void sendEvent (const std::string &event)
 emit notification to all observers registered with the dispatcher More...
 
virtual void sendEvent2 (const std::string &event, void *something)
 emit notification to all observers registered with the dispatcher More...
 
virtual std::string getErrorDetails () const
 
virtual void setErrorDetails (const std::string &error)
 
virtual void modified ()
 Sets Node in modified state and its father if it exists. More...
 
virtual int isModified ()
 
virtual int isValid ()
 indicates if the node is valid (returns 1) or not (returns 0) More...
 
virtual std::string getErrorReport ()
 returns a string that contains an error report if the node is in error More...
 
virtual std::string getContainerLog ()
 returns a string that contains the name of the container log file if it exists More...
 
virtual void cleanNodes ()
 Clean the node in case of not clean exit. More...
 
- Public Member Functions inherited from YACS::ENGINE::Task
virtual void execute ()=0
 
virtual void imposeResource (const std::string &resource_name, const std::string &container_name)
 
virtual bool canAcceptImposedResource ()
 
virtual bool hasImposedResource () const
 
virtual ~Task ()
 

Protected Member Functions

 ElementaryNode (const std::string &name)
 
 ElementaryNode (const ElementaryNode &other, ComposedNode *father)
 
void performDuplicationOfPlacement (const Node &other)
 performs a duplication of placement using clone method of containers and components. clone behaviour is driven by attachOnCloning attribute. More...
 
void performShallowDuplicationOfPlacement (const Node &other)
 performs a also duplication of placement but here containers and components are not copied at all whatever the value of attachedOnCloning. More...
 
void initCommonPartWithoutStateManagement (bool start)
 
virtual void createMultiDatastreamPorts ()
 
void edDisconnectAllLinksWithMe ()
 
bool areAllInputPortsValid () const
 
template<class PORT >
PORT * getPort (const std::string &name, const std::list< PORT * > &setOfPorts) const
 
template<class PORT , class ENUMTYPE >
PORT * edAddPort (const std::string &portName, std::list< PORT * > &setOfPorts, ENUMTYPE type)
 
template<class PORT , class ENUMTYPE >
bool edCheckAddPort (const std::string &portName, std::list< PORT * > &setOfPorts, ENUMTYPE type)
 
- Protected Member Functions inherited from YACS::ENGINE::Node
 Node (const std::string &name)
 
 Node (const Node &other, ComposedNode *father)
 
virtual NodesimpleClone (ComposedNode *father, bool editionOnly=true) const =0
 
virtual void exForwardFailed ()
 
virtual void exForwardFinished ()
 

Static Protected Member Functions

template<class PORT >
static void edRemovePortTypedFromSet (PORT *port, std::list< PORT * > &setOfPorts)
 
template<class PORT >
static bool isPortNameAlreadyExist (const std::string &portName, const std::list< PORT * > &setOfPorts)
 
- Static Protected Member Functions inherited from YACS::ENGINE::Node
static void checkValidityOfPortName (const std::string &name)
 
static ComposedNodecheckHavingCommonFather (Node *node1, Node *node2)
 

Protected Attributes

std::list< InputPort * > _setOfInputPort
 
std::list< OutputPort * > _setOfOutputPort
 
std::list< InputDataStreamPort * > _setOfInputDataStreamPort
 
std::list< OutputDataStreamPort * > _setOfOutputDataStreamPort
 
ComplexWeight _weight
 
bool _createDatastreamPorts
 
bool _multi_port_node
 
- Protected Attributes inherited from YACS::ENGINE::Node
InGate _inGate
 
OutGate _outGate
 
InPropertyPort_inPropertyPort
 
std::string _name
 
ComposedNode_father
 
YACS::StatesForNode _state
 
int _modified
 
std::string _errorDetails
 
int _numId
 
std::string _implementation
 
std::map< std::string, std::string > _propertyMap
 
Node_eventReceiver =nullptr
 

Friends

class ComposedNode
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::Node
static std::string getStateName (YACS::StatesForNode state)
 Return the name of a state. More...
 
static void checkValidityOfNodeName (const std::string &name)
 
- Public Attributes inherited from YACS::ENGINE::Node
YACS::Colour _colour
 
- Static Public Attributes inherited from YACS::ENGINE::Node
static std::map< int, Node * > idMap
 
- Static Protected Attributes inherited from YACS::ENGINE::Node
static const char SEP_CHAR_IN_PORT [] ="."
 
static int _total = 0
 

Detailed Description

Base class for all calculation nodes.

This is an abstract class that must be specialized.

Definition at line 43 of file ElementaryNode.hxx.

Constructor & Destructor Documentation

◆ ElementaryNode() [1/2]

ElementaryNode::ElementaryNode ( const std::string &  name)
protected

Definition at line 47 of file ElementaryNode.cxx.

47  :
48  Node(name),
50  _multi_port_node(false),
51  _weight()
52 {
54 }
Node(const std::string &name)
Definition: Node.cxx:69

References _weight, and YACS::ENGINE::ComplexWeight::setDefaultElementary().

◆ ElementaryNode() [2/2]

ElementaryNode::ElementaryNode ( const ElementaryNode other,
ComposedNode father 
)
protected

Definition at line 56 of file ElementaryNode.cxx.

56  :Node(other,father), _weight(other._weight)
57 {
60  for(list<InputPort *>::const_iterator iter1=other._setOfInputPort.begin();iter1!=other._setOfInputPort.end();iter1++)
61  _setOfInputPort.push_back((InputPort *)(*iter1)->clone(this));
62  for(list<OutputPort *>::const_iterator iter2=other._setOfOutputPort.begin();iter2!=other._setOfOutputPort.end();iter2++)
63  _setOfOutputPort.push_back((OutputPort *)(*iter2)->clone(this));
64  for(list<InputDataStreamPort *>::const_iterator iter3=other._setOfInputDataStreamPort.begin();iter3!=other._setOfInputDataStreamPort.end();iter3++)
65  _setOfInputDataStreamPort.push_back((InputDataStreamPort *)(*iter3)->clone(this));
66  for(list<OutputDataStreamPort *>::const_iterator iter4=other._setOfOutputDataStreamPort.begin();iter4!=other._setOfOutputDataStreamPort.end();iter4++)
67  _setOfOutputDataStreamPort.push_back((OutputDataStreamPort *)(*iter4)->clone(this));
68 }
std::list< InputPort * > _setOfInputPort
std::list< OutputDataStreamPort * > _setOfOutputDataStreamPort
std::list< InputDataStreamPort * > _setOfInputDataStreamPort
std::list< OutputPort * > _setOfOutputPort
Base class for Input Ports.
Definition: InputPort.hxx:44

References _createDatastreamPorts, _multi_port_node, _setOfInputDataStreamPort, _setOfInputPort, _setOfOutputDataStreamPort, and _setOfOutputPort.

◆ ~ElementaryNode()

ElementaryNode::~ElementaryNode ( )
virtual

Definition at line 78 of file ElementaryNode.cxx.

79 {
80  for(list<InputPort *>::iterator iter1=_setOfInputPort.begin();iter1!=_setOfInputPort.end();iter1++)
81  delete *iter1;
82  for(list<OutputPort *>::iterator iter2=_setOfOutputPort.begin();iter2!=_setOfOutputPort.end();iter2++)
83  delete *iter2;
84  for(list<InputDataStreamPort *>::iterator iter3=_setOfInputDataStreamPort.begin();iter3!=_setOfInputDataStreamPort.end();iter3++)
85  delete *iter3;
86  for(list<OutputDataStreamPort *>::iterator iter4=_setOfOutputDataStreamPort.begin();iter4!=_setOfOutputDataStreamPort.end();iter4++)
87  delete *iter4;
88 }

References _setOfInputDataStreamPort, _setOfInputPort, _setOfOutputDataStreamPort, and _setOfOutputPort.

Member Function Documentation

◆ aborted()

void ElementaryNode::aborted ( )
virtual

Implements YACS::ENGINE::Task.

Reimplemented in YACS::ENGINE::FakeNodeForSwitch, YACS::ENGINE::FakeNodeForOptimizerLoop, YACS::ENGINE::FakeNodeForLoop, and YACS::ENGINE::FakeNodeForForEachLoop.

Definition at line 763 of file ElementaryNode.cxx.

764 {
765  setState(ERROR);
766 }
void setState(YACS::StatesForNode theState)
Sets the given state for node.
Definition: Node.cxx:652
@ ERROR
Definition: define.hxx:52

References YACS::ERROR, and YACS::ENGINE::Node::setState().

◆ accept()

◆ addDatastreamPortToInitMultiService()

virtual void YACS::ENGINE::ElementaryNode::addDatastreamPortToInitMultiService ( const std::string &  port_name,
int  number 
)
inlinevirtual

Definition at line 134 of file ElementaryNode.hxx.

135  {}

Referenced by createMultiDatastreamPorts().

◆ areAllInputPortsValid()

bool ElementaryNode::areAllInputPortsValid ( ) const
protected

checks if all input ports contains a valid data. Used at execution to change the state of the node for activation.

Definition at line 274 of file ElementaryNode.cxx.

275 {
276  bool ret=true;
277  for(list<InputPort *>::const_iterator iter=_setOfInputPort.begin();iter!=_setOfInputPort.end();iter++)
278  {
279  ret=!(*iter)->isEmpty();
280  if (!ret) break;
281  }
282  return ret;
283 }

References _setOfInputPort.

Referenced by connected(), and exUpdateState().

◆ begin()

void ElementaryNode::begin ( )
virtual

Implements YACS::ENGINE::Task.

Definition at line 749 of file ElementaryNode.cxx.

750 {
752 }
@ ACTIVATED
Definition: define.hxx:41

References YACS::ACTIVATED, and YACS::ENGINE::Node::setState().

Referenced by YACS::HMI::SubjectNode::registerUndoDestroy().

◆ checkBasicConsistency()

void ElementaryNode::checkBasicConsistency ( ) const
virtual

Reimplemented in YACS::ENGINE::StudyOutNode, YACS::ENGINE::StudyInNode, YACS::ENGINE::PyFuncNode, YACS::ENGINE::PythonNode, YACS::ENGINE::PresetNode, YACS::ENGINE::OutNode, and YACS::ENGINE::InlineFuncNode.

Definition at line 577 of file ElementaryNode.cxx.

578 {
579  DEBTRACE("ElementaryNode::checkBasicConsistency");
580  list<InputPort *>::const_iterator iter;
581  for(iter=_setOfInputPort.begin();iter!=_setOfInputPort.end();iter++)
582  (*iter)->checkBasicConsistency();
583 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References _setOfInputPort, and DEBTRACE.

Referenced by YACS::ENGINE::InlineFuncNode::checkBasicConsistency(), YACS::ENGINE::PythonNode::checkBasicConsistency(), and edUpdateState().

◆ connected()

void ElementaryNode::connected ( )
virtual

Notify this node that it is connected.

When an elementary node has been connected it goes to TOACTIVATE state It is then ready to be executed

Implements YACS::ENGINE::Task.

Definition at line 784 of file ElementaryNode.cxx.

785 {
786  if(_inGate.exIsReady())
788  {
790  return;
791  }
792  setState(LOADED);
793 }
bool exIsReady() const
Definition: InGate.cxx:126
InGate _inGate
Definition: Node.hxx:86
@ LOADED
Definition: define.hxx:39
@ TOACTIVATE
Definition: define.hxx:40

References YACS::ENGINE::Node::_inGate, areAllInputPortsValid(), YACS::ENGINE::InGate::exIsReady(), YACS::LOADED, YACS::ENGINE::Node::setState(), and YACS::TOACTIVATE.

◆ connectService()

virtual void YACS::ENGINE::ElementaryNode::connectService ( )
inlinevirtual

Implements YACS::ENGINE::Task.

Definition at line 125 of file ElementaryNode.hxx.

125 { }

◆ createInputDataStreamPort()

InputDataStreamPort * ElementaryNode::createInputDataStreamPort ( const std::string &  inputPortDSName,
TypeCode type 
)
virtual

Definition at line 689 of file ElementaryNode.cxx.

690 {
691  return getRuntime()->createInputDataStreamPort(inputPortDSName, this, type);
692 }
virtual InputDataStreamPort * createInputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
Definition: Runtime.cxx:269
YACSLIBENGINE_EXPORT Runtime * getRuntime()
Definition: Runtime.cxx:61

References YACS::ENGINE::Runtime::createInputDataStreamPort(), and YACS::ENGINE::getRuntime().

Referenced by edAddInputDataStreamPort().

◆ createInputPort()

InputPort * ElementaryNode::createInputPort ( const std::string &  inputPortName,
TypeCode type 
)
virtual

Reimplemented in YACS::ENGINE::StudyOutNode, and YACS::ENGINE::OutNode.

Definition at line 593 of file ElementaryNode.cxx.

594 {
595  return getRuntime()->createInputPort(inputPortName, _implementation, this, type);
596 }
std::string _implementation
Definition: Node.hxx:97
virtual InputPort * createInputPort(const std::string &name, const std::string &impl, Node *node, TypeCode *type)=0

References YACS::ENGINE::Node::_implementation, YACS::ENGINE::Runtime::createInputPort(), and YACS::ENGINE::getRuntime().

Referenced by edAddInputPort().

◆ createMultiDatastreamPorts()

void ElementaryNode::createMultiDatastreamPorts ( )
protectedvirtual

Definition at line 290 of file ElementaryNode.cxx.

291 {
293  {
294  _createDatastreamPorts = true;
295  for(list<InputDataStreamPort *>::const_iterator iter3 = _setOfInputDataStreamPort.begin(); iter3!=_setOfInputDataStreamPort.end();iter3++)
296  {
297  InputDataStreamPort * port = *iter3;
298  std::string port_name = port->getName();
299  std::map<std::string,std::string>::iterator it=_propertyMap.find(port_name);
300  int multi = 1;
301  if(it != _propertyMap.end())
302  {
303  std::string multi_str = it->second;
304  std::istringstream iss(multi_str);
305  if (!(iss >> multi))
306  throw Exception("Property multi port should be set with a stringified int not an: " + multi_str);
307  }
308 
309  if (multi > 1)
310  {
311  addDatastreamPortToInitMultiService(port_name, multi);
312  // Change name of first port
313  port->setName(port_name + "_0");
314  for (int i = 2; i <= multi; i++)
315  {
316  InputDataStreamPort * new_port = port->clone(this);
317  std::ostringstream number;
318  number << i-1;
319  new_port->setName(port_name + "_" + number.str());
320  _setOfInputDataStreamPort.push_back(new_port);
321  _multi_port_node = true;
322  }
323  }
324  }
325  for(list<OutputDataStreamPort *>::const_iterator iter4 = _setOfOutputDataStreamPort.begin(); iter4!=_setOfOutputDataStreamPort.end();iter4++)
326  {
327  OutputDataStreamPort * port = *iter4;
328  std::string port_name = port->getName();
329  std::map<std::string,std::string>::iterator it=_propertyMap.find(port_name);
330  int multi = 1;
331  if(it != _propertyMap.end())
332  {
333  std::string multi_str = it->second;
334  std::istringstream iss(multi_str);
335  if (!(iss >> multi))
336  throw Exception("Property multi port should be set with a stringified int not an: " + multi_str);
337  }
338 
339  if (multi > 1)
340  {
341  addDatastreamPortToInitMultiService(port_name, multi);
342  // Change name of first port
343  port->setName(port_name + "_0");
344  for (int i = 2; i <= multi; i++)
345  {
346  OutputDataStreamPort * new_port = port->clone(this);
347  std::ostringstream number;
348  number << i-1;
349  new_port->setName(port_name + "_" + number.str());
350  _setOfOutputDataStreamPort.push_back(new_port);
351  _multi_port_node = true;
352  }
353  }
354  }
355  }
356 }
void setName(std::string theName)
Definition: DataPort.hxx:56
std::string getName() const
Definition: DataPort.hxx:55
virtual void addDatastreamPortToInitMultiService(const std::string &port_name, int number)
virtual InputDataStreamPort * clone(Node *newHelder) const
std::map< std::string, std::string > _propertyMap
Definition: Node.hxx:98
virtual OutputDataStreamPort * clone(Node *newHelder) const

References _createDatastreamPorts, _multi_port_node, YACS::ENGINE::Node::_propertyMap, _setOfInputDataStreamPort, _setOfOutputDataStreamPort, addDatastreamPortToInitMultiService(), YACS::ENGINE::InputDataStreamPort::clone(), YACS::ENGINE::OutputDataStreamPort::clone(), YACS::ENGINE::DataPort::getName(), yacsorb.CORBAEngineTest::i, and YACS::ENGINE::DataPort::setName().

Referenced by getReadyTasks().

◆ createOutputDataStreamPort()

OutputDataStreamPort * ElementaryNode::createOutputDataStreamPort ( const std::string &  outputPortDSName,
TypeCode type 
)
virtual

Definition at line 706 of file ElementaryNode.cxx.

707 {
708  return getRuntime()->createOutputDataStreamPort(outputPortDSName, this, type);
709 }
virtual OutputDataStreamPort * createOutputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
Definition: Runtime.cxx:274

References YACS::ENGINE::Runtime::createOutputDataStreamPort(), and YACS::ENGINE::getRuntime().

Referenced by edAddOutputDataStreamPort().

◆ createOutputPort()

OutputPort * ElementaryNode::createOutputPort ( const std::string &  outputPortName,
TypeCode type 
)
virtual

Reimplemented in YACS::ENGINE::StudyInNode, and YACS::ENGINE::PresetNode.

Definition at line 662 of file ElementaryNode.cxx.

663 {
664  return getRuntime()->createOutputPort(outputPortName, _implementation, this, type);
665 }
virtual OutputPort * createOutputPort(const std::string &name, const std::string &impl, Node *node, TypeCode *type)=0

References YACS::ENGINE::Node::_implementation, YACS::ENGINE::Runtime::createOutputPort(), and YACS::ENGINE::getRuntime().

Referenced by edAddOutputPort().

◆ disconnectService()

virtual void YACS::ENGINE::ElementaryNode::disconnectService ( )
inlinevirtual

Implements YACS::ENGINE::Task.

Definition at line 126 of file ElementaryNode.hxx.

126 { }

◆ edAddInputDataStreamPort()

InputDataStreamPort * ElementaryNode::edAddInputDataStreamPort ( const std::string &  inputPortDSName,
TypeCode type 
)
virtual

Definition at line 694 of file ElementaryNode.cxx.

695 {
696  InputDataStreamPort *ret = 0;
697  if (edCheckAddPort<InputDataStreamPort, TypeCode*>(inputPortDSName,_setOfInputDataStreamPort,type))
698  {
699  ret = createInputDataStreamPort(inputPortDSName, type);
700  _setOfInputDataStreamPort.push_back(ret);
701  modified();
702  }
703  return ret;
704 }
virtual InputDataStreamPort * createInputDataStreamPort(const std::string &inputPortDSName, TypeCode *type)
virtual void modified()
Sets Node in modified state and its father if it exists.
Definition: Node.cxx:805

References _setOfInputDataStreamPort, createInputDataStreamPort(), and YACS::ENGINE::Node::modified().

Referenced by YACS::ENGINE::SessionCataLoader::importComponent(), and YACS::HMI::CommandAddIDSPortFromCatalog::localExecute().

◆ edAddInputPort()

InputPort * ElementaryNode::edAddInputPort ( const std::string &  inputPortName,
TypeCode type 
)
virtual

the input port is also published recursively in ancestors because it may be visible from everywhere. WARNING: CHECK CASE OF BLOC: ONLY INPUT PORTS NOT INTERNALLY CONNECTED MUST BE VISIBLE.

Definition at line 603 of file ElementaryNode.cxx.

604 {
605 
606  // Cannot create an InputPort defined with InPropertyPort name.
607  if (inputPortName == "__InPropertyPort__Node__YACS_")
608  {
609  string what("ElementaryNode::edAddInputPort: it is forbidden to add an InputPort with the name __InPropertyPort__Node__YACS_\"");
610  throw Exception(what);
611  }
612 
613  InputPort *ret = 0;
614  if (edCheckAddPort<InputPort, TypeCode*>(inputPortName,_setOfInputPort,type))
615  {
616  ret = createInputPort(inputPortName, type);
617  _setOfInputPort.push_back(ret);
618  modified();
619  /*
620  ComposedNode *iter=_father;
621  while(iter)
622  iter=iter->_father;
623  */
624  }
625  return ret;
626 }
virtual InputPort * createInputPort(const std::string &inputPortName, TypeCode *type)

References _setOfInputPort, createInputPort(), and YACS::ENGINE::Node::modified().

Referenced by YACS::ENGINE::SessionCataLoader::importComponent(), YACS::inlinetypeParser< T >::inport(), and YACS::HMI::CommandAddInputPortFromCatalog::localExecute().

◆ edAddOutputDataStreamPort()

OutputDataStreamPort * ElementaryNode::edAddOutputDataStreamPort ( const std::string &  outputPortDSName,
TypeCode type 
)
virtual

Definition at line 711 of file ElementaryNode.cxx.

712 {
713  OutputDataStreamPort *ret = 0;
714  if (edCheckAddPort<OutputDataStreamPort, TypeCode*>(outputPortDSName,_setOfOutputDataStreamPort,type))
715  {
716  ret = createOutputDataStreamPort(outputPortDSName, type);
717  _setOfOutputDataStreamPort.push_back(ret);
718  modified();
719  }
720  return ret;
721 }
virtual OutputDataStreamPort * createOutputDataStreamPort(const std::string &outputPortDSName, TypeCode *type)

References _setOfOutputDataStreamPort, createOutputDataStreamPort(), and YACS::ENGINE::Node::modified().

Referenced by YACS::ENGINE::SessionCataLoader::importComponent(), and YACS::HMI::CommandAddODSPortFromCatalog::localExecute().

◆ edAddOutputPort()

OutputPort * ElementaryNode::edAddOutputPort ( const std::string &  outputPortName,
TypeCode type 
)
virtual

TO SOLVE : The output port is not published in father. Father must create an output port. for now, publication is done the same way as input ports

Definition at line 672 of file ElementaryNode.cxx.

673 {
674  OutputPort *ret =0;
675  if (edCheckAddPort<OutputPort, TypeCode*>(outputPortName,_setOfOutputPort,type))
676  {
677  ret = createOutputPort(outputPortName, type);
678  _setOfOutputPort.push_back(ret);
679  modified();
680  /*
681  ComposedNode *iter=_father;
682  while(iter)
683  iter=iter->_father;
684  */
685  }
686  return ret;
687 }
virtual OutputPort * createOutputPort(const std::string &outputPortName, TypeCode *type)

References _setOfOutputPort, createOutputPort(), and YACS::ENGINE::Node::modified().

Referenced by YACS::ENGINE::SessionCataLoader::importComponent(), YACS::HMI::CommandAddOutputPortFromCatalog::localExecute(), and YACS::inlinetypeParser< T >::outport().

◆ edAddPort()

template<class PORT , class ENUMTYPE >
PORT * YACS::ENGINE::ElementaryNode::edAddPort ( const std::string &  portName,
std::list< PORT * > &  setOfPorts,
ENUMTYPE  type 
)
protected

protected: add a port given it's name and type, in a given list of ports WHY TEMPLATE PARAMETER ENUMTYPE?

Definition at line 179 of file ElementaryNode.hxx.

180  {
181  checkValidityOfPortName(portName);
182  if(isPortNameAlreadyExist<PORT>(portName, setOfPorts))
183  {
184  std::string what="Port of type "; what+=PORT::NAME; what += " with name : "; what+=portName; what+=" already exists";
185  throw Exception(what);
186  }
187  PORT *ret=new PORT(portName,this,type);
188  setOfPorts.push_back(ret);
189  return ret;
190  }
static void checkValidityOfPortName(const std::string &name)
Definition: Node.cxx:446

References YACS::ENGINE::Node::checkValidityOfPortName().

◆ edCheckAddPort()

template<class PORT , class ENUMTYPE >
bool YACS::ENGINE::ElementaryNode::edCheckAddPort ( const std::string &  portName,
std::list< PORT * > &  setOfPorts,
ENUMTYPE  type 
)
protected

Definition at line 193 of file ElementaryNode.hxx.

194  {
195  checkValidityOfPortName(portName);
196  if(isPortNameAlreadyExist<PORT>(portName, setOfPorts))
197  {
198  std::string what="Port of type "; what+=PORT::NAME; what += " with name : "; what+=portName; what+=" already exists";
199  throw Exception(what);
200  }
201  return true;
202  }

References YACS::ENGINE::Node::checkValidityOfPortName().

◆ edDisconnectAllLinksWithMe()

void ElementaryNode::edDisconnectAllLinksWithMe ( )
protectedvirtual

Called typically by ComposedNode to correctly update DF/CF/DS links

Reimplemented from YACS::ENGINE::Node.

Definition at line 249 of file ElementaryNode.cxx.

250 {
251  //CF
253  //Leaving part
254  // - DF
255  for(list<InputPort *>::iterator iter=_setOfInputPort.begin();iter!=_setOfInputPort.end();iter++)
256  (*iter)->edRemoveAllLinksLinkedWithMe();
257  // - DS
258  for(list<InputDataStreamPort *>::iterator iter2=_setOfInputDataStreamPort.begin();iter2!=_setOfInputDataStreamPort.end();iter2++)
259  (*iter2)->edRemoveAllLinksLinkedWithMe();
260  //Arriving part
261  // - DF
262  for(list<OutputPort *>::iterator iter=_setOfOutputPort.begin();iter!=_setOfOutputPort.end();iter++)
263  (*iter)->edRemoveAllLinksLinkedWithMe();
264  // - DS
265  for(list<OutputDataStreamPort *>::iterator iter2=_setOfOutputDataStreamPort.begin();iter2!=_setOfOutputDataStreamPort.end();iter2++)
266  (*iter2)->edRemoveAllLinksLinkedWithMe();
267 }
virtual void edDisconnectAllLinksWithMe()
Definition: Node.cxx:395

References _setOfInputDataStreamPort, _setOfInputPort, _setOfOutputDataStreamPort, _setOfOutputPort, and YACS::ENGINE::Node::edDisconnectAllLinksWithMe().

Referenced by YACS::ENGINE::DFToDSForLoop::~DFToDSForLoop(), and YACS::ENGINE::DSToDFForLoop::~DSToDFForLoop().

◆ edOrderInputPorts()

void ElementaryNode::edOrderInputPorts ( const std::list< InputPort * > &  ports)
virtual

Definition at line 628 of file ElementaryNode.cxx.

629 {
630  std::set<InputPort *> s1;
631  std::set<InputPort *> s2;
632  for(list<InputPort *>::const_iterator it=_setOfInputPort.begin();it != _setOfInputPort.end();it++)
633  s1.insert(*it);
634  for(list<InputPort *>::const_iterator it=ports.begin();it != ports.end();it++)
635  s2.insert(*it);
636 
637  if(s1 != s2)
638  throw Exception("ElementaryNode::edOrderInputPorts : port list must contain same ports as existing ones");
639 
640  _setOfInputPort.clear();
641  for(list<InputPort *>::const_iterator it=ports.begin();it != ports.end();it++)
642  _setOfInputPort.push_back(*it);
643 }

References _setOfInputPort.

Referenced by YACS::HMI::CommandOrderInputPorts::localExecute(), and YACS::HMI::CommandOrderInputPorts::localReverse().

◆ edOrderOutputPorts()

void ElementaryNode::edOrderOutputPorts ( const std::list< OutputPort * > &  ports)
virtual

Definition at line 645 of file ElementaryNode.cxx.

646 {
647  std::set<OutputPort *> s1;
648  std::set<OutputPort *> s2;
649  for(list<OutputPort *>::const_iterator it=_setOfOutputPort.begin();it != _setOfOutputPort.end();it++)
650  s1.insert(*it);
651  for(list<OutputPort *>::const_iterator it=ports.begin();it != ports.end();it++)
652  s2.insert(*it);
653 
654  if(s1 != s2)
655  throw Exception("ElementaryNode::edOrderOutputPorts : port list must contain same ports as existing ones");
656 
657  _setOfOutputPort.clear();
658  for(list<OutputPort *>::const_iterator it=ports.begin();it != ports.end();it++)
659  _setOfOutputPort.push_back(*it);
660 }

References _setOfOutputPort.

Referenced by YACS::HMI::CommandOrderOutputPorts::localExecute(), and YACS::HMI::CommandOrderOutputPorts::localReverse().

◆ edRemovePort()

void ElementaryNode::edRemovePort ( Port port)

remove port from node at edition. Ports are typed.

Definition at line 523 of file ElementaryNode.cxx.

524 {
525  DEBTRACE("ElementaryNode::edRemovePort ");
526  if(port->getNode()!=this)
527  throw Exception("ElementaryNode::edRemovePort : Port is not held by this node");
528  if(InputPort *p=dynamic_cast<InputPort *>(port))
529  edRemovePortTypedFromSet<InputPort>(p,_setOfInputPort);
530  else if(OutputPort *p=dynamic_cast<OutputPort *>(port))
531  edRemovePortTypedFromSet<OutputPort>(p,_setOfOutputPort);
532  else if(InputDataStreamPort *p=dynamic_cast<InputDataStreamPort *>(port))
533  edRemovePortTypedFromSet<InputDataStreamPort>(p,_setOfInputDataStreamPort);
534  else if(OutputDataStreamPort *p=dynamic_cast<OutputDataStreamPort *>(port))
535  edRemovePortTypedFromSet<OutputDataStreamPort>(p,_setOfOutputDataStreamPort);
536  else
537  throw Exception("ElementaryNode::edRemovePort : unknown port type");
538  delete port;
539  modified();
540 }
Node * getNode() const
Definition: Port.hxx:46
Proc * p
Definition: driver.cxx:216

References _setOfInputDataStreamPort, _setOfInputPort, _setOfOutputDataStreamPort, _setOfOutputPort, DEBTRACE, YACS::ENGINE::Port::getNode(), YACS::ENGINE::Node::modified(), and p.

Referenced by YACS::HMI::SubjectDataPort::~SubjectDataPort().

◆ edRemovePortTypedFromSet()

template<class PORT >
void YACS::ENGINE::ElementaryNode::edRemovePortTypedFromSet ( PORT *  port,
std::list< PORT * > &  setOfPorts 
)
staticprotected

protected: remove a port from a given list

Definition at line 209 of file ElementaryNode.hxx.

210  {
211  if(!isPortNameAlreadyExist<PORT>(port->getName(), setOfPorts))
212  throw Exception("Port is not part of the list : unable to remove it");
213  typename std::list<PORT *>::iterator iter=std::find(setOfPorts.begin(),setOfPorts.end(),port);
214  if(iter!=setOfPorts.end())
215  {
216  (*iter)->edRemoveAllLinksLinkedWithMe();
217  setOfPorts.erase(iter);
218  }
219  }

◆ edUpdateState()

void ElementaryNode::edUpdateState ( )
virtual

update the status of the node

Only useful when editing a schema Do nothing in base Node : to implement in derived classes

Reimplemented from YACS::ENGINE::Node.

Definition at line 809 of file ElementaryNode.cxx.

810 {
811  DEBTRACE("ElementaryNode::edUpdateState: " << getName());
813  try
814  {
816  _errorDetails="";
817  }
818  catch(Exception& e)
819  {
821  _errorDetails=e.what();
822  }
823  DEBTRACE("ElementaryNode::edUpdateState: " << _errorDetails);
824  if(state != _state)
825  setState(state);
826  _modified=0;
827 }
virtual void checkBasicConsistency() const
const std::string & getName() const
Definition: Node.hxx:125
std::string _errorDetails
Definition: Node.hxx:93
YACS::StatesForNode _state
Definition: Node.hxx:91
StatesForNode
Definition: define.hxx:34
@ INVALID
Definition: define.hxx:36
@ READY
Definition: define.hxx:37

References YACS::ENGINE::Node::_errorDetails, YACS::ENGINE::Node::_modified, YACS::ENGINE::Node::_state, checkBasicConsistency(), DEBTRACE, YACS::ENGINE::Node::getName(), YACS::INVALID, YACS::READY, YACS::ENGINE::Node::setState(), yacsorb.CORBAEngineTest::state, and YACS::Exception::what().

◆ ensureLoading()

void ElementaryNode::ensureLoading ( )
virtual

Put this node into TOLOAD state when possible.

Can be called by another ElementaryNode that is connected to this one by a datastream link These 2 nodes must be loaded at the same time as they are coupled It's the other node which requests this node loading

Reimplemented from YACS::ENGINE::Node.

Definition at line 835 of file ElementaryNode.cxx.

836 {
837  DEBTRACE("ElementaryNode::ensureLoading: " << getName());
838  if(_state != YACS::READY)
839  return;
841 
842  // request loading for all nodes connected to this one by datastream link
843  // Be careful that nodes can be connected in a loop. Put first this node in TOLOAD state to break the loop
844  std::list<OutputDataStreamPort *>::iterator iterout;
845  for(iterout = _setOfOutputDataStreamPort.begin(); iterout != _setOfOutputDataStreamPort.end(); iterout++)
846  {
847  OutputDataStreamPort *port=(OutputDataStreamPort *)*iterout;
848  std::set<InPort *> ports=port->edSetInPort();
849  std::set<InPort *>::iterator iter;
850  for(iter=ports.begin();iter != ports.end(); iter++)
851  {
852  Node* node= (*iter)->getNode();
853  node->ensureLoading();
854  }
855  }
856  std::list<InputDataStreamPort *>::iterator iterin;
857  for(iterin = _setOfInputDataStreamPort.begin(); iterin != _setOfInputDataStreamPort.end(); iterin++)
858  {
859  InputDataStreamPort *port=(InputDataStreamPort *)*iterin;
860  std::set<OutPort *> ports=port->edSetOutPort();
861  std::set<OutPort *>::iterator iter;
862  for(iter=ports.begin();iter != ports.end(); iter++)
863  {
864  Node* node= (*iter)->getNode();
865  node->ensureLoading();
866  }
867  }
868 }
virtual std::set< OutPort * > edSetOutPort() const
Returns physical backlinks NOT user backlinks.
Definition: InPort.cxx:65
Base class for all nodes.
Definition: Node.hxx:70
virtual void ensureLoading()
Put this node into TOLOAD state when possible.
Definition: Node.cxx:817
std::set< InPort * > edSetInPort() const
@ TOLOAD
Definition: define.hxx:38

References _setOfInputDataStreamPort, _setOfOutputDataStreamPort, YACS::ENGINE::Node::_state, DEBTRACE, YACS::ENGINE::OutputDataStreamPort::edSetInPort(), YACS::ENGINE::InPort::edSetOutPort(), YACS::ENGINE::Node::ensureLoading(), YACS::ENGINE::Node::getName(), YACS::READY, YACS::ENGINE::Node::setState(), and YACS::TOLOAD.

Referenced by exUpdateState().

◆ exUpdateState()

void ElementaryNode::exUpdateState ( )
virtual

Update the node state.

Note
: Update the '_state' attribute. Typically called by 'this->_inGate' when 'this->_inGate' is ready.

Called by InGate::exNotifyFromPrecursor

Reimplemented from YACS::ENGINE::Node.

Definition at line 136 of file ElementaryNode.cxx.

137 {
138  DEBTRACE("ElementaryNode::exUpdateState: " << getName() << " " << _state );
139  if(_state==YACS::DISABLED)return;
140  if(_inGate.exIsReady())
142  {
143  if(_state == YACS::READY)
144  ensureLoading();
145  else if(_state == YACS::LOADED)
147  }
148  else
149  {
150  string what("ElementaryNode::exUpdateState : Invalid graph given : Node with name \"");
151  what+=_name; what+="\" ready to run whereas some inputports are not set correctly\nCheck coherence DF/CF";
153  _errorDetails=what;
154  throw Exception(what);
155  }
156 }
virtual void ensureLoading()
Put this node into TOLOAD state when possible.
std::string _name
Definition: Node.hxx:89
@ INTERNALERR
Definition: define.hxx:49
@ DISABLED
Definition: define.hxx:50

References YACS::ENGINE::Node::_errorDetails, YACS::ENGINE::Node::_inGate, YACS::ENGINE::Node::_name, YACS::ENGINE::Node::_state, areAllInputPortsValid(), DEBTRACE, YACS::DISABLED, ensureLoading(), YACS::ENGINE::InGate::exIsReady(), YACS::ENGINE::Node::getName(), YACS::INTERNALERR, YACS::LOADED, YACS::READY, YACS::ENGINE::Node::setState(), and YACS::TOACTIVATE.

Referenced by getReadyTasks().

◆ finished()

void ElementaryNode::finished ( )
virtual

◆ getAllInPortsComingFromOutsideOfCurrentScope()

std::set< InPort * > ElementaryNode::getAllInPortsComingFromOutsideOfCurrentScope ( ) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 195 of file ElementaryNode.cxx.

196 {
197  set<InPort *> ret;
198  list<InPort *> temp=getSetOfInPort();
199  for(list<InPort *>::iterator iter2=temp.begin();iter2!=temp.end();iter2++)
200  {
201  set<OutPort *> temp2=(*iter2)->edSetOutPort();
202  if(temp2.size()!=0)
203  ret.insert(*iter2);
204  }
205  return ret;
206 }
std::list< InPort * > getSetOfInPort() const
Definition: Node.cxx:289

References YACS::ENGINE::Node::getSetOfInPort().

Referenced by getSetOfLinksComingInCurrentScope().

◆ getAllOutPortsLeavingCurrentScope()

std::set< OutPort * > ElementaryNode::getAllOutPortsLeavingCurrentScope ( ) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 182 of file ElementaryNode.cxx.

183 {
184  set<OutPort *> ret;
185  list<OutPort *> temp=getSetOfOutPort();
186  for(list<OutPort *>::iterator iter2=temp.begin();iter2!=temp.end();iter2++)
187  {
188  set<InPort *> temp2=(*iter2)->edSetInPort();
189  if(temp2.size()!=0)
190  ret.insert(*iter2);
191  }
192  return ret;
193 }
std::list< OutPort * > getSetOfOutPort() const
Definition: Node.cxx:299

References YACS::ENGINE::Node::getSetOfOutPort().

Referenced by getSetOfLinksLeavingCurrentScope().

◆ getChildByName()

Node * ElementaryNode::getChildByName ( const std::string &  name) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 571 of file ElementaryNode.cxx.

572 {
573  string what("ElementaryNode does not agregate any nodes particullary node with name "); what+=name;
574  throw Exception(what);
575 }

◆ getComponent() [1/2]

ComponentInstance * ElementaryNode::getComponent ( )
virtual

Implements YACS::ENGINE::Task.

Reimplemented in YACS::ENGINE::ServiceNode.

Definition at line 116 of file ElementaryNode.cxx.

117 {
118  return 0;
119 }

◆ getComponent() [2/2]

const ComponentInstance * ElementaryNode::getComponent ( ) const
virtual

Implements YACS::ENGINE::Task.

Reimplemented in YACS::ENGINE::ServiceNode.

Definition at line 121 of file ElementaryNode.cxx.

122 {
123  return 0;
124 }

◆ getContainer()

Container * ElementaryNode::getContainer ( )
virtual

Implements YACS::ENGINE::Task.

Reimplemented in YACS::ENGINE::ServiceNode, and YACS::ENGINE::InlineNode.

Definition at line 126 of file ElementaryNode.cxx.

127 {
128  return 0;
129 }

Referenced by getReadyTasks().

◆ getCoupledNodes()

void ElementaryNode::getCoupledNodes ( std::set< Task * > &  coupledSet)
virtual

Put all nodes that are coupled to this node in coupledSet.

Reimplemented from YACS::ENGINE::Node.

Definition at line 877 of file ElementaryNode.cxx.

878 {
879  if(coupledSet.find(this) != coupledSet.end())return;
880 
881  coupledSet.insert(this);
882 
883  std::list<OutputDataStreamPort *>::iterator iterout;
884  for(iterout = _setOfOutputDataStreamPort.begin(); iterout != _setOfOutputDataStreamPort.end(); iterout++)
885  {
886  OutputDataStreamPort *port=(OutputDataStreamPort *)*iterout;
887  std::set<InPort *> ports=port->edSetInPort();
888  std::set<InPort *>::iterator iter;
889  for(iter=ports.begin();iter != ports.end(); iter++)
890  {
891  Node* node= (*iter)->getNode();
892  node->getCoupledNodes(coupledSet);
893  }
894  }
895 }
virtual void getCoupledNodes(std::set< Task * > &coupledNodes)
Definition: Node.hxx:199

References _setOfOutputDataStreamPort, YACS::ENGINE::OutputDataStreamPort::edSetInPort(), and YACS::ENGINE::Node::getCoupledNodes().

Referenced by getCoupledTasks().

◆ getCoupledTasks()

void ElementaryNode::getCoupledTasks ( std::set< Task * > &  coupledSet)
virtual

Calls getCoupledNodes for Task interface.

Implements YACS::ENGINE::Task.

Definition at line 871 of file ElementaryNode.cxx.

872 {
873  getCoupledNodes(coupledSet);
874 }
virtual void getCoupledNodes(std::set< Task * > &coupledSet)
Put all nodes that are coupled to this node in coupledSet.

References getCoupledNodes().

◆ getDynClonerIfExists()

ComposedNode * ElementaryNode::getDynClonerIfExists ( const ComposedNode levelToStop) const

Definition at line 585 of file ElementaryNode.cxx.

586 {
587  for(ComposedNode *iter=_father;iter!=levelToStop && iter!=0; iter=iter->_father)
588  if(!iter->isPlacementPredictableB4Run())
589  return iter;
590  return 0;
591 }
Base class for all composed nodes.
ComposedNode * _father
Definition: Node.hxx:90

References YACS::ENGINE::Node::_father.

◆ getErrorDetails()

std::string ElementaryNode::getErrorDetails ( )
virtual

Give a description of error when node status is ERROR.

Definition at line 804 of file ElementaryNode.cxx.

805 {
806  return _errorDetails;
807 }

References YACS::ENGINE::Node::_errorDetails.

Referenced by YACS::ENGINE::DistributedPythonNode::dealException(), and YACS::ENGINE::SalomeNode::execute().

◆ getInPortName()

string ElementaryNode::getInPortName ( const InPort inPort) const
virtual

get the input port name used by the current node (see composed nodes)

Implements YACS::ENGINE::Node.

Definition at line 727 of file ElementaryNode.cxx.

728 {
729  Node *node = inPort->getNode();
730  if ( node != this )
731  {
732  string what("InputPort "); what += inPort->getName(); what += " does not belong to node "; what += node->getName();
733  throw Exception(what);
734  }
735  return inPort->getName();
736 }

References YACS::ENGINE::DataPort::getName(), YACS::ENGINE::Node::getName(), and YACS::ENGINE::Port::getNode().

◆ getInputDataStreamPort()

InputDataStreamPort * ElementaryNode::getInputDataStreamPort ( const std::string &  name) const
virtual

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::DSToDFForLoop.

Definition at line 239 of file ElementaryNode.cxx.

240 {
241  return getPort<InputDataStreamPort>(name,_setOfInputDataStreamPort);
242 }

References _setOfInputDataStreamPort.

Referenced by getReadyTasks(), and YACS::HMI::CommandAddIDSPortFromCatalog::localReverse().

◆ getInputPort()

InputPort * ElementaryNode::getInputPort ( const std::string &  name) const
virtual

Reimplemented from YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::DFToDSForLoop, and YACS::ENGINE::SplitterNode.

Definition at line 168 of file ElementaryNode.cxx.

169 {
170  try {
171  return Node::getInputPort(name);
172  }
173  catch(Exception& e) {}
174  return getPort<InputPort>(name,_setOfInputPort);
175 }
virtual InputPort * getInputPort(const std::string &name) const
Definition: Node.cxx:260

References _setOfInputPort, and YACS::ENGINE::Node::getInputPort().

Referenced by YACS::ENGINE::SplitterNode::getInputPort(), getReadyTasks(), YACS::HMI::CommandOrderInputPorts::localExecute(), YACS::HMI::CommandAddInputPortFromCatalog::localReverse(), YACS::HMI::CommandOrderInputPorts::localReverse(), and YACS::ENGINE::portParser::onEnd().

◆ getLocalInputPorts()

std::list<InputPort *> YACS::ENGINE::ElementaryNode::getLocalInputPorts ( ) const
inlinevirtual

Implements YACS::ENGINE::Node.

Definition at line 85 of file ElementaryNode.hxx.

85 { return _setOfInputPort; }

Referenced by YACS::HMI::SubjectElementaryNode::loadChildren().

◆ getLocalOutputPorts()

std::list<OutputPort *> YACS::ENGINE::ElementaryNode::getLocalOutputPorts ( ) const
inlinevirtual

Implements YACS::ENGINE::Node.

Definition at line 86 of file ElementaryNode.hxx.

86 { return _setOfOutputPort; }

Referenced by YACS::HMI::SubjectElementaryNode::loadChildren().

◆ getMaxLevelOfParallelism()

int YACS::ENGINE::ElementaryNode::getMaxLevelOfParallelism ( ) const
inlinevirtual

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::InlineNode.

Definition at line 110 of file ElementaryNode.hxx.

110 { return 1; }

◆ getNumberOfInputPorts()

int ElementaryNode::getNumberOfInputPorts ( ) const
virtual

◆ getNumberOfOutputPorts()

◆ getOutPortName()

string ElementaryNode::getOutPortName ( const OutPort outPort) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 738 of file ElementaryNode.cxx.

739 {
740  Node *node = outPort->getNode();
741  if ( node != this )
742  {
743  string what("OutputPort "); what += outPort->getName(); what += " does not belong to node "; what += node->getName();
744  throw Exception(what);
745  }
746  return outPort->getName();
747 }

References YACS::ENGINE::DataPort::getName(), YACS::ENGINE::Node::getName(), and YACS::ENGINE::Port::getNode().

◆ getOutputDataStreamPort()

OutputDataStreamPort * ElementaryNode::getOutputDataStreamPort ( const std::string &  name) const
virtual

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::DFToDSForLoop.

Definition at line 244 of file ElementaryNode.cxx.

245 {
246  return getPort<OutputDataStreamPort>(name,_setOfOutputDataStreamPort);
247 }

References _setOfOutputDataStreamPort.

Referenced by getReadyTasks(), and YACS::HMI::CommandAddODSPortFromCatalog::localReverse().

◆ getOutputPort()

OutputPort * ElementaryNode::getOutputPort ( const std::string &  name) const
virtual

◆ getPort()

template<class PORT >
PORT * YACS::ENGINE::ElementaryNode::getPort ( const std::string &  name,
const std::list< PORT * > &  setOfPorts 
) const
protected

protected: get a port in a list given it's name

Definition at line 160 of file ElementaryNode.hxx.

161  {
162  for(typename std::list<PORT *>::const_iterator iter=setOfPorts.begin();iter!=setOfPorts.end();iter++)
163  {
164  if((*iter)->getName()==name)
165  return *iter;
166  }
167  std::string what="ElementaryNode::getPort : unexisting "; what+=PORT::NAME;
168  what+=" with name ";
169  what+=name;
170  throw Exception(what);
171  }

◆ getProgressWeight()

list< ProgressWeight > ElementaryNode::getProgressWeight ( ) const
virtual

Get the progress weight for all elementary nodes.

Only elementary nodes have weight. At this stage weight is 0 or 1 (it can be modified later following the kind of father)

Implements YACS::ENGINE::Node.

Definition at line 558 of file ElementaryNode.cxx.

559 {
560  list<ProgressWeight> ret;
561  ProgressWeight myWeight;
562  myWeight.weightTotal=1;
563  if (getState() == YACS::DONE)
564  myWeight.weightDone=1;
565  else
566  myWeight.weightDone=0;
567  ret.push_back(myWeight);
568  return ret;
569 }
YACS::StatesForNode getState() const

References YACS::DONE, getState(), YACS::ENGINE::ProgressWeight::weightDone, and YACS::ENGINE::ProgressWeight::weightTotal.

◆ getReadyTasks()

void ElementaryNode::getReadyTasks ( std::vector< Task * > &  tasks)
virtual

add this node task to a given set of ready tasks, if this task is ready to activate

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::DSToDFForLoop, and YACS::ENGINE::DFToDSForLoop.

Definition at line 362 of file ElementaryNode.cxx.

363 {
364  DEBTRACE("ElementaryNode::getReadyTasks: " << getName() << " " << _state);
365 
366  int multi = 1;
367  std::map<std::string,std::string>::iterator it=_propertyMap.find("multi");
368  if(it != _propertyMap.end())
369  {
370  std::string multi_str = it->second;
371  std::istringstream iss(multi_str);
372  if (!(iss >> multi))
373  throw Exception("Property multi should be set with a stringified int not an: " + multi_str);
374  }
375 
377  {
378  if (multi == 1)
379  {
380  std::map<std::string,std::string>::iterator it=_propertyMap.find("multi_working_dir");
381  if(it != _propertyMap.end())
382  {
383  std::string working_dir_base = it->second;
384  std::ostringstream working_dir_stream;
385  working_dir_stream << working_dir_base;
386  working_dir_stream << 1;
387  this->getContainer()->setProperty("workingdir", working_dir_stream.str());
388  }
389  tasks.push_back(this);
390  }
391  else
392  {
393 
394  // Check output port -> cannot clone an Elementary Node with Output Ports connected
395  std::list<OutputPort *>::iterator it_output = _setOfOutputPort.begin();
396  for (;it_output != _setOfOutputPort.end(); it_output++)
397  {
398  if ((*it_output)->isConnected())
399  {
400  throw Exception("Property multi cannot be set on nodes with dataflow output ports connected");
401  }
402  }
403 
404  // Add my instance
405  std::map<std::string,std::string>::iterator it=_propertyMap.find("multi_working_dir");
406  if(it != _propertyMap.end())
407  {
408  std::string working_dir_base = it->second;
409  std::ostringstream working_dir_stream;
410  working_dir_stream << working_dir_base;
411  working_dir_stream << 1;
412  this->getContainer()->setProperty("workingdir", working_dir_stream.str());
413  }
414  tasks.push_back(this);
415 
416  // Step 1: Create clones
417  for (int i = 1; i < multi; i++)
418  {
419  // Clone
420  YACS::ENGINE::ElementaryNode * new_node = static_cast<YACS::ENGINE::ElementaryNode *>(clone(_father, false));
421  new_node->createMultiDatastreamPorts();
422 
423  // Change name
424  std::string iname;
425  std::stringstream inamess;
426  inamess << getName() << "_" << i;
427  iname=inamess.str();
428  DEBTRACE("Create clone "<< iname << " of node " << getName());
429  new_node->setName(iname);
430 
431  // For each input port connect it with the original output port
432  std::list<InputPort *> clone_list_inputPorts = new_node->getSetOfInputPort();
433  for(list<InputPort *>::const_iterator iter1=clone_list_inputPorts.begin(); iter1!=clone_list_inputPorts.end(); iter1++)
434  {
435  std::string input_port_name = (*iter1)->getName();
436  // Get Port Name in master node
437  InputPort * master_port = getInputPort(input_port_name);
438  for (auto itt : master_port->_backLinks)
439  {
440  // Connect dataflow
441  getProc()->edAddDFLink(itt.first,(*iter1));
442  }
443  }
444 
445  // InputDataStreamPort connections
446  std::list<InputDataStreamPort *> clone_list_inputDatastreamPorts = new_node->getSetOfInputDataStreamPort();
447  for(list<InputDataStreamPort *>::iterator iter = clone_list_inputDatastreamPorts.begin(); iter != clone_list_inputDatastreamPorts.end(); iter++)
448  {
449  std::string port_name = (*iter)->getName();
450  InputDataStreamPort * orig_port = getInputDataStreamPort(port_name);
451 
452  std::set<OutputDataStreamPort *> connected_ports = orig_port->getConnectedOutputDataStreamPort();
453 
454  // Create datastream ports if not created
455  std::set<OutputDataStreamPort *>::const_iterator iter3;
456  for(iter3=connected_ports.begin();iter3!=connected_ports.end();iter3++)
457  {
458  ElementaryNode * node = (ElementaryNode *) (*iter3)->getNode();
460 
461  std::string good_port_name;
462  std::stringstream temp_name;
463  std::string out_name = (*iter3)->getName();
464  out_name.erase(out_name.end()-1);
465  temp_name << out_name << i;
466  good_port_name = temp_name.str();
467  getProc()->edAddLink(node->getOutputDataStreamPort(good_port_name), (*iter));
468  }
469  }
470 
471  // OutputDataStreamPort connections
472  std::list<OutputDataStreamPort *> clone_list_outputDatastreamPorts = new_node->getSetOfOutputDataStreamPort();
473  for(list<OutputDataStreamPort *>::iterator iter = clone_list_outputDatastreamPorts.begin(); iter != clone_list_outputDatastreamPorts.end(); iter++)
474  {
475  std::string port_name = (*iter)->getName();
476  OutputDataStreamPort * orig_port = getOutputDataStreamPort(port_name);
477  std::set<InputDataStreamPort *> dest_input_port = orig_port->_setOfInputDataStreamPort;
478  for(set<InputDataStreamPort *>::iterator dest_port = dest_input_port.begin(); dest_port != dest_input_port.end(); dest_port++)
479  {
480  ElementaryNode * dest_node = (ElementaryNode *)(*dest_port)->getNode();
481  // Add InputPort to dest node
482  dest_node->createMultiDatastreamPorts();
483 
484  std::string good_port_name;
485  std::stringstream temp_name;
486  std::string in_name = (*dest_port)->getName();
487  in_name.erase(in_name.end()-1);
488  temp_name << in_name << i;
489  good_port_name = temp_name.str();
490  getProc()->edAddLink((*iter), dest_node->getInputDataStreamPort(good_port_name));
491  }
492  }
493 
494  // Init node
495  new_node->init(false);
496  new_node->exUpdateState();
497 
498  // Set Control Link to done
499  std::list<OutGate *> clone_cl_back = new_node->getInGate()->getBackLinks();
500  for(std::list<OutGate *>::const_iterator iter=clone_cl_back.begin(); iter!=clone_cl_back.end(); iter++)
501  new_node->getInGate()->exNotifyFromPrecursor((*iter));
502 
503  // Add clone
504  std::map<std::string,std::string>::iterator it=_propertyMap.find("multi_working_dir");
505  if(it != _propertyMap.end())
506  {
507  std::string working_dir_base = it->second;
508  std::ostringstream working_dir_stream;
509  working_dir_stream << working_dir_base;
510  working_dir_stream << i+1;
511  new_node->getContainer()->setProperty("workingdir", working_dir_stream.str());
512  }
513  tasks.push_back(new_node);
514  }
515  }
516  }
517 }
virtual bool edAddDFLink(OutPort *start, InPort *end)
Connect an OutPort to an InPort and add the necessary control link.
bool edAddLink(OutPort *start, InPort *end)
Add a dataflow link between two data ports.
virtual void setProperty(const std::string &name, const std::string &value)=0
Base class for all calculation nodes.
InputPort * getInputPort(const std::string &name) const
OutputDataStreamPort * getOutputDataStreamPort(const std::string &name) const
std::list< InputPort * > getSetOfInputPort() const
std::list< InputDataStreamPort * > getSetOfInputDataStreamPort() const
void init(bool start=true)
InputDataStreamPort * getInputDataStreamPort(const std::string &name) const
virtual void createMultiDatastreamPorts()
std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort() const
void exUpdateState()
Update the node state.
std::list< OutGate * > getBackLinks()
Definition: InGate.cxx:134
void exNotifyFromPrecursor(OutGate *fromgate)
Notify this port that an upstream node connected by a control flow link is finished.
Definition: InGate.cxx:68
std::set< std::pair< OutPort *, bool > > _backLinks
Definition: InPort.hxx:78
std::set< OutputDataStreamPort * > getConnectedOutputDataStreamPort()
void setName(const std::string &name)
Change the name of the node.
Definition: Node.cxx:162
Node * clone(ComposedNode *father, bool editionOnly=true) const
This method MUST NEVER BE VIRTUAL
Definition: Node.cxx:131
InGate * getInGate()
Definition: Node.hxx:123
virtual Proc * getProc()
Definition: Node.cxx:401
std::set< InputDataStreamPort * > _setOfInputDataStreamPort
@ TORECONNECT
Definition: define.hxx:48

References YACS::ENGINE::InPort::_backLinks, YACS::ENGINE::Node::_father, YACS::ENGINE::Node::_propertyMap, YACS::ENGINE::OutputDataStreamPort::_setOfInputDataStreamPort, _setOfOutputPort, YACS::ENGINE::Node::_state, YACS::ENGINE::Node::clone(), createMultiDatastreamPorts(), DEBTRACE, YACS::ENGINE::ComposedNode::edAddDFLink(), YACS::ENGINE::ComposedNode::edAddLink(), YACS::ENGINE::InGate::exNotifyFromPrecursor(), exUpdateState(), YACS::ENGINE::InGate::getBackLinks(), YACS::ENGINE::InputDataStreamPort::getConnectedOutputDataStreamPort(), getContainer(), YACS::ENGINE::Node::getInGate(), getInputDataStreamPort(), getInputPort(), YACS::ENGINE::Node::getName(), getOutputDataStreamPort(), YACS::ENGINE::Node::getProc(), getSetOfInputDataStreamPort(), getSetOfInputPort(), getSetOfOutputDataStreamPort(), yacsorb.CORBAEngineTest::i, init(), YACS::ENGINE::Node::setName(), YACS::ENGINE::Container::setProperty(), YACS::TOACTIVATE, YACS::TOLOAD, and YACS::TORECONNECT.

Referenced by YACS::ENGINE::ForEachLoopGen::getReadyTasks(), YACS::ENGINE::Loop::getReadyTasks(), YACS::ENGINE::OptimizerLoop::getReadyTasks(), and YACS::ENGINE::Switch::getReadyTasks().

◆ getRecursiveConstituents()

list< ElementaryNode * > ElementaryNode::getRecursiveConstituents ( ) const
virtual
Returns
a set with only this node. (Same method in composed nodes)

Implements YACS::ENGINE::Node.

Definition at line 546 of file ElementaryNode.cxx.

547 {
548  list<ElementaryNode *> ret;
549  ret.push_back((ElementaryNode *)this);
550  return ret;
551 }

◆ getSetOfInputDataStreamPort()

std::list<InputDataStreamPort *> YACS::ENGINE::ElementaryNode::getSetOfInputDataStreamPort ( ) const
inlinevirtual

◆ getSetOfInputPort()

◆ getSetOfLinksComingInCurrentScope()

std::vector< std::pair< InPort *, OutPort * > > ElementaryNode::getSetOfLinksComingInCurrentScope ( ) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 221 of file ElementaryNode.cxx.

222 {
223  vector< pair<InPort *, OutPort *> > ret;
224  set<InPort *> ports=getAllInPortsComingFromOutsideOfCurrentScope();
225  for(set<InPort *>::iterator iter2=ports.begin();iter2!=ports.end();iter2++)
226  {
227  set<OutPort *> temp2=(*iter2)->edSetOutPort();
228  for(set<OutPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
229  {
230  std::set<OutPort *> trueOutPorts;
231  (*iter3)->getAllRepresented(trueOutPorts);
232  for(std::set<OutPort *>::iterator iter4=trueOutPorts.begin();iter4!=trueOutPorts.end();++iter4)
233  ret.push_back(pair<InPort *, OutPort *>(*iter2,*iter4));
234  }
235  }
236  return ret;
237 }
std::set< InPort * > getAllInPortsComingFromOutsideOfCurrentScope() const

References getAllInPortsComingFromOutsideOfCurrentScope().

◆ getSetOfLinksLeavingCurrentScope()

std::vector< std::pair< OutPort *, InPort * > > ElementaryNode::getSetOfLinksLeavingCurrentScope ( ) const
virtual

Implements YACS::ENGINE::Node.

Definition at line 208 of file ElementaryNode.cxx.

209 {
210  vector< pair<OutPort *, InPort *> > ret;
211  std::set<OutPort *> ports=getAllOutPortsLeavingCurrentScope();
212  for(set<OutPort *>::iterator iter2=ports.begin();iter2!=ports.end();iter2++)
213  {
214  set<InPort *> temp2=(*iter2)->edSetInPort();
215  for(set<InPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
216  ret.push_back(pair<OutPort *, InPort *>(*iter2,*iter3));
217  }
218  return ret;
219 }
std::set< OutPort * > getAllOutPortsLeavingCurrentScope() const

References getAllOutPortsLeavingCurrentScope().

◆ getSetOfOutputDataStreamPort()

std::list<OutputDataStreamPort *> YACS::ENGINE::ElementaryNode::getSetOfOutputDataStreamPort ( ) const
inlinevirtual

◆ getSetOfOutputPort()

◆ getState()

◆ getWeight()

ComplexWeight* YACS::ENGINE::ElementaryNode::getWeight ( )
inline

◆ getWeightRegardingDPL()

void YACS::ENGINE::ElementaryNode::getWeightRegardingDPL ( ComplexWeight weight)
inlinevirtual

Implements YACS::ENGINE::Node.

Definition at line 113 of file ElementaryNode.hxx.

113 { weight->addWeight(getWeight()); }

References YACS::ENGINE::ComplexWeight::addWeight().

◆ init()

void ElementaryNode::init ( bool  start = true)
virtual

initialisation of all input and output ports and gates, for execution

Reimplemented from YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::PyFuncNode, and YACS::ENGINE::SplitterNode.

Definition at line 99 of file ElementaryNode.cxx.

100 {
101  DEBTRACE("ElementaryNode::init " << getName() << " " << start << " " << _state);
103  if(_state == YACS::DISABLED)
104  {
105  exDisabledState(); // to refresh propagation of DISABLED state
106  return ;
107  }
109 }
void initCommonPartWithoutStateManagement(bool start)
virtual void exDisabledState()
Notify this node that it has been disabled.
Definition: Node.cxx:232

References YACS::ENGINE::Node::_state, DEBTRACE, YACS::DISABLED, YACS::ENGINE::Node::exDisabledState(), YACS::ENGINE::Node::getName(), initCommonPartWithoutStateManagement(), YACS::READY, and YACS::ENGINE::Node::setState().

Referenced by getReadyTasks(), and YACS::ENGINE::SplitterNode::init().

◆ initCommonPartWithoutStateManagement()

void ElementaryNode::initCommonPartWithoutStateManagement ( bool  start)
protected

Definition at line 90 of file ElementaryNode.cxx.

91 {
92  for(list<OutputPort *>::iterator iter=_setOfOutputPort.begin();iter!=_setOfOutputPort.end();iter++)
93  (*iter)->exInit();
94  for(list<InputPort *>::iterator iter2=_setOfInputPort.begin();iter2!=_setOfInputPort.end();iter2++)
95  (*iter2)->exInit(start);
96  _inGate.exReset();
97 }

References YACS::ENGINE::Node::_inGate, _setOfInputPort, _setOfOutputPort, and YACS::ENGINE::InGate::exReset().

Referenced by init(), and YACS::ENGINE::PyFuncNode::init().

◆ initService()

virtual void YACS::ENGINE::ElementaryNode::initService ( )
inlinevirtual

Implements YACS::ENGINE::Task.

Definition at line 124 of file ElementaryNode.hxx.

124 { }

◆ isDeployable()

bool ElementaryNode::isDeployable ( ) const
virtual

Implements YACS::ENGINE::Task.

Reimplemented in YACS::ENGINE::ServiceNode, YACS::ENGINE::ServerNode, and YACS::ENGINE::InlineNode.

Definition at line 111 of file ElementaryNode.cxx.

112 {
113  return false;
114 }

◆ isPortNameAlreadyExist()

template<class PORT >
bool YACS::ENGINE::ElementaryNode::isPortNameAlreadyExist ( const std::string &  portName,
const std::list< PORT * > &  setOfPorts 
)
staticprotected

protected: checks existence of a port, given it's name, in a list

Definition at line 226 of file ElementaryNode.hxx.

227  {
228  for(typename std::list<PORT *>::const_iterator iter=setOfPorts.begin();iter!=setOfPorts.end();iter++)
229  {
230  if((*iter)->getName()==portName)
231  return true;
232  }
233  return false;
234  }

◆ isReady()

bool ElementaryNode::isReady ( )
virtual

Implements YACS::ENGINE::Task.

Definition at line 754 of file ElementaryNode.cxx.

755 {
756  return _state==TOACTIVATE;
757 }

References YACS::ENGINE::Node::_state, and YACS::TOACTIVATE.

◆ load()

◆ loaded()

void ElementaryNode::loaded ( )
virtual

Notify this node that it is loaded.

When an elementary node has been loaded It is ready to be connected

Implements YACS::ENGINE::Task.

Definition at line 774 of file ElementaryNode.cxx.

775 {
776 }

◆ partitionRegardingDPL()

void YACS::ENGINE::ElementaryNode::partitionRegardingDPL ( const PartDefinition pd,
std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &  zeMap 
)
inlinevirtual

Implements YACS::ENGINE::Node.

Definition at line 114 of file ElementaryNode.hxx.

114 { }

◆ performDuplicationOfPlacement()

void ElementaryNode::performDuplicationOfPlacement ( const Node other)
protectedvirtual

performs a duplication of placement using clone method of containers and components. clone behaviour is driven by attachOnCloning attribute.

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::ServiceNode, and YACS::ENGINE::InlineNode.

Definition at line 70 of file ElementaryNode.cxx.

71 {
72 }

◆ performShallowDuplicationOfPlacement()

void ElementaryNode::performShallowDuplicationOfPlacement ( const Node other)
protectedvirtual

performs a also duplication of placement but here containers and components are not copied at all whatever the value of attachedOnCloning.

Implements YACS::ENGINE::Node.

Reimplemented in YACS::ENGINE::ServiceNode, and YACS::ENGINE::InlineNode.

Definition at line 74 of file ElementaryNode.cxx.

75 {
76 }

◆ setWeight()

void ElementaryNode::setWeight ( double  elementaryWeight)

Definition at line 897 of file ElementaryNode.cxx.

898 {
899  if(elementaryWeight<=0.)
900  throw Exception("ElementaryNode::setWeight : invalid input value !");
901  _weight.setElementaryWeight(elementaryWeight);
902 }
void setElementaryWeight(double elementaryWeight)

References _weight, and YACS::ENGINE::ComplexWeight::setElementaryWeight().

Referenced by YACS::inlinetypeParser< T >::function(), YACS::remotetypeParser< T >::function(), and YACS::remotetypeParser< T >::script().

◆ typeName()

Friends And Related Function Documentation

◆ ComposedNode

friend class ComposedNode
friend

Definition at line 45 of file ElementaryNode.hxx.

Member Data Documentation

◆ _createDatastreamPorts

bool YACS::ENGINE::ElementaryNode::_createDatastreamPorts
protected

Definition at line 54 of file ElementaryNode.hxx.

Referenced by createMultiDatastreamPorts(), and ElementaryNode().

◆ _multi_port_node

bool YACS::ENGINE::ElementaryNode::_multi_port_node
protected

Definition at line 55 of file ElementaryNode.hxx.

Referenced by createMultiDatastreamPorts(), and ElementaryNode().

◆ _setOfInputDataStreamPort

◆ _setOfInputPort

◆ _setOfOutputDataStreamPort

◆ _setOfOutputPort

◆ _weight

ComplexWeight YACS::ENGINE::ElementaryNode::_weight
protected

Definition at line 51 of file ElementaryNode.hxx.

Referenced by ElementaryNode(), and setWeight().


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