Version: 9.16.0
YACS::ENGINE::Node Class Referenceabstract

Base class for all nodes. More...

#include <Node.hxx>

Inheritance diagram for YACS::ENGINE::Node:
Collaboration diagram for YACS::ENGINE::Node:

Public Member Functions

virtual ~Node ()
 
virtual void init (bool start=true)
 
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 getState () const
 
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 exUpdateState ()
 Update the node state. More...
 
virtual void exFailedState ()
 Notify this node that its execution has failed. More...
 
virtual void exDisabledState ()
 Notify this node that it has been disabled. More...
 
virtual void getReadyTasks (std::vector< Task * > &tasks)=0
 
virtual std::list< ElementaryNode * > getRecursiveConstituents () const =0
 
virtual std::list< ProgressWeightgetProgressWeight () const =0
 
virtual int getNumberOfInputPorts () const =0
 
virtual int getNumberOfOutputPorts () const =0
 
std::list< InPort * > getSetOfInPort () const
 
std::list< OutPort * > getSetOfOutPort () const
 
virtual std::list< InputPort * > getSetOfInputPort () const =0
 
virtual std::list< OutputPort * > getSetOfOutputPort () const =0
 
virtual std::list< InputPort * > getLocalInputPorts () const =0
 
virtual std::list< OutputPort * > getLocalOutputPorts () const =0
 
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...
 
virtual std::string getInPortName (const InPort *) const =0
 
virtual std::string getOutPortName (const OutPort *) const =0
 
virtual std::list< InputDataStreamPort * > getSetOfInputDataStreamPort () const =0
 
virtual std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort () const =0
 
InPortgetInPort (const std::string &name) const
 
InPropertyPortgetInPropertyPort () const
 
virtual OutPortgetOutPort (const std::string &name) const
 
virtual std::set< OutPort * > getAllOutPortsLeavingCurrentScope () const =0
 
virtual std::set< InPort * > getAllInPortsComingFromOutsideOfCurrentScope () const =0
 
virtual std::vector< std::pair< OutPort *, InPort * > > getSetOfLinksLeavingCurrentScope () const =0
 
virtual std::vector< std::pair< InPort *, OutPort * > > getSetOfLinksComingInCurrentScope () const =0
 
virtual InputPortgetInputPort (const std::string &name) const
 
virtual OutputPortgetOutputPort (const std::string &name) const =0
 
virtual InputDataStreamPortgetInputDataStreamPort (const std::string &name) const =0
 
virtual OutputDataStreamPortgetOutputDataStreamPort (const std::string &name) const =0
 
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 NodegetChildByName (const std::string &name) const =0
 
virtual ProcgetProc ()
 
virtual const ProcgetProc () const
 
virtual void accept (Visitor *visitor)=0
 
virtual int getMaxLevelOfParallelism () const =0
 
virtual void getWeightRegardingDPL (ComplexWeight *weight)=0
 
virtual void partitionRegardingDPL (const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap)=0
 
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 typeName ()
 
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 void edUpdateState ()
 update the status of the node 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 ensureLoading ()
 Put this node into TOLOAD state when possible. More...
 
virtual void getCoupledNodes (std::set< Task * > &coupledNodes)
 
virtual void cleanNodes ()
 Clean the node in case of not clean exit. More...
 

Static Public Member Functions

static std::string getStateName (YACS::StatesForNode state)
 Return the name of a state. More...
 
static void checkValidityOfNodeName (const std::string &name)
 

Public Attributes

YACS::Colour _colour
 

Static Public Attributes

static std::map< int, Node * > idMap
 

Protected Member Functions

 Node (const std::string &name)
 
 Node (const Node &other, ComposedNode *father)
 
virtual void performDuplicationOfPlacement (const Node &other)=0
 performs a duplication of placement using clone method of containers and components. clone behaviour is driven by attachOnCloning attribute. More...
 
virtual void performShallowDuplicationOfPlacement (const Node &other)=0
 performs a also duplication of placement but here containers and components are not copied at all whatever the value of attachedOnCloning. More...
 
virtual NodesimpleClone (ComposedNode *father, bool editionOnly=true) const =0
 
virtual void exForwardFailed ()
 
virtual void exForwardFinished ()
 
virtual void edDisconnectAllLinksWithMe ()
 

Static Protected Member Functions

static void checkValidityOfPortName (const std::string &name)
 
static ComposedNodecheckHavingCommonFather (Node *node1, Node *node2)
 

Protected Attributes

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
 

Static Protected Attributes

static const char SEP_CHAR_IN_PORT [] ="."
 
static int _total = 0
 

Friends

class Bloc
 
class Loop
 
class Switch
 
class InputPort
 
class OutputPort
 
class InPropertyPort
 
class DynParaLoop
 
class ForEachLoop
 
class ComposedNode
 
class ElementaryNode
 
class Visitor
 
void StateLoader (Node *node, YACS::StatesForNode state)
 

Detailed Description

Base class for all nodes.

Definition at line 69 of file Node.hxx.

Constructor & Destructor Documentation

◆ Node() [1/2]

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

Definition at line 69 of file Node.cxx.

69 :_name(name),_inGate(this),_outGate(this),_father(0),_state(YACS::READY),
71{
72 // Should be protected by lock ??
74 _numId = _total++;
75 idMap[_numId]=this;
76
77 // Every node has an InPropertyPort
78 _inPropertyPort = new InPropertyPort("__InPropertyPort__Node__YACS_", this, Runtime::_tc_propvec);
79}
static std::map< int, Node * > idMap
Definition: Node.hxx:188
OutGate _outGate
Definition: Node.hxx:87
std::string _name
Definition: Node.hxx:89
ComposedNode * _father
Definition: Node.hxx:90
static int _total
Definition: Node.hxx:95
InGate _inGate
Definition: Node.hxx:86
InPropertyPort * _inPropertyPort
Definition: Node.hxx:88
friend class InPropertyPort
Definition: Node.hxx:76
static void checkValidityOfNodeName(const std::string &name)
Definition: Node.cxx:455
std::string _implementation
Definition: Node.hxx:97
YACS::StatesForNode _state
Definition: Node.hxx:91
static const char RUNTIME_ENGINE_INTERACTION_IMPL_NAME[]
Definition: Runtime.hxx:135
static YACS::ENGINE::TypeCode * _tc_propvec
Definition: Runtime.hxx:142
@ READY
Definition: define.hxx:37

References _inPropertyPort, _name, _numId, YACS::ENGINE::Runtime::_tc_propvec, _total, checkValidityOfNodeName(), idMap, and InPropertyPort.

◆ Node() [2/2]

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

Definition at line 81 of file Node.cxx.

81 :_inGate(this),_outGate(this),_name(other._name),_father(father),
84{
85 _numId = _total++;
86 idMap[_numId]=this;
87
88 // Every node has an InPropertyPort
89 _inPropertyPort = new InPropertyPort("__InPropertyPort__Node__YACS_", this, Runtime::_tc_propvec);
90 _eventReceiver=const_cast<Node *>(&other);
91}
Base class for all nodes.
Definition: Node.hxx:70
std::map< std::string, std::string > _propertyMap
Definition: Node.hxx:98
Node * _eventReceiver
Definition: Node.hxx:99

References _eventReceiver, _inPropertyPort, _numId, YACS::ENGINE::Runtime::_tc_propvec, _total, idMap, and InPropertyPort.

◆ ~Node()

Node::~Node ( )
virtual

Definition at line 93 of file Node.cxx.

94{
95 delete _inPropertyPort;
96}

References _inPropertyPort.

Member Function Documentation

◆ accept()

◆ applyDPLScope()

void Node::applyDPLScope ( ComposedNode gfn)
virtual

Method called by the Executor only if the executor is sensitive of scope of DynParaLoop. This method is virtual and empty because by default nothing is done.

Reimplemented in YACS::ENGINE::PythonNode.

Definition at line 683 of file Node.cxx.

684{
685}

Referenced by YACS::ENGINE::Executor::functionForTaskExecution(), and YACS::ENGINE::Executor::runTask().

◆ checkHavingCommonFather()

ComposedNode * Node::checkHavingCommonFather ( Node node1,
Node node2 
)
staticprotected
Note
: Check that 'node1' and 'node2' have exactly the same father
Exceptions
If 'node1' and 'node2' have NOT exactly the same father

Definition at line 468 of file Node.cxx.

469{
470 if(node1!=0 && node2!=0)
471 {
472 if(node1->_father==node2->_father)
473 return node1->_father;
474 }
475 throw Exception("check failed : nodes have not the same father");
476}

References testCppPluginInvokation::node1, and testCppPluginInvokation::node2.

Referenced by YACS::ENGINE::ComposedNode::edAddLink(), and YACS::ENGINE::ComposedNode::edRemoveLink().

◆ checkValidityOfNodeName()

void Node::checkValidityOfNodeName ( const std::string &  name)
static

Definition at line 455 of file Node.cxx.

456{
457 if(name.find(ComposedNode::SEP_CHAR_BTW_LEVEL,0)!=string::npos)
458 {
459 string what("Node name "); what+=name; what+="not valid because it contains character "; what+=ComposedNode::SEP_CHAR_BTW_LEVEL;
460 throw Exception(what);
461 }
462}
static const char SEP_CHAR_BTW_LEVEL[]

References YACS::ENGINE::ComposedNode::SEP_CHAR_BTW_LEVEL.

Referenced by Node(), setName(), and YACS::ENGINE::Proc::setName().

◆ checkValidityOfPortName()

void Node::checkValidityOfPortName ( const std::string &  name)
staticprotected

checks validity of ports name, that must not contain a particular character '?' USAGE NOT CLEAR, not used so far, when are those characters set ?

Definition at line 446 of file Node.cxx.

447{
448 if(name.find(SEP_CHAR_IN_PORT, 0 )!=string::npos)
449 {
450 string what("Port name "); what+=name; what+="not valid because it contains character "; what+=SEP_CHAR_IN_PORT;
451 throw Exception(what);
452 }
453}
static const char SEP_CHAR_IN_PORT[]
Definition: Node.hxx:94

References SEP_CHAR_IN_PORT.

Referenced by YACS::ENGINE::ElementaryNode::edAddPort(), and YACS::ENGINE::ElementaryNode::edCheckAddPort().

◆ cleanNodes()

void Node::cleanNodes ( )
virtual

Clean the node in case of not clean exit.

This method should be called on a control-C or sigterm

Reimplemented in YACS::ENGINE::ComposedNode.

Definition at line 846 of file Node.cxx.

847{
848}

◆ clone()

Node * Node::clone ( ComposedNode father,
bool  editionOnly = true 
) const

This method MUST NEVER BE VIRTUAL

This method clones this by :

  • deep copying nodes, links, ports, types
  • containers are either deep copied or shallow copied depending on _isAttachedOnCloning attribute.
  • component are either deep copied or shallow copied depending on _isAttachedOnCloning attribute.

So this method clone is dedicated for DynParaLoop class or subclasses. It should not be used elsewhere, because _isAttachedOnCloning attribute is an attribute in the engine not for GUI/TUI aspects. For GUI/TUI manipulation cloneWithoutCompAndContDeepCpy method should be used preferably.

Parameters
[in]father- The new father of the returned clone.
[in]editionOnlyignored
See also
cloneWithoutCompAndContDeepCpy

Definition at line 131 of file Node.cxx.

132{
133 Node *ret(simpleClone(father,editionOnly));
134 ret->performDuplicationOfPlacement(*this);
135 return ret;
136}
virtual Node * simpleClone(ComposedNode *father, bool editionOnly=true) const =0

References performDuplicationOfPlacement(), and simpleClone().

Referenced by YACS::ENGINE::DynParaLoop::DynParaLoop(), YACS::ENGINE::ElementaryNode::getReadyTasks(), YACS::ENGINE::OptimizerLoop::initInterceptors(), YACS::ENGINE::ProcCataLoader::loadCata(), and YACS::HMI::CommandAddNodeFromCatalog::localExecute().

◆ cloneWithoutCompAndContDeepCpy()

Node * Node::cloneWithoutCompAndContDeepCpy ( ComposedNode father,
bool  editionOnly = true 
) const

This method MUST NEVER BE VIRTUAL

This method clones this by :

  • deep copying nodes, links, ports, types
  • shallow copy containers
  • shallow copy components

So this method simply ignores isAttachedOnCloning attribute for both containers and components. So this method is dedicated for the GUI/TUI users.

Parameters
[in]father- The new father of the returned clone.
[in]editionOnlyignored

Definition at line 150 of file Node.cxx.

151{
152 Node *ret(simpleClone(father,editionOnly));
153 ret->performShallowDuplicationOfPlacement(*this);
154 return ret;
155}

References performShallowDuplicationOfPlacement(), and simpleClone().

Referenced by YACS::HMI::CommandPutInComposedNode::localExecute(), YACS::HMI::CommandCopyNode::localExecute(), and YACS::HMI::SubjectNode::registerUndoDestroy().

◆ edAreAllInputPortInitialized()

bool Node::edAreAllInputPortInitialized ( ) const
virtual

Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency.

Definition at line 369 of file Node.cxx.

370{
371 set<InputPort *> setOfUnitializedInputPort = edGetSetOfUnitializedInputPort();
372 return ( setOfUnitializedInputPort.size() == 0);
373}
virtual std::set< InputPort * > edGetSetOfUnitializedInputPort() const
Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency.
Definition: Node.cxx:356

References edGetSetOfUnitializedInputPort().

◆ edDisconnectAllLinksWithMe()

◆ edGetSetOfUnitializedInputPort()

set< InputPort * > Node::edGetSetOfUnitializedInputPort ( ) const
virtual

Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency.

Definition at line 356 of file Node.cxx.

357{
358 set<InputPort *> setOfUnitializedInputPort;
359 list<InputPort *> allOfInputPorts=getSetOfInputPort();
360 for(list<InputPort *>::const_iterator iter=allOfInputPorts.begin();iter!=allOfInputPorts.end();iter++)
361 {
362 if ( ! (*iter)->edIsInitialized() )
363 setOfUnitializedInputPort.insert(*iter);
364 }
365 return setOfUnitializedInputPort;
366}
virtual std::list< InputPort * > getSetOfInputPort() const =0

References getSetOfInputPort().

Referenced by edAreAllInputPortInitialized().

◆ edUpdateState()

void Node::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 in YACS::ENGINE::ComposedNode, and YACS::ENGINE::ElementaryNode.

Definition at line 745 of file Node.cxx.

746{
747 DEBTRACE("Node::edUpdateState(): " << _modified);
748 _modified=0;
749}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References _modified, and DEBTRACE.

Referenced by isValid().

◆ ensureLoading()

void Node::ensureLoading ( )
virtual

Put this node into TOLOAD state when possible.

Reimplemented in YACS::ENGINE::ElementaryNode.

Definition at line 817 of file Node.cxx.

818{
819 if(_state == YACS::READY)
821}
void setState(YACS::StatesForNode theState)
Sets the given state for node.
Definition: Node.cxx:652
@ TOLOAD
Definition: define.hxx:38

References _state, YACS::READY, setState(), and YACS::TOLOAD.

Referenced by YACS::ENGINE::ElementaryNode::ensureLoading().

◆ exDisabledState()

void Node::exDisabledState ( )
virtual

Notify this node that it has been disabled.

The node goes in DISABLED state and propagate the notification through the outGate port

Definition at line 232 of file Node.cxx.

233{
234 DEBTRACE( "Node::exDisabledState: " << getName() );
237}
const std::string & getName() const
Definition: Node.hxx:125
void exNotifyDisabled()
Notify this port that its node has been disabled.
Definition: OutGate.cxx:76
@ DISABLED
Definition: define.hxx:50

References _outGate, DEBTRACE, YACS::DISABLED, YACS::ENGINE::OutGate::exNotifyDisabled(), getName(), and setState().

Referenced by YACS::ENGINE::InGate::exNotifyDisabled(), YACS::ENGINE::ElementaryNode::init(), init(), YACS::ENGINE::PyFuncNode::init(), YACS::inlinetypeParser< T >::post(), YACS::remotetypeParser< T >::post(), YACS::servertypeParser< T >::post(), YACS::servicetypeParser< T >::post(), YACS::sinlinetypeParser< T >::post(), and YACS::switchtypeParser::state().

◆ exFailedState()

void Node::exFailedState ( )
virtual

Notify this node that its execution has failed.

The node goes in FAILED state and propagate the notification through the outGate port

Definition at line 219 of file Node.cxx.

220{
221 DEBTRACE( "Node::exFailedState: " << getName() );
224}
void exNotifyFailed()
Notify this port that its node has failed.
Definition: OutGate.cxx:66
@ FAILED
Definition: define.hxx:51

References _outGate, DEBTRACE, YACS::ENGINE::OutGate::exNotifyFailed(), YACS::FAILED, getName(), and setState().

Referenced by YACS::ENGINE::InGate::exNotifyFailed().

◆ exForwardFailed()

◆ exForwardFinished()

void Node::exForwardFinished ( )
protectedvirtual

◆ exIsControlReady()

bool Node::exIsControlReady ( ) const

Definition at line 194 of file Node.cxx.

195{
196 return _inGate.exIsReady();
197}
bool exIsReady() const
Definition: InGate.cxx:126

References _inGate, and YACS::ENGINE::InGate::exIsReady().

◆ exUpdateState()

◆ getAllAscendanceOf()

std::list< ComposedNode * > Node::getAllAscendanceOf ( ComposedNode levelToStop = 0) const

gets a set of the composed nodes that constitute the ascendancy of this node, starting from root or from a particular ancestor WARNING : returned set is not sorted !

Parameters
levelToStopcomposed node which is the oldest ancestor required
Returns
ascendancy, direct father first in set.

Definition at line 317 of file Node.cxx.

318{
319 list<ComposedNode *> ret;
320 if(this==levelToStop)
321 return ret;
322 for(ComposedNode *iter=_father;iter!=levelToStop && iter!=0; iter=iter->_father)
323 ret.push_back(iter);
324 return ret;
325}
Base class for all composed nodes.

References _father.

Referenced by YACS::ENGINE::OutPort::calculateHistoryOfLinkWith(), YACS::ENGINE::ComposedNode::checkNoCrossHierachyWith(), YACS::ENGINE::ComposedNode::edAddLink(), YACS::ENGINE::ComposedNode::edRemoveLink(), and YACS::ENGINE::ComposedNode::isNodeAlreadyAggregated().

◆ getAllInPortsComingFromOutsideOfCurrentScope()

virtual std::set< InPort * > YACS::ENGINE::Node::getAllInPortsComingFromOutsideOfCurrentScope ( ) const
pure virtual

◆ getAllOutPortsLeavingCurrentScope()

virtual std::set< OutPort * > YACS::ENGINE::Node::getAllOutPortsLeavingCurrentScope ( ) const
pure virtual

◆ getChildByName()

virtual Node * YACS::ENGINE::Node::getChildByName ( const std::string &  name) const
pure virtual

◆ getClosestDPLAmongAncestors()

DynParaLoop * Node::getClosestDPLAmongAncestors ( ) const

Definition at line 415 of file Node.cxx.

416{
417 if(!_father)
418 return NULL;
419 ComposedNode *iter(_father);
420 do
421 {
422 DynParaLoop *iter2(dynamic_cast<DynParaLoop *>(iter));
423 if(iter2)
424 return iter2;
425 iter=iter->_father;
426 }
427 while(iter);
428 return NULL;
429}
Base class for dynamically (fully or semifully) built graphs.
Definition: DynParaLoop.hxx:41

References _father.

◆ getColorState()

std::string Node::getColorState ( YACS::StatesForNode  state) const

Return the color associated to a state.

Parameters
state: the node state
Returns
the associated color

Definition at line 578 of file Node.cxx.

579{
580 switch(state)
581 {
582 case YACS::READY:
583 return "pink";
584 case YACS::TOLOAD:
585 return "magenta";
586 case YACS::LOADED:
587 return "magenta";
588 case YACS::TOACTIVATE:
589 return "purple";
590 case YACS::ACTIVATED:
591 return "blue";
592 case YACS::DONE:
593 return "green";
594 case YACS::ERROR:
595 return "red";
596 case YACS::FAILED:
597 return "orange";
598 case YACS::DISABLED:
599 return "grey";
600 case YACS::PAUSE:
601 return "white";
602 default:
603 return "white";
604 }
605}
@ LOADED
Definition: define.hxx:39
@ ACTIVATED
Definition: define.hxx:41
@ DONE
Definition: define.hxx:43
@ PAUSE
Definition: define.hxx:47
@ ERROR
Definition: define.hxx:52

References YACS::ACTIVATED, YACS::DISABLED, YACS::DONE, YACS::ERROR, YACS::FAILED, YACS::LOADED, YACS::PAUSE, YACS::READY, yacsorb.CORBAEngineTest::state, YACS::TOACTIVATE, and YACS::TOLOAD.

Referenced by YACS::ENGINE::Bloc::writeDot(), YACS::ENGINE::ForEachLoopGen::writeDot(), YACS::ENGINE::Loop::writeDot(), writeDot(), and YACS::ENGINE::Switch::writeDot().

◆ getContainerLog()

std::string Node::getContainerLog ( )
virtual

returns a string that contains the name of the container log file if it exists

Do nothing here. To subclass

Reimplemented in YACS::ENGINE::SalomeNode, YACS::ENGINE::PythonNode, and YACS::ENGINE::PyFuncNode.

Definition at line 796 of file Node.cxx.

797{
798 return "";
799}

Referenced by YACS::ENGINE::Proc::getNodeContainerLog().

◆ getCoupledNodes()

virtual void YACS::ENGINE::Node::getCoupledNodes ( std::set< Task * > &  coupledNodes)
inlinevirtual

Reimplemented in YACS::ENGINE::ElementaryNode.

Definition at line 199 of file Node.hxx.

199{ }

Referenced by YACS::ENGINE::ElementaryNode::getCoupledNodes().

◆ getDPLScopeInfo()

std::vector< std::pair< std::string, int > > Node::getDPLScopeInfo ( ComposedNode gfn)

Definition at line 660 of file Node.cxx.

661{
662 std::vector< std::pair<std::string,int> > ret;
663 Node *work2(this);
664 ComposedNode *work(getFather());
665 while(work!=gfn && work!=0)
666 {
667 DynParaLoop *workc(dynamic_cast<DynParaLoop *>(work));
668 if(workc)
669 {
670 std::pair<std::string,int> p(gfn->getChildName(workc),workc->getBranchIDOfNode(work2));
671 ret.push_back(p);
672 }
673 work2=work;
674 work=work->getFather();
675 }
676 return ret;
677}
std::string getChildName(const Node *node) const
ComposedNode * getFather() const
Definition: Node.hxx:127
Proc * p
Definition: driver.cxx:216

References YACS::ENGINE::DynParaLoop::getBranchIDOfNode(), YACS::ENGINE::ComposedNode::getChildName(), getFather(), and p.

Referenced by YACS::ENGINE::PythonNode::applyDPLScope().

◆ getEffectiveState() [1/2]

YACS::StatesForNode Node::getEffectiveState ( ) const
virtual

Return the node state in the context of its father.

Returns
the effective node state

The node state is stored in a private attribute _state. This state is relative to its father state : a node with a TOACTIVATE state with a father node in a READY state is not to activate. Its effective state is only READY. This method returns the effective state of the node taking into account that of its father.

Reimplemented in YACS::ENGINE::Switch.

Definition at line 538 of file Node.cxx.

539{
540 if(!_father) //the root node
541 return _state;
543 return YACS::DISABLED;
544 return _father->getEffectiveState(this);
545}
virtual YACS::StatesForNode getEffectiveState() const
Return the node state in the context of its father.
Definition: Node.cxx:538

References _father, _state, YACS::DISABLED, and getEffectiveState().

Referenced by dumpState(), getEffectiveState(), YACS::ENGINE::Switch::getEffectiveState(), YACS::ENGINE::ComposedNode::getErrorReport(), YACS::ENGINE::DynParaLoop::getErrorReport(), getErrorReport(), YACS::ENGINE::Proc::getNodeState(), Proc_i::getState(), Proc_i::getXMLState(), YACS::ENGINE::Proc::getXMLState(), main(), YACS::HMI::GuiExecutor::updateSchema(), YACS::ENGINE::Bloc::writeDot(), YACS::ENGINE::ForEachLoopGen::writeDot(), YACS::ENGINE::Loop::writeDot(), writeDot(), and YACS::ENGINE::Switch::writeDot().

◆ getEffectiveState() [2/2]

YACS::StatesForNode Node::getEffectiveState ( const Node node) const
virtual

Return the effective state of a node in the context of this one (its father)

Parameters
nodethe node which effective state is queried
Returns
the effective node state

Reimplemented in YACS::ENGINE::Switch.

Definition at line 552 of file Node.cxx.

553{
554 if(node->getState()==YACS::DISABLED)
555 return YACS::DISABLED;
556
557 YACS::StatesForNode effectiveState=getEffectiveState();
558 switch(effectiveState)
559 {
560 case YACS::READY:
561 return YACS::READY;
562 case YACS::TOACTIVATE:
563 return YACS::READY;
564 case YACS::DISABLED:
565 return YACS::DISABLED;
566 case YACS::ERROR:
567 return YACS::FAILED;
568 default:
569 return node->getState();
570 }
571}
virtual YACS::StatesForNode getState() const
Definition: Node.hxx:118
StatesForNode
Definition: define.hxx:34

References YACS::DISABLED, YACS::ERROR, YACS::FAILED, getEffectiveState(), getState(), YACS::READY, and YACS::TOACTIVATE.

◆ getErrorDetails()

virtual std::string YACS::ENGINE::Node::getErrorDetails ( ) const
inlinevirtual

◆ getErrorReport()

std::string Node::getErrorReport ( )
virtual

returns a string that contains an error report if the node is in error

Reimplemented in YACS::ENGINE::ComposedNode, and YACS::ENGINE::DynParaLoop.

Definition at line 755 of file Node.cxx.

756{
758 return "<error node= "+getName()+ "state= DISABLED/>\n";
759
760 YACS::StatesForNode effectiveState=getEffectiveState();
761
762 DEBTRACE("Node::getErrorReport: " << getName() << " " << effectiveState << " " << _errorDetails);
763 if(effectiveState != YACS::INVALID && effectiveState != YACS::ERROR &&
764 effectiveState != YACS::FAILED && effectiveState != YACS::INTERNALERR)
765 return "";
766
767 std::string report="<error node= " ;
768 report=report + getName() ;
769 switch(effectiveState)
770 {
771 case YACS::INVALID:
772 report=report+" state= INVALID";
773 break;
774 case YACS::ERROR:
775 report=report+" state= ERROR";
776 break;
777 case YACS::FAILED:
778 report=report+" state= FAILED";
779 break;
781 report=report+" state= INTERNALERR";
782 break;
783 default:
784 break;
785 }
786 report=report + ">\n" ;
787 report=report+_errorDetails;
788 report=report+"\n</error>";
789 return report;
790}
@ INVALID
Definition: define.hxx:36
@ INTERNALERR
Definition: define.hxx:49

References _errorDetails, DEBTRACE, YACS::DISABLED, YACS::ERROR, YACS::FAILED, getEffectiveState(), getName(), getState(), YACS::INTERNALERR, and YACS::INVALID.

Referenced by YACS::ENGINE::Proc::getNodeErrorReport(), YACS::HMI::GenericGui::onGetErrorReport(), and YACS::ENGINE::OptimizerLoop::updateStateOnFailedEventFrom().

◆ getFather()

◆ getId()

const std::string Node::getId ( ) const

Definition at line 478 of file Node.cxx.

479{
480 std::string id=getRootNode()->getName();
481 if(getRootNode() != this)
482 id= id+'.'+ getRootNode()->getChildName(this);
483 string::size_type debut =id.find_first_of('.');
484 while(debut != std::string::npos){
485 id[debut]='_';
486 debut=id.find_first_of('.',debut);
487 }
488 return id;
489}
std::string getName() const
virtual ComposedNode * getRootNode() const
Definition: Node.cxx:431

References YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::ComposedNode::getName(), and getRootNode().

Referenced by YACS::ENGINE::PythonNode::executeRemote(), YACS::ENGINE::PythonNode::pythonEntryName(), YACS::ENGINE::Bloc::writeDot(), YACS::ENGINE::ForEachLoopGen::writeDot(), YACS::ENGINE::Loop::writeDot(), writeDot(), and YACS::ENGINE::Switch::writeDot().

◆ getImplementation()

string Node::getImplementation ( ) const
Returns
Implementation of node: C++, Python, CORBA... _implementation is set by a derived class in a Runtime it normally applies only to elementaryNodes and it is used by Ports to select Data Converters. Potential problem with Ports attached to composed Nodes...

Definition at line 350 of file Node.cxx.

351{
352 return _implementation;
353}

References _implementation.

Referenced by YACS::ENGINE::RuntimeSALOME::adapt(), YACS::ENGINE::OutputPort::edAddInPropertyPort(), YACS::ENGINE::OutputPort::edAddInputPort(), and writeDot().

◆ getInGate()

◆ getInPort()

InPort * Node::getInPort ( const std::string &  name) const

Definition at line 239 of file Node.cxx.

240{
241 InPort *ret;
242 try
243 {
244 ret=getInputPort(name);
245 }
246 catch(Exception& e)
247 {
248 ret=getInputDataStreamPort(name);
249 }
250 return ret;
251}
virtual InputPort * getInputPort(const std::string &name) const
Definition: Node.cxx:260
virtual InputDataStreamPort * getInputDataStreamPort(const std::string &name) const =0

References getInputDataStreamPort(), and getInputPort().

Referenced by YACS::ENGINE::Bloc::Bloc(), YACS::ENGINE::DynParaLoop::DynParaLoop(), YACS::ENGINE::ForLoop::ForLoop(), and YACS::ENGINE::WhileLoop::WhileLoop().

◆ getInPortName()

virtual std::string YACS::ENGINE::Node::getInPortName ( const InPort ) const
pure virtual

◆ getInPropertyPort()

InPropertyPort * Node::getInPropertyPort ( ) const

Definition at line 254 of file Node.cxx.

255{
256 return _inPropertyPort;
257}

References _inPropertyPort.

◆ getInputDataStreamPort()

◆ getInputPort()

◆ getLocalInputPorts()

◆ getLocalOutputPorts()

◆ getMaxLevelOfParallelism()

◆ getName()

const std::string & YACS::ENGINE::Node::getName ( ) const
inline

Definition at line 125 of file Node.hxx.

125{ return _name; }

Referenced by YACS::ENGINE::CollectorSwOutPort::addPotentialProducerForMaster(), YACS::HMI::SubjectComposedNode::addSubjectNode(), YACS::ENGINE::InputPort::checkBasicConsistency(), YACS::ENGINE::OutNode::checkBasicConsistency(), YACS::ENGINE::PresetNode::checkBasicConsistency(), YACS::ENGINE::PythonNode::checkBasicConsistency(), YACS::ENGINE::PyFuncNode::checkBasicConsistency(), YACS::ENGINE::StudyInNode::checkBasicConsistency(), YACS::ENGINE::StudyOutNode::checkBasicConsistency(), YACS::ENGINE::DynParaLoop::checkConsistencyAndSetNode(), YACS::ENGINE::ComposedNode::checkInMyDescendance(), YACS::ENGINE::ComposedNode::checkNoCrossHierachyWith(), YACS::ENGINE::DynParaLoop::cloneAndPlaceNodesCoherently(), YACS::HMI::SubjectNode::copy(), YACS::ENGINE::PyFuncNode::createRemoteAdaptedPyInterpretor(), YACS::ENGINE::Bloc::edAddChild(), YACS::ENGINE::ComposedNode::edAddDFLink(), YACS::ENGINE::ComposedNode::edRemoveChild(), YACS::ENGINE::Switch::edRemoveChild(), YACS::ENGINE::ComposedNode::edRemoveLink(), YACS::ENGINE::Loop::edSetNode(), YACS::ENGINE::ElementaryNode::edUpdateState(), YACS::ENGINE::ElementaryNode::ensureLoading(), exDisabledState(), YACS::ENGINE::CORBANode::execute(), YACS::ENGINE::SalomeNode::execute(), YACS::ENGINE::DistributedPythonNode::execute(), YACS::ENGINE::SalomePythonNode::execute(), YACS::ENGINE::PythonNode::executeLocal(), YACS::ENGINE::PyFuncNode::executeLocal(), YACS::ENGINE::PythonNode::executeRemote(), YACS::ENGINE::PyFuncNode::executeRemote(), exFailedState(), YACS::ENGINE::ElementaryNode::exUpdateState(), YACS::ENGINE::Switch::getCaseId(), YACS::ENGINE::DynParaLoop::getChildByNameExec(), YACS::ENGINE::DynParaLoop::getChildByShortName(), YACS::ENGINE::Loop::getChildByShortName(), YACS::ENGINE::ComposedNode::getChildName(), getErrorReport(), YACS::ENGINE::CollectorSwOutPort::getHumanReprOfIncompleteCases(), YACS::ENGINE::ElementaryNode::getInPortName(), YACS::ENGINE::ComposedNode::getMyQualifiedName(), YACS::ENGINE::Switch::getMyQualifiedName(), YACS::HMI::SubjectNode::getName(), YACS::ENGINE::ComposedNode::getName(), YACS::ENGINE::ElementaryPoint::getNodeName(), YACS::ENGINE::ElementaryNode::getOutPortName(), YACS::ENGINE::ComposedNode::getPortName(), getQualifiedName(), YACS::ENGINE::ElementaryNode::getReadyTasks(), YACS::ENGINE::ElementaryPoint::getRepr(), YACS::ENGINE::ElementaryNode::init(), YACS::inlinetypeParser< T >::inport(), YACS::servertypeParser< T >::instream(), YACS::servicetypeParser< T >::instream(), YACS::ENGINE::DistributedPythonNode::load(), YACS::HMI::SubjectComposedNode::loadLinks(), YACS::ENGINE::PyFuncNode::loadLocal(), YACS::ENGINE::PythonEntry::loadRemoteContainer(), YACS::HMI::CommandReparentNode::localExecute(), YACS::HMI::CommandCopyNode::localExecute(), YACS::HMI::CommandRenameNode::localExecute(), YACS::HMI::CommandRenameNode::localReverse(), modified(), YACS::ENGINE::graphParser::onEnd(), YACS::inlinetypeParser< T >::outport(), YACS::servertypeParser< T >::outstream(), YACS::servicetypeParser< T >::outstream(), YACS::inlinetypeParser< T >::post(), YACS::pseudocomposednodetypeParser< T >::post(), YACS::remotetypeParser< T >::post(), YACS::servertypeParser< T >::post(), YACS::servicetypeParser< T >::post(), YACS::sinlinetypeParser< T >::post(), YACS::HMI::SubjectComposedNode::removeControlLink(), YACS::HMI::SubjectNode::reparent(), resetState(), YACS::ENGINE::PyFuncNode::retrieveDftRemotePyInterpretorIfAny(), YACS::ENGINE::AbstractPoint::Rewire(), YACS::HMI::SubjectNode::saveLinks(), YACS::HMI::GuiExecutor::setInPortValue(), YACS::HMI::SubjectDataPort::setName(), YACS::HMI::SubjectNode::setName(), setState(), YACS::ENGINE::ComposedNode::updateStateFrom(), YACS::ENGINE::DynParaLoop::updateStateOnFailedEventFrom(), YACS::ENGINE::OptimizerLoop::updateStateOnFailedEventFrom(), YACS::ENGINE::Bloc::updateStateOnFinishedEventFrom(), YACS::ENGINE::ForEachLoopGen::updateStateOnFinishedEventFrom(), YACS::ENGINE::ForLoop::updateStateOnFinishedEventFrom(), YACS::ENGINE::VisitorSaveSchema::visitInlineFuncNode(), YACS::ENGINE::VisitorSaveSchema::visitInlineNode(), YACS::ENGINE::VisitorSaveSalomeSchema::visitOutNode(), YACS::ENGINE::VisitorSaveSalomeSchema::visitPresetNode(), YACS::ENGINE::VisitorSaveSchema::visitServerNode(), YACS::ENGINE::VisitorSaveSchema::visitServiceInlineNode(), YACS::ENGINE::VisitorSaveSchema::visitServiceNode(), YACS::ENGINE::VisitorSaveSalomeSchema::visitStudyInNode(), YACS::ENGINE::VisitorSaveSalomeSchema::visitStudyOutNode(), YACS::ENGINE::VisitorSaveSchema::writeSimpleDataLinks(), and YACS::ENGINE::VisitorSaveSchema::writeSimpleStreamLinks().

◆ getNumberOfInputPorts()

◆ getNumberOfOutputPorts()

virtual int YACS::ENGINE::Node::getNumberOfOutputPorts ( ) const
pure virtual

◆ getNumId()

◆ getOutGate()

◆ getOutNodes()

list< Node * > Node::getOutNodes ( ) const

get the set of all nodes connected to the outGate

Definition at line 185 of file Node.cxx.

186{
187 list<Node *> ret;
188 list<InGate *> inGates=_outGate.edSetInGate();
189 for(list<InGate *>::iterator iter=inGates.begin();iter!=inGates.end();iter++)
190 ret.push_back((*iter)->getNode());
191 return ret;
192}
std::list< InGate * > edSetInGate() const
Definition: OutGate.cxx:112

References _outGate, and YACS::ENGINE::OutGate::edSetInGate().

Referenced by insertNodeChildrenInSet(), and YACS::ENGINE::Bloc::writeDot().

◆ getOutPort()

OutPort * Node::getOutPort ( const std::string &  name) const
virtual
Note
: Contrary to getOutputPort method, this method returns the output port at highest level, possible. That is to say in some ComposedNode, like ForEachLoop or Switch, an outport inside 'this' is seen differently than the true outport.

Reimplemented in YACS::ENGINE::ComposedNode, YACS::ENGINE::DynParaLoop, YACS::ENGINE::ForEachLoopGen, YACS::ENGINE::ForLoop, YACS::ENGINE::OptimizerLoop, and YACS::ENGINE::Switch.

Definition at line 275 of file Node.cxx.

276{
277 OutPort *ret;
278 try
279 {
280 ret=getOutputPort(name);
281 }
282 catch(Exception& e)
283 {
284 ret=getOutputDataStreamPort(name);
285 }
286 return ret;
287}
virtual OutputPort * getOutputPort(const std::string &name) const =0
virtual OutputDataStreamPort * getOutputDataStreamPort(const std::string &name) const =0

References getOutputDataStreamPort(), and getOutputPort().

Referenced by YACS::ENGINE::ComposedNode::getOutPort().

◆ getOutPortName()

virtual std::string YACS::ENGINE::Node::getOutPortName ( const OutPort ) const
pure virtual

◆ getOutputDataStreamPort()

◆ getOutputPort()

◆ getProc() [1/2]

◆ getProc() [2/2]

const Proc * Node::getProc ( ) const
virtual

Reimplemented in YACS::ENGINE::Proc.

Definition at line 408 of file Node.cxx.

409{
410 if(!_father)
411 return 0;
412 return _father->getProc();
413}

References _father, and getProc().

◆ getProgressWeight()

virtual std::list< ProgressWeight > YACS::ENGINE::Node::getProgressWeight ( ) const
pure virtual

◆ getProperties()

std::map< std::string, std::string > Node::getProperties ( )

Definition at line 509 of file Node.cxx.

510{
511 std::map<std::string,std::string> amap=_propertyMap;
512 if(_father)
513 {
514 std::map<std::string,std::string> fatherMap=_father->getProperties();
515 amap.insert(fatherMap.begin(),fatherMap.end());
516 }
517
518 return amap;
519}
std::map< std::string, std::string > getProperties()
Definition: Node.cxx:509

References _father, _propertyMap, and getProperties().

Referenced by YACS::ENGINE::SalomeContainerToolsBase::CreateComponentInstance(), YACS::ENGINE::SalomeNode::execute(), and getProperties().

◆ getProperty()

std::string Node::getProperty ( const std::string &  name)
virtual

Reimplemented in YACS::ENGINE::ComposedNode.

Definition at line 497 of file Node.cxx.

498{
499 std::map<std::string,std::string>::iterator it=_propertyMap.find(name);
500
501 if(it != _propertyMap.end())
502 return it->second;
503 else if(_father)
504 return _father->getProperty(name);
505 else
506 return "";
507}
std::string getProperty(const std::string &name) override

References _father, _propertyMap, and YACS::ENGINE::ComposedNode::getProperty().

Referenced by YACS::ENGINE::ComposedNode::getProperty().

◆ getPropertyMap()

std::map< std::string, std::string > YACS::ENGINE::Node::getPropertyMap ( )
inline

◆ getQualifiedName()

std::string Node::getQualifiedName ( ) const

same as Node::getName() in most cases, but differs for children of switch

used by writeDot to distinguish children of switch, by adding a prefix to the name. prefix is built on case id.

Definition at line 632 of file Node.cxx.

633{
634 if(_father)
635 return _father->getMyQualifiedName(this);
636 return getName();
637}
virtual std::string getMyQualifiedName(const Node *directSon) const

References _father, YACS::ENGINE::ComposedNode::getMyQualifiedName(), and getName().

Referenced by YACS::ENGINE::ComposedNode::getChildName(), YACS::ENGINE::ComposedNode::getPortName(), Proc_i::getXMLState(), YACS::ENGINE::Proc::getXMLState(), YACS::HMI::CommandCopyNode::localExecute(), YACS::ENGINE::Bloc::writeDot(), YACS::ENGINE::Loop::writeDot(), writeDot(), YACS::ENGINE::Proc::writeDot(), and YACS::ENGINE::Switch::writeDot().

◆ getReadyTasks()

◆ getRecursiveConstituents()

virtual std::list< ElementaryNode * > YACS::ENGINE::Node::getRecursiveConstituents ( ) const
pure virtual

◆ getRootNode()

◆ getSetOfInPort()

std::list< InPort * > Node::getSetOfInPort ( ) const

Definition at line 289 of file Node.cxx.

290{
291 list<InPort *> ret;
292 list<InputPort *> data=getSetOfInputPort();
293 ret.insert(ret.end(),data.begin(),data.end());
294 list<InputDataStreamPort *> ds=getSetOfInputDataStreamPort();
295 ret.insert(ret.end(),ds.begin(),ds.end());
296 return ret;
297}
virtual std::list< InputDataStreamPort * > getSetOfInputDataStreamPort() const =0

References getSetOfInputDataStreamPort(), and getSetOfInputPort().

Referenced by YACS::ENGINE::ComposedNode::getAllInPortsComingFromOutsideOfCurrentScope(), YACS::ENGINE::ElementaryNode::getAllInPortsComingFromOutsideOfCurrentScope(), YACS::ENGINE::DynParaLoop::prepareInputsFromOutOfScope(), and YACS::HMI::SceneElementaryNodeItem::reorganize().

◆ getSetOfInputDataStreamPort()

virtual std::list< InputDataStreamPort * > YACS::ENGINE::Node::getSetOfInputDataStreamPort ( ) const
pure virtual

◆ getSetOfInputPort()

◆ getSetOfLinksComingInCurrentScope()

virtual std::vector< std::pair< InPort *, OutPort * > > YACS::ENGINE::Node::getSetOfLinksComingInCurrentScope ( ) const
pure virtual

◆ getSetOfLinksLeavingCurrentScope()

◆ getSetOfOutPort()

std::list< OutPort * > Node::getSetOfOutPort ( ) const

Definition at line 299 of file Node.cxx.

300{
301 list<OutPort *> ret;
302 list<OutputPort *> data=getSetOfOutputPort();
303 ret.insert(ret.end(),data.begin(),data.end());
304 list<OutputDataStreamPort *> ds=getSetOfOutputDataStreamPort();
305 ret.insert(ret.end(),ds.begin(),ds.end());
306 return ret;
307}
virtual std::list< OutputPort * > getSetOfOutputPort() const =0
virtual std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort() const =0

References getSetOfOutputDataStreamPort(), and getSetOfOutputPort().

Referenced by YACS::ENGINE::ComposedNode::getAllOutPortsLeavingCurrentScope(), YACS::ENGINE::ElementaryNode::getAllOutPortsLeavingCurrentScope(), YACS::HMI::SceneBlocItem::getNodesInfo(), YACS::ENGINE::ComposedNode::getSetOfInternalLinks(), and YACS::HMI::SceneElementaryNodeItem::reorganize().

◆ getSetOfOutputDataStreamPort()

virtual std::list< OutputDataStreamPort * > YACS::ENGINE::Node::getSetOfOutputDataStreamPort ( ) const
pure virtual

◆ getSetOfOutputPort()

virtual std::list< OutputPort * > YACS::ENGINE::Node::getSetOfOutputPort ( ) const
pure virtual

◆ getState()

virtual YACS::StatesForNode YACS::ENGINE::Node::getState ( ) const
inlinevirtual

◆ getStateName()

std::string Node::getStateName ( YACS::StatesForNode  state)
static

◆ getWeightRegardingDPL()

◆ init()

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

◆ isModified()

virtual int YACS::ENGINE::Node::isModified ( )
inlinevirtual

Definition at line 193 of file Node.hxx.

193{ return _modified; }

◆ isValid()

int Node::isValid ( )
virtual

indicates if the node is valid (returns 1) or not (returns 0)

This method is useful when editing a schema. It has no meaning in execution. When a node is edited, its modified method must be called so when isValid is called, its state is updated (call to edUpdateState) before returning the validity check

Definition at line 730 of file Node.cxx.

731{
732 if(_modified)
735 return 1;
736 else
737 return 0;
738}
virtual void edUpdateState()
update the status of the node
Definition: Node.cxx:745

References _modified, _state, edUpdateState(), and YACS::INVALID.

Referenced by YACS::HMI::SubjectNode::isValid(), main(), YACS::HMI::GenericGui::onRunLoadedSchema(), and YACS::HMI::EditionProc::synchronize().

◆ modified()

void Node::modified ( )
virtual

Sets Node in modified state and its father if it exists.

Reimplemented in YACS::ENGINE::Proc.

Definition at line 805 of file Node.cxx.

806{
807 DEBTRACE("Node::modified() " << getName());
808 _modified=1;
809 if(_father)
810 _father->modified();
811}
virtual void modified()
Sets Node in modified state and its father if it exists.
Definition: Node.cxx:805

References _father, _modified, DEBTRACE, getName(), and modified().

Referenced by YACS::ENGINE::DynParaLoop::checkConsistencyAndSetNode(), YACS::ENGINE::Bloc::edAddChild(), YACS::ENGINE::ElementaryNode::edAddInputDataStreamPort(), YACS::ENGINE::ElementaryNode::edAddInputPort(), YACS::ENGINE::ElementaryNode::edAddOutputDataStreamPort(), YACS::ENGINE::ElementaryNode::edAddOutputPort(), YACS::ENGINE::Switch::edChangeCase(), YACS::ENGINE::Switch::edReleaseCase(), YACS::ENGINE::Bloc::edRemoveChild(), YACS::ENGINE::ComposedNode::edRemoveChild(), YACS::ENGINE::DynParaLoop::edRemoveChild(), YACS::ENGINE::Loop::edRemoveChild(), YACS::ENGINE::Loop::edRemoveNode(), YACS::ENGINE::ElementaryNode::edRemovePort(), YACS::ENGINE::Switch::edSetNode(), YACS::ENGINE::Loop::edSetNode(), YACS::ENGINE::OptimizerLoop::loadAlgorithm(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), modified(), YACS::ENGINE::Port::modified(), YACS::ENGINE::DynParaLoop::removeNode(), YACS::ENGINE::OptimizerLoop::setAlgorithm(), YACS::ENGINE::InlineNode::setExecutionMode(), YACS::ENGINE::InlineFuncNode::setFname(), and YACS::ENGINE::InlineNode::setScript().

◆ operator<()

bool Node::operator< ( const Node other) const

Definition at line 335 of file Node.cxx.

336{
337 const ComposedNode *iter=_father;
338 while(iter!=0 && iter!=(&other))
339 iter=iter->_father;
340 return iter==(&other);
341}

References _father.

◆ operator>()

bool Node::operator> ( const Node other) const

Definition at line 327 of file Node.cxx.

328{
329 const ComposedNode *iter=other._father;
330 while(iter!=0 && iter!=this)
331 iter=iter->_father;
332 return iter==this;
333}

References _father.

◆ partitionRegardingDPL()

◆ performDuplicationOfPlacement()

virtual void YACS::ENGINE::Node::performDuplicationOfPlacement ( const Node other)
protectedpure virtual

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

Implemented in YACS::ENGINE::ComposedNode, YACS::ENGINE::ElementaryNode, YACS::ENGINE::InlineNode, and YACS::ENGINE::ServiceNode.

Referenced by clone().

◆ performShallowDuplicationOfPlacement()

virtual void YACS::ENGINE::Node::performShallowDuplicationOfPlacement ( const Node other)
protectedpure virtual

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

Implemented in YACS::ENGINE::ComposedNode, YACS::ENGINE::ElementaryNode, YACS::ENGINE::InlineNode, and YACS::ENGINE::ServiceNode.

Referenced by cloneWithoutCompAndContDeepCpy().

◆ resetState()

void Node::resetState ( int  level)
virtual

Reset the node state depending on the parameter level.

Reimplemented in YACS::ENGINE::ComposedNode, and YACS::ENGINE::ForEachLoopGen.

Definition at line 851 of file Node.cxx.

852{
853 DEBTRACE("Node::resetState " << getName() << "," << level << "," << _state);
855 {
857 InGate* inGate = getInGate();
858 std::list<OutGate*> backlinks = inGate->getBackLinks();
859 for (std::list<OutGate*>::iterator io = backlinks.begin(); io != backlinks.end(); io++)
860 {
861 Node* fromNode = (*io)->getNode();
862 if(fromNode->getState() == YACS::DONE)
863 {
864 inGate->setPrecursorDone(*io);
865 }
866 }
867 }
868}
void setPrecursorDone(OutGate *fromgate)
Definition: InGate.cxx:142
std::list< OutGate * > getBackLinks()
Definition: InGate.cxx:134
InGate * getInGate()
Definition: Node.hxx:123

References _state, YACS::ACTIVATED, DEBTRACE, YACS::DONE, YACS::ERROR, YACS::FAILED, YACS::ENGINE::InGate::getBackLinks(), getInGate(), getName(), getState(), YACS::READY, YACS::ENGINE::InGate::setPrecursorDone(), and setState().

Referenced by YACS::ENGINE::ComposedNode::resetState().

◆ sendEvent()

void Node::sendEvent ( const std::string &  event)
virtual

emit notification to all observers registered with the dispatcher

The dispatcher is unique and can be obtained by getDispatcher()

Definition at line 691 of file Node.cxx.

692{
693 DEBTRACE("Node::sendEvent " << event);
695 if(!_eventReceiver)
696 {
697 disp->dispatch(this,event);
698 }
699 else
700 {
701 disp->dispatchFromClone(_eventReceiver,event,this);
702 }
703}
Base class for dispatcher in observer pattern.
Definition: Dispatcher.hxx:74
static Dispatcher * getDispatcher()
Definition: Dispatcher.cxx:55

References _eventReceiver, DEBTRACE, YACS::ENGINE::Dispatcher::dispatch(), YACS::ENGINE::Dispatcher::dispatchFromClone(), and YACS::ENGINE::Dispatcher::getDispatcher().

Referenced by YACS::ENGINE::ForEachLoopGen::exUpdateProgress(), YACS::ENGINE::ForLoop::exUpdateProgress(), and setState().

◆ sendEvent2()

void Node::sendEvent2 ( const std::string &  event,
void *  something 
)
virtual

emit notification to all observers registered with the dispatcher

The dispatcher is unique and can be obtained by getDispatcher()

Definition at line 709 of file Node.cxx.

710{
712 disp->dispatch2(this,event,something);
713}
virtual void dispatch2(Node *object, const std::string &event, void *something)
Definition: Dispatcher.cxx:99

References YACS::ENGINE::Dispatcher::dispatch2(), and YACS::ENGINE::Dispatcher::getDispatcher().

Referenced by YACS::ENGINE::ForEachLoopGen::updateStateForWorkNodeOnFinishedEventFrom().

◆ setErrorDetails()

◆ setName()

void Node::setName ( const std::string &  name)

Change the name of the node.

raise an exception if the name is already used in the scope of its father

Parameters
name: the new name

Definition at line 162 of file Node.cxx.

163{
165 if(_father)
166 {
167 if(_father->isNameAlreadyUsed(name))
168 {
169 if ( _father->getChildByName(name) != this )
170 {
171 std::string what("Name ");
172 what+=name;
173 what+=" already exists in the scope of "; what+=_father->getName();
174 throw Exception(what);
175 }
176 }
177 }
178 _name=name;
179}
Node * getChildByName(const std::string &name) const
virtual bool isNameAlreadyUsed(const std::string &name) const

References _father, _name, checkValidityOfNodeName(), YACS::ENGINE::ComposedNode::getChildByName(), YACS::ENGINE::ComposedNode::getName(), and YACS::ENGINE::ComposedNode::isNameAlreadyUsed().

Referenced by YACS::ENGINE::ElementaryNode::getReadyTasks(), YACS::HMI::CommandAddNodeFromCatalog::localExecute(), YACS::HMI::CommandPutInComposedNode::localExecute(), YACS::HMI::CommandCopyNode::localExecute(), YACS::HMI::CommandRenameNode::localExecute(), and YACS::HMI::CommandRenameNode::localReverse().

◆ setProperties()

void Node::setProperties ( std::map< std::string, std::string >  properties)
virtual

Definition at line 521 of file Node.cxx.

522{
523 _propertyMap.clear();
524 _propertyMap=properties;
525}

References _propertyMap.

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

◆ setProperty()

void Node::setProperty ( const std::string &  name,
const std::string &  value 
)
virtual

Reimplemented in YACS::ENGINE::ComposedNode.

Definition at line 491 of file Node.cxx.

492{
493 DEBTRACE("Node::setProperty " << name << " " << value);
494 _propertyMap[name]=value;
495}

References _propertyMap, and DEBTRACE.

Referenced by YACS::ENGINE::InPropertyPort::exNewPropertyValue(), and YACS::ENGINE::ComposedNode::setProperty().

◆ setState()

void Node::setState ( YACS::StatesForNode  theState)

Sets the given state for node.

It is strongly recommended to use this function if you want to change the state of the node, instead of direct access to _state field (_state = ...).

Definition at line 652 of file Node.cxx.

653{
654 DEBTRACE("Node::setState: " << getName() << " " << theState);
655 _state = theState;
656 // emit notification to all observers registered with the dispatcher on any change of the node's state
657 sendEvent("status");
658}
virtual void sendEvent(const std::string &event)
emit notification to all observers registered with the dispatcher
Definition: Node.cxx:691

References _state, DEBTRACE, getName(), and sendEvent().

Referenced by YACS::ENGINE::ElementaryNode::aborted(), YACS::ENGINE::FakeNodeForForEachLoop::aborted(), YACS::ENGINE::FakeNodeForLoop::aborted(), YACS::ENGINE::FakeNodeForOptimizerLoop::aborted(), YACS::ENGINE::FakeNodeForSwitch::aborted(), YACS::ENGINE::ElementaryNode::begin(), YACS::ENGINE::ElementaryNode::connected(), YACS::ENGINE::ComposedNode::edUpdateState(), YACS::ENGINE::ElementaryNode::edUpdateState(), YACS::ENGINE::ElementaryNode::ensureLoading(), ensureLoading(), exDisabledState(), exFailedState(), YACS::ENGINE::Bloc::exUpdateState(), YACS::ENGINE::ElementaryNode::exUpdateState(), YACS::ENGINE::ForEachLoopGen::exUpdateState(), YACS::ENGINE::ForLoop::exUpdateState(), exUpdateState(), YACS::ENGINE::OptimizerLoop::exUpdateState(), YACS::ENGINE::Switch::exUpdateState(), YACS::ENGINE::WhileLoop::exUpdateState(), YACS::ENGINE::FakeNodeForLoop::FakeNodeForLoop(), YACS::ENGINE::OptimizerLoop::finalize(), YACS::ENGINE::ElementaryNode::finished(), YACS::ENGINE::FakeNodeForForEachLoop::finished(), YACS::ENGINE::FakeNodeForLoop::finished(), YACS::ENGINE::FakeNodeForOptimizerLoop::finished(), YACS::ENGINE::FakeNodeForSwitch::finished(), YACS::ENGINE::DynParaLoop::forwardExecStateToOriginalBody(), YACS::ENGINE::Bloc::getReadyTasks(), YACS::ENGINE::ForEachLoopGen::getReadyTasks(), YACS::ENGINE::Loop::getReadyTasks(), YACS::ENGINE::Switch::getReadyTasks(), YACS::ENGINE::ElementaryNode::init(), init(), YACS::ENGINE::PyFuncNode::init(), resetState(), YACS::ENGINE::StateLoader(), YACS::ENGINE::ForEachLoopGen::updateStateForFinalizeNodeOnFinishedEventFrom(), YACS::ENGINE::ForEachLoopGen::updateStateForInitNodeOnFinishedEventFrom(), YACS::ENGINE::ForEachLoopGen::updateStateForWorkNodeOnFinishedEventFrom(), YACS::ENGINE::ComposedNode::updateStateFrom(), YACS::ENGINE::Bloc::updateStateOnFailedEventFrom(), YACS::ENGINE::ComposedNode::updateStateOnFailedEventFrom(), YACS::ENGINE::DynParaLoop::updateStateOnFailedEventFrom(), YACS::ENGINE::Bloc::updateStateOnFinishedEventFrom(), YACS::ENGINE::ForLoop::updateStateOnFinishedEventFrom(), YACS::ENGINE::OptimizerLoop::updateStateOnFinishedEventFrom(), YACS::ENGINE::Switch::updateStateOnFinishedEventFrom(), YACS::ENGINE::WhileLoop::updateStateOnFinishedEventFrom(), and YACS::ENGINE::ComposedNode::updateStateOnStartEventFrom().

◆ shutdown()

void Node::shutdown ( int  level)
virtual

Stop all pending activities of the node.

This method should be called when a Proc is finished and must be deleted from the YACS server

Reimplemented in YACS::ENGINE::ComposedNode, YACS::ENGINE::DynParaLoop, YACS::ENGINE::SalomeNode, YACS::ENGINE::PythonNode, and YACS::ENGINE::PyFuncNode.

Definition at line 837 of file Node.cxx.

838{
839 if(level==0)return;
840}

◆ simpleClone()

◆ typeName()

◆ writeDot()

void Node::writeDot ( std::ostream &  os) const
virtual

Dump to the input stream a dot representation of the node.

Parameters
os: the input stream

Reimplemented in YACS::ENGINE::Bloc, YACS::ENGINE::ForEachLoopGen, YACS::ENGINE::Loop, YACS::ENGINE::Proc, and YACS::ENGINE::Switch.

Definition at line 611 of file Node.cxx.

612{
613 os << getId() << "[fillcolor=\"" ;
615 os << getColorState(state);
616 os << "\" label=\"" << getImplementation() << "Node:" ;
617 os << getQualifiedName() <<"\"];\n";
618}
std::string getImplementation() const
Definition: Node.cxx:350
std::string getColorState(YACS::StatesForNode state) const
Return the color associated to a state.
Definition: Node.cxx:578
std::string getQualifiedName() const
same as Node::getName() in most cases, but differs for children of switch
Definition: Node.cxx:632
const std::string getId() const
Definition: Node.cxx:478

References getColorState(), getEffectiveState(), getId(), getImplementation(), getQualifiedName(), and yacsorb.CORBAEngineTest::state.

Referenced by YACS::ENGINE::ForEachLoopGen::writeDot(), YACS::ENGINE::Loop::writeDot(), and writeDotInFile().

◆ writeDotInFile()

void Node::writeDotInFile ( const std::string &  fileName) const

Definition at line 620 of file Node.cxx.

621{
622 std::ofstream f(fileName);
623 this->writeDot(f);
624}
virtual void writeDot(std::ostream &os) const
Dump to the input stream a dot representation of the node.
Definition: Node.cxx:611

References gui.CONNECTOR::f(), and writeDot().

Friends And Related Function Documentation

◆ Bloc

friend class Bloc
friend

Definition at line 71 of file Node.hxx.

◆ ComposedNode

friend class ComposedNode
friend

Definition at line 79 of file Node.hxx.

◆ DynParaLoop

friend class DynParaLoop
friend

Definition at line 77 of file Node.hxx.

◆ ElementaryNode

friend class ElementaryNode
friend

Definition at line 80 of file Node.hxx.

◆ ForEachLoop

friend class ForEachLoop
friend

Definition at line 78 of file Node.hxx.

Referenced by YACS::ENGINE::ForEachLoop::simpleClone().

◆ InPropertyPort

friend class InPropertyPort
friend

Definition at line 76 of file Node.hxx.

Referenced by Node().

◆ InputPort

friend class InputPort
friend

Definition at line 74 of file Node.hxx.

◆ Loop

friend class Loop
friend

Definition at line 72 of file Node.hxx.

◆ OutputPort

friend class OutputPort
friend

Definition at line 75 of file Node.hxx.

◆ StateLoader

void StateLoader ( Node node,
YACS::StatesForNode  state 
)
friend

◆ Switch

friend class Switch
friend

Definition at line 73 of file Node.hxx.

Referenced by YACS::ENGINE::Switch::simpleClone().

◆ Visitor

friend class Visitor
friend

Definition at line 81 of file Node.hxx.

Referenced by YACS::ENGINE::Bloc::fitToPlayGround().

Member Data Documentation

◆ _colour

YACS::Colour YACS::ENGINE::Node::_colour
mutable

◆ _errorDetails

◆ _eventReceiver

Node* YACS::ENGINE::Node::_eventReceiver =nullptr
protected

Definition at line 99 of file Node.hxx.

Referenced by Node(), and sendEvent().

◆ _father

ComposedNode* YACS::ENGINE::Node::_father
protected

Definition at line 90 of file Node.hxx.

Referenced by YACS::ENGINE::OutPort::calculateHistoryOfLinkWith(), YACS::ENGINE::DynParaLoop::checkConsistencyAndSetNode(), YACS::ENGINE::ComposedNode::checkInMyDescendance(), YACS::ENGINE::DFToDSForLoop::DFToDSForLoop(), YACS::ENGINE::DSToDFForLoop::DSToDFForLoop(), YACS::ENGINE::Bloc::edAddChild(), YACS::ENGINE::ComposedNode::edAddLink(), YACS::ENGINE::ComposedNode::edRemoveChild(), YACS::ENGINE::ComposedNode::edRemoveLink(), YACS::ENGINE::Switch::edSetNode(), YACS::ENGINE::Loop::edSetNode(), YACS::ENGINE::FakeNodeForForEachLoop::FakeNodeForForEachLoop(), YACS::ENGINE::FakeNodeForLoop::FakeNodeForLoop(), YACS::ENGINE::FakeNodeForOptimizerLoop::FakeNodeForOptimizerLoop(), YACS::ENGINE::FakeNodeForSwitch::FakeNodeForSwitch(), getAllAscendanceOf(), YACS::ENGINE::ComposedNode::getChildName(), getClosestDPLAmongAncestors(), YACS::ENGINE::ElementaryNode::getDynClonerIfExists(), getEffectiveState(), YACS::ENGINE::ComposedNode::getLowestCommonAncestor(), YACS::ENGINE::ComposedNode::getPortName(), getProc(), getProperties(), getProperty(), getQualifiedName(), YACS::ENGINE::ElementaryNode::getReadyTasks(), YACS::ENGINE::ComposedNode::getRootNode(), getRootNode(), YACS::ENGINE::ComposedNode::isInMyDescendance(), modified(), YACS::ENGINE::ComposedNode::notifyFrom(), operator<(), operator>(), YACS::ENGINE::SplitterNode::putSplittedValueOnRankTo(), YACS::ENGINE::ServiceNode::setComponent(), setName(), and YACS::ENGINE::SplitterNode::SplitterNode().

◆ _implementation

◆ _inGate

◆ _inPropertyPort

InPropertyPort* YACS::ENGINE::Node::_inPropertyPort
protected

Definition at line 88 of file Node.hxx.

Referenced by getInPropertyPort(), getInputPort(), Node(), and ~Node().

◆ _modified

◆ _name

◆ _numId

int YACS::ENGINE::Node::_numId
protected

Definition at line 96 of file Node.hxx.

Referenced by getNumId(), and Node().

◆ _outGate

OutGate YACS::ENGINE::Node::_outGate
protected

◆ _propertyMap

◆ _state

YACS::StatesForNode YACS::ENGINE::Node::_state
protected

◆ _total

int Node::_total = 0
staticprotected

Definition at line 95 of file Node.hxx.

Referenced by Node().

◆ idMap

◆ SEP_CHAR_IN_PORT


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