Version: 9.16.0
YACS::ENGINE::OutNode Class Reference

Class for data out node. More...

#include <OutNode.hxx>

Inheritance diagram for YACS::ENGINE::OutNode:
Collaboration diagram for YACS::ENGINE::OutNode:

Public Member Functions

 OutNode (const std::string &name)
 
 OutNode (const OutNode &other, ComposedNode *father)
 
virtual void execute ()
 
virtual void accept (Visitor *visitor)
 
virtual void checkBasicConsistency () const
 
virtual void setData (InputPort *port, const std::string &data)
 
virtual void dump (std::ostream &os)
 
virtual InputPort * createInputPort (const std::string &inputPortName, TypeCode *type)
 
- Public Member Functions inherited from YACS::ENGINE::DataNode
virtual void setData (InputPort *port, const std::string &data)
 
virtual void setData (OutputPort *port, const std::string &data)
 
virtual void setRef (const std::string &ref)
 
virtual std::string getRef ()
 
virtual ~DataNode ()
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::ElementaryNode
virtual ~ElementaryNode ()
 
void exUpdateState ()
 Update the node state. More...
 
void init (bool start=true)
 
bool isDeployable () const
 
ComponentInstance * getComponent ()
 
const ComponentInstance * getComponent () const
 
Container * getContainer ()
 
YACS::StatesForNode getState () const
 
void getReadyTasks (std::vector< Task * > &tasks)
 
void edRemovePort (Port *port)
 
std::list< ElementaryNode * > getRecursiveConstituents () const
 
std::list< ProgressWeight > getProgressWeight () const
 Get the progress weight for all elementary nodes. More...
 
Node * getChildByName (const std::string &name) const
 
virtual void checkBasicConsistency () const
 
ComposedNode * getDynClonerIfExists (const ComposedNode *levelToStop) const
 
int getNumberOfInputPorts () const
 
int getNumberOfOutputPorts () const
 
std::string getInPortName (const InPort *) const
 
std::string getOutPortName (const OutPort *) const
 
InputPort * getInputPort (const std::string &name) const
 
OutputPort * getOutputPort (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
 
InputDataStreamPort * getInputDataStreamPort (const std::string &name) const
 
OutputDataStreamPort * getOutputDataStreamPort (const std::string &name) const
 
virtual InputPort * createInputPort (const std::string &inputPortName, TypeCode *type)
 
virtual OutputPort * createOutputPort (const std::string &outputPortName, TypeCode *type)
 
virtual InputDataStreamPort * createInputDataStreamPort (const std::string &inputPortDSName, TypeCode *type)
 
virtual OutputDataStreamPort * createOutputDataStreamPort (const std::string &outputPortDSName, TypeCode *type)
 
virtual InputPort * edAddInputPort (const std::string &inputPortName, TypeCode *type)
 
virtual OutputPort * edAddOutputPort (const std::string &outputPortName, TypeCode *type)
 
virtual InputDataStreamPort * edAddInputDataStreamPort (const std::string &inputPortDSName, TypeCode *type)
 
virtual OutputDataStreamPort * edAddOutputDataStreamPort (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
 
ComplexWeight * getWeight ()
 
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 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...
 
Node * clone (ComposedNode *father, bool editionOnly=true) const
 This method MUST NEVER BE VIRTUAL More...
 
Node * cloneWithoutCompAndContDeepCpy (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...
 
InGate * getInGate ()
 
OutGate * getOutGate ()
 
const std::string & getName () const
 
void setName (const std::string &name)
 Change the name of the node. More...
 
ComposedNode * getFather () 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< ProgressWeight > getProgressWeight () 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
 
InPort * getInPort (const std::string &name) const
 
InPropertyPort * getInPropertyPort () const
 
virtual OutPort * getOutPort (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 InputPort * getInputPort (const std::string &name) const
 
virtual OutputPort * getOutputPort (const std::string &name) const =0
 
virtual InputDataStreamPort * getInputDataStreamPort (const std::string &name) const =0
 
virtual OutputDataStreamPort * getOutputDataStreamPort (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
 
DynParaLoop * getClosestDPLAmongAncestors () const
 
virtual ComposedNode * getRootNode () 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 Node * getChildByName (const std::string &name) const =0
 
virtual Proc * getProc ()
 
virtual const Proc * getProc () 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...
 
- Public Member Functions inherited from YACS::ENGINE::Task
virtual void begin ()=0
 
virtual bool isReady ()=0
 
virtual void execute ()=0
 
virtual void load ()=0
 
virtual void loaded ()=0
 
virtual void connected ()=0
 
virtual void initService ()=0
 
virtual void connectService ()=0
 
virtual void disconnectService ()=0
 
virtual void getCoupledTasks (std::set< Task * > &coupledSet)=0
 
virtual bool isDeployable () const =0
 
virtual ComponentInstance * getComponent ()=0
 
virtual const ComponentInstance * getComponent () const =0
 
virtual Container * getContainer ()=0
 
virtual YACS::StatesForNode getState () const =0
 
virtual void finished ()=0
 
virtual void aborted ()=0
 
virtual void imposeResource (const std::string &resource_name, const std::string &container_name)
 
virtual bool canAcceptImposedResource ()
 
virtual bool hasImposedResource () const
 
virtual ~Task ()
 

Static Public Attributes

static const char IMPL_NAME [] ="XML"
 
- Static Public Attributes inherited from YACS::ENGINE::Node
static std::map< int, Node * > idMap
 

Protected Member Functions

Node * simpleClone (ComposedNode *father, bool editionOnly) const
 
- Protected Member Functions inherited from YACS::ENGINE::DataNode
 DataNode (const DataNode &other, ComposedNode *father)
 
 DataNode (const std::string &name)
 
- Protected Member Functions inherited from YACS::ENGINE::ElementaryNode
 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 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 Node * simpleClone (ComposedNode *father, bool editionOnly=true) const =0
 
virtual void exForwardFailed ()
 
virtual void exForwardFinished ()
 
virtual void edDisconnectAllLinksWithMe ()
 

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 Protected Member Functions inherited from YACS::ENGINE::ElementaryNode
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 ComposedNode * checkHavingCommonFather (Node *node1, Node *node2)
 
- Protected Attributes inherited from YACS::ENGINE::DataNode
std::string _ref
 
- Protected Attributes inherited from YACS::ENGINE::ElementaryNode
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
 
- Static Protected Attributes inherited from YACS::ENGINE::Node
static const char SEP_CHAR_IN_PORT [] ="."
 
static int _total = 0
 

Detailed Description

Class for data out node.

Definition at line 29 of file OutNode.hxx.

Constructor & Destructor Documentation

◆ OutNode() [1/2]

YACS::ENGINE::OutNode::OutNode ( const std::string &  name)

Definition at line 47 of file OutNode.cxx.

48 : DataNode(name)
49{
51}
DataNode(const DataNode &other, ComposedNode *father)
Definition: DataNode.hxx:40
std::string _implementation
Definition: Node.hxx:97
static const char IMPL_NAME[]
Definition: OutNode.hxx:43

References YACS::ENGINE::Node::_implementation, and IMPL_NAME.

Referenced by simpleClone().

◆ OutNode() [2/2]

YACS::ENGINE::OutNode::OutNode ( const OutNode &  other,
ComposedNode *  father 
)

Definition at line 53 of file OutNode.cxx.

54 : DataNode(other, father)
55{
56}

Member Function Documentation

◆ accept()

void YACS::ENGINE::OutNode::accept ( Visitor *  visitor)
virtual

Reimplemented from YACS::ENGINE::ElementaryNode.

Definition at line 99 of file OutNode.cxx.

100{
101 visitor->visitOutNode(this);
102}

References YACS::ENGINE::Visitor::visitOutNode().

◆ checkBasicConsistency()

void YACS::ENGINE::OutNode::checkBasicConsistency ( ) const
virtual

Reimplemented from YACS::ENGINE::ElementaryNode.

Definition at line 110 of file OutNode.cxx.

111{
112 DEBTRACE("OutNode::checkBasicConsistency");
113 if (! _setOfOutputPort.empty())
114 {
115 string what = "OutNode ";
116 what += getName();
117 what += " only accepts InputPorts, no OutputPorts";
118 throw Exception(what);
119 }
120 list<InputPort *>::const_iterator iter;
121 for(iter=_setOfInputPort.begin();iter!=_setOfInputPort.end();iter++)
122 {
123 InputPresetPort *preset = dynamic_cast<InputPresetPort*>(*iter);
124 if (!preset)
125 {
126 string what("Input port: ");
127 what += (*iter)->getName();
128 what += " is not an InputPresetPort. PresetNode ";
129 what += getName();
130 what += " only accepts InputPresetPorts";
131 throw Exception(what);
132 }
133 preset->checkBasicConsistency();
134 }
135
136}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
std::list< InputPort * > _setOfInputPort
std::list< OutputPort * > _setOfOutputPort
const std::string & getName() const
Definition: Node.hxx:125

References YACS::ENGINE::ElementaryNode::_setOfInputPort, YACS::ENGINE::ElementaryNode::_setOfOutputPort, YACS::ENGINE::InputPort::checkBasicConsistency(), DEBTRACE, and YACS::ENGINE::Node::getName().

◆ createInputPort()

InputPort * YACS::ENGINE::OutNode::createInputPort ( const std::string &  inputPortName,
TypeCode *  type 
)
virtual

Reimplemented from YACS::ENGINE::ElementaryNode.

Definition at line 58 of file OutNode.cxx.

59{
60 return new InputPresetPort(inputPortName, this, type);
61}

◆ dump()

void YACS::ENGINE::OutNode::dump ( std::ostream &  os)
virtual

Definition at line 63 of file OutNode.cxx.

64{
65 std::list<InputPort *>::const_iterator iter;
66 for(iter = _setOfInputPort.begin(); iter != _setOfInputPort.end(); iter++)
67 {
68 InputPresetPort *inp = dynamic_cast<InputPresetPort *>(*iter);
69 if(inp->getData() != "")
70 {
71 //save the file in the given reference
72 std::string xmlValue=inp->dump();
73 std::string::size_type i=xmlValue.find_first_of('/',0);
74 xmlValue=xmlValue.substr(i);
75 i=xmlValue.find_first_of('<',0);
76 std::ifstream fin(xmlValue.substr(0,i).c_str());
77 std::ofstream fout(inp->getData().c_str());
78 fout << fin.rdbuf(); // Dumps file contents to file
79 out << "<value><objref>" << inp->getData() << "</objref></value>" << std::endl;
80 }
81 else
82 out << inp->dump() << std::endl;
83 }
84}

References YACS::ENGINE::ElementaryNode::_setOfInputPort, YACS::ENGINE::InputPresetPort::dump(), YACS::ENGINE::InputPresetPort::getData(), and yacsorb.CORBAEngineTest::i.

Referenced by execute().

◆ execute()

void YACS::ENGINE::OutNode::execute ( )
virtual

Implements YACS::ENGINE::Task.

Definition at line 86 of file OutNode.cxx.

87{
88 DEBTRACE("+++++++ OutNode::execute +++++++++++");
89 if(_ref != "")
90 {
91 std::ofstream out(_ref.c_str());
92 dump(out);
93 }
94 else
95 dump(std::cout);
96 DEBTRACE("+++++++ end OutNode::execute +++++++++++" );
97}
virtual void dump(std::ostream &os)
Definition: OutNode.cxx:63

References YACS::ENGINE::DataNode::_ref, DEBTRACE, and dump().

◆ setData()

void YACS::ENGINE::OutNode::setData ( InputPort *  port,
const std::string &  data 
)
virtual

Reimplemented from YACS::ENGINE::DataNode.

Definition at line 104 of file OutNode.cxx.

105{
106 InputPresetPort *inp = dynamic_cast<InputPresetPort *>(port);
107 inp->setData(data);
108}

References YACS::ENGINE::InputPresetPort::setData().

◆ simpleClone()

Node * YACS::ENGINE::OutNode::simpleClone ( ComposedNode *  father,
bool  editionOnly 
) const
protectedvirtual

Implements YACS::ENGINE::Node.

Definition at line 138 of file OutNode.cxx.

139{
140 return new OutNode(*this,father);
141}
OutNode(const std::string &name)
Definition: OutNode.cxx:47

References OutNode().

Member Data Documentation

◆ IMPL_NAME

const char YACS::ENGINE::OutNode::IMPL_NAME ="XML"
static

Definition at line 43 of file OutNode.hxx.

Referenced by OutNode().


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