Version: 8.3.0
YACS::ENGINE::SeqAnyInputPort Class Reference

#include <ForEachLoop.hxx>

Inheritance diagram for YACS::ENGINE::SeqAnyInputPort:
Collaboration diagram for YACS::ENGINE::SeqAnyInputPort:

Public Member Functions

unsigned getNumberOfElements () const
 
virtual std::string dump ()
 
- Public Member Functions inherited from YACS::ENGINE::AnyInputPort
 AnyInputPort (const std::string &name, Node *node, TypeCode *type, bool canBeNull=false)
 
 AnyInputPort (const AnyInputPort &other, Node *newHelder)
 
virtual ~AnyInputPort ()
 
void exSaveInit ()
 Save the current data value for further reinitialization of the port. More...
 
void exRestoreInit ()
 Restore the saved data value to current data value. More...
 
AnygetValue () const
 
int getIntValue () const
 
void put (Any *data)
 
void * get () const
 
virtual std::string getAsString ()
 returns port value as a string that can be used in a GUI for example More...
 
virtual bool isEmpty ()
 
void put (const void *data) throw (ConversionException)
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::InputPort
virtual ~InputPort ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual InputPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
virtual bool isIntermediate () const
 
virtual bool edIsManuallyInitialized () const
 Specifies if this port has been manually set by the call of InputPort::edInit. More...
 
bool edIsInitialized () const
 soon deprecated More...
 
template<class T >
void edInit (T value)
 
void edInit (Any *value)
 
void edInit (const std::string &impl, const void *value)
 Initialize the port with an object (value) coming from a world with implementation impl. More...
 
virtual void edRemoveManInit ()
 Removes eventually previous manual initialisation. More...
 
virtual void checkBasicConsistency () const throw (Exception)
 Check basically that this port has one chance to be specified on time. It's a necessary condition not sufficient at all. More...
 
virtual void exInit (bool start)
 
virtual std::string getHumanRepr ()
 
virtual void setStringRef (std::string strRef)
 
bool canBeNull () const
 
- Public Member Functions inherited from YACS::ENGINE::DataFlowPort
TypeOfChannel getTypeOfChannel () const
 returns type of channel the port will use for data exchange on runtime : DATAFLOW or DATASTREAM. More...
 
virtual ~DataFlowPort ()
 
virtual std::string valToStr ()
 Gives a string representation of the data, for user interfaces. More...
 
virtual void valFromStr (std::string valstr)
 Allows to set data from a string representation used in user interface. More...
 
- Public Member Functions inherited from YACS::ENGINE::DataPort
TypeCodeedGetType () const
 
void edSetType (TypeCode *type)
 
std::string getName () const
 
void setName (std::string theName)
 
bool isDifferentTypeOf (const DataPort *other) const
 
- Public Member Functions inherited from YACS::ENGINE::Port
virtual ~Port ()
 
NodegetNode () const
 
int getNumId () const
 
void modified ()
 
- Public Member Functions inherited from YACS::ENGINE::InPort
virtual int edGetNumberOfLinks () const
 Returns number of physical backlinks NOT number of user backlinks. More...
 
virtual std::set< OutPort * > edSetOutPort () const
 Returns physical backlinks NOT user backlinks. More...
 
virtual ~InPort ()
 

Private Member Functions

 SeqAnyInputPort (const std::string &name, Node *node, TypeCodeSeq *type)
 
 SeqAnyInputPort (const SeqAnyInputPort &other, Node *newHelder)
 
InputPortclone (Node *newHelder) const
 
AnygetValueAtRank (int i) const
 

Friends

class ForEachLoop
 
class SplitterNode
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::DataPort
static DataPortisCrossingType (const std::vector< DataPort * > &historyOfLink)
 
- Static Public Attributes inherited from YACS::ENGINE::InputPort
static const char NAME [] ="InputPort"
 
- Protected Member Functions inherited from YACS::ENGINE::InputPort
 InputPort (const InputPort &other, Node *newHelder)
 
 InputPort (const std::string &name, Node *node, TypeCode *type, bool canBeNull=false)
 
- Protected Attributes inherited from YACS::ENGINE::AnyInputPort
Any_value
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

Definition at line 75 of file ForEachLoop.hxx.

Constructor & Destructor Documentation

SeqAnyInputPort::SeqAnyInputPort ( const std::string &  name,
Node node,
TypeCodeSeq type 
)
private

Definition at line 142 of file ForEachLoop.cxx.

References YACS::ENGINE::DataPort::_type, and YACS::ENGINE::RefCounter::decrRef().

Referenced by clone().

142  :AnyInputPort(name,node,type),DataPort(name,node,type),Port(node)
143 {
144  _type->decrRef();
145 }
SeqAnyInputPort::SeqAnyInputPort ( const SeqAnyInputPort other,
Node newHelder 
)
private

Definition at line 147 of file ForEachLoop.cxx.

147  :AnyInputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
148 {
149 }

Member Function Documentation

InputPort * SeqAnyInputPort::clone ( Node newHelder) const
privatevirtual

Reimplemented from YACS::ENGINE::AnyInputPort.

Definition at line 151 of file ForEachLoop.cxx.

References SeqAnyInputPort().

152 {
153  return new SeqAnyInputPort(*this,newHelder);
154 }
std::string SeqAnyInputPort::dump ( )
virtual

Reimplemented from YACS::ENGINE::AnyInputPort.

Definition at line 171 of file ForEachLoop.cxx.

References YACS::ENGINE::Bool, YACS::ENGINE::Double, YACS::ENGINE::Any::getBoolValue(), YACS::ENGINE::Any::getDoubleValue(), YACS::ENGINE::Any::getIntValue(), getNumberOfElements(), YACS::ENGINE::Any::getStringValue(), YACS::ENGINE::Any::getType(), getValueAtRank(), CORBAEngineTest::i, YACS::ENGINE::Int, YACS::ENGINE::TypeCode::kind(), YACS::ENGINE::Objref, and YACS::ENGINE::String.

172 {
173  stringstream xmldump;
174  int nbElem = getNumberOfElements();
175  xmldump << "<value><array><data>" << endl;
176  for (int i = 0; i < nbElem; i++)
177  {
178  Any *val = getValueAtRank(i);
179  switch (val->getType()->kind())
180  {
181  case Double:
182  xmldump << "<value><double>" << setprecision(16) << val->getDoubleValue() << "</double></value>" << endl;
183  break;
184  case Int:
185  xmldump << "<value><int>" << val->getIntValue() << "</int></value>" << endl;
186  break;
187  case Bool:
188  xmldump << "<value><boolean>" << val->getBoolValue() << "</boolean></value>" << endl;
189  break;
190  case String:
191  xmldump << "<value><string>" << val->getStringValue() << "</string></value>" << endl;
192  break;
193  case Objref:
194  xmldump << "<value><objref>" << val->getStringValue() << "</objref></value>" << endl;
195  break;
196  default:
197  xmldump << "<value><error> NO_SERIALISATION_AVAILABLE </error></value>" << endl;
198  break;
199  }
200  }
201  xmldump << "</data></array></value>" << endl;
202  return xmldump.str();
203 }
unsigned SeqAnyInputPort::getNumberOfElements ( ) const

Definition at line 156 of file ForEachLoop.cxx.

References YACS::ENGINE::AnyInputPort::_value, and YACS::ENGINE::SequenceAny::size().

Referenced by dump(), and YACS::ENGINE::SplitterNode::getNumberOfElements().

157 {
158  const SequenceAny * valCsted=(const SequenceAny *) _value;
159  if (valCsted) return valCsted->size();
160  return 0;
161 }
Any * SeqAnyInputPort::getValueAtRank ( int  i) const
private

Definition at line 163 of file ForEachLoop.cxx.

References YACS::ENGINE::AnyInputPort::_value, CORBAEngineTest::i, and PMMLBasicsTestLauncher::ret.

Referenced by dump(), and YACS::ENGINE::SplitterNode::putSplittedValueOnRankTo().

164 {
165  const SequenceAny * valCsted=(const SequenceAny *) _value;
166  AnyPtr ret=(*valCsted)[i];
167  ret->incrRef();
168  return ret;
169 }

Friends And Related Function Documentation

friend class ForEachLoop
friend

Definition at line 77 of file ForEachLoop.hxx.

friend class SplitterNode
friend

Definition at line 78 of file ForEachLoop.hxx.


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