Version: 9.16.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 releaseData () override
 
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)
 
InputPortclone (Node *newHelder) const
 
std::string dump ()
 
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
 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 void exSaveInit ()=0
 
virtual void exRestoreInit ()=0
 
virtual InputPortclone (Node *newHelder) const =0
 
virtual bool isEmpty ()
 
virtual void * get () const =0
 
virtual void releaseData ()=0
 
virtual void put (const void *data)=0
 
virtual std::string dump ()
 
virtual std::string getHumanRepr ()
 
virtual void setStringRef (std::string strRef)
 
virtual std::string typeName ()
 
bool canBeNull () const
 
- Public Member Functions inherited from YACS::ENGINE::DataFlowPort
std::string getNameOfTypeOfCurrentInstance () const
 
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 typeName ()
 
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)
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual TypeOfChannel getTypeOfChannel () const =0
 returns type of channel the port will use for data exchange on runtime : DATAFLOW or DATASTREAM. More...
 
bool isDifferentTypeOf (const DataPort *other) const
 
virtual void edRemoveAllLinksLinkedWithMe ()=0
 
virtual std::string typeName ()
 
virtual std::string getAsString ()
 returns port value as a string that can be used in a GUI for example More...
 
- Public Member Functions inherited from YACS::ENGINE::Port
virtual ~Port ()
 
NodegetNode () const
 
virtual std::string getNameOfTypeOfCurrentInstance () const
 
int getNumId () const
 
virtual std::string typeName ()
 
void modified ()
 
- Public Member Functions inherited from YACS::ENGINE::InPort
virtual InPortgetPublicRepresentant ()
 
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...
 
bool canSafelySqueezeMemory () const
 
bool isBackLinked () const
 
virtual ~InPort ()
 
virtual std::string typeName ()
 

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 ForEachLoopGen
 
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"
 
- Static Public Attributes inherited from YACS::ENGINE::DataFlowPort
static const char NAME [] ="DataFlowPort"
 
- Static Public Attributes inherited from YACS::ENGINE::DataPort
static const char NAME [] ="DataPort"
 
- Protected Member Functions inherited from YACS::ENGINE::AnyInputPort
void releaseDataUnsafe ()
 
- 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)
 
void releaseDataUnsafe ()
 
- Protected Member Functions inherited from YACS::ENGINE::DataFlowPort
 DataFlowPort (const DataFlowPort &other, Node *newHelder)
 
 DataFlowPort (const std::string &name, Node *node, TypeCode *type)
 
- Protected Member Functions inherited from YACS::ENGINE::DataPort
virtual ~DataPort ()
 
 DataPort (const DataPort &other, Node *newHelder)
 
 DataPort (const std::string &name, Node *node, TypeCode *type)
 
- Protected Member Functions inherited from YACS::ENGINE::Port
 Port (Node *node)
 
 Port (const Port &other, Node *newHelder)
 
- Protected Member Functions inherited from YACS::ENGINE::InPort
 InPort (const InPort &other, Node *newHelder)
 
 InPort (const std::string &name, Node *node, TypeCode *type)
 
void edRemoveAllLinksLinkedWithMe ()
 
virtual void edNotifyReferencedBy (OutPort *fromPort, bool isLoopProof=true)
 
virtual void edNotifyDereferencedBy (OutPort *fromPort)
 
virtual void getAllRepresentants (std::set< InPort * > &repr) const
 
- Protected Attributes inherited from YACS::ENGINE::AnyInputPort
Any_value
 
- Protected Attributes inherited from YACS::ENGINE::InputPort
Any_initValue
 
std::string _stringRef
 
bool _canBeNull
 
- Protected Attributes inherited from YACS::ENGINE::DataPort
TypeCode_type
 
std::string _name
 
- Protected Attributes inherited from YACS::ENGINE::Port
Node_node
 
int _id
 
- Protected Attributes inherited from YACS::ENGINE::InPort
std::set< std::pair< OutPort *, bool > > _backLinks
 
- 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() [1/2]

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

Definition at line 147 of file ForEachLoop.cxx.

147 :AnyInputPort(name,node,type),DataPort(name,node,type),Port(node)
148{
149 _type->decrRef();
150}
AnyInputPort(const std::string &name, Node *node, TypeCode *type, bool canBeNull=false)
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
Port(Node *node)
Definition: Port.cxx:34

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

Referenced by clone().

◆ SeqAnyInputPort() [2/2]

SeqAnyInputPort::SeqAnyInputPort ( const SeqAnyInputPort other,
Node newHelder 
)
private

Definition at line 152 of file ForEachLoop.cxx.

152 :AnyInputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
153{
154}

Member Function Documentation

◆ clone()

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

Reimplemented from YACS::ENGINE::AnyInputPort.

Definition at line 156 of file ForEachLoop.cxx.

157{
158 return new SeqAnyInputPort(*this,newHelder);
159}
SeqAnyInputPort(const std::string &name, Node *node, TypeCodeSeq *type)

References SeqAnyInputPort().

◆ dump()

std::string SeqAnyInputPort::dump ( )
virtual

Reimplemented from YACS::ENGINE::AnyInputPort.

Definition at line 176 of file ForEachLoop.cxx.

177{
178 stringstream xmldump;
179 int nbElem = getNumberOfElements();
180 xmldump << "<value><array><data>" << endl;
181 for (int i = 0; i < nbElem; i++)
182 {
183 Any *val = getValueAtRank(i);
184 switch (((YACS::ENGINE::TypeCodeSeq *)edGetType())->contentType()->kind())
185 {
186 case Double:
187 xmldump << "<value><double>" << setprecision(16) << val->getDoubleValue() << "</double></value>" << endl;
188 break;
189 case Int:
190 xmldump << "<value><int>" << val->getIntValue() << "</int></value>" << endl;
191 break;
192 case Bool:
193 xmldump << "<value><boolean>" << val->getBoolValue() << "</boolean></value>" << endl;
194 break;
195 case String:
196 xmldump << "<value><string>" << val->getStringValue() << "</string></value>" << endl;
197 break;
198 case Objref:
199 xmldump << "<value><objref>" << ToBase64(val->getStringValue()) << "</objref></value>" << endl;
200 break;
201 default:
202 xmldump << "<value><error> NO_SERIALISATION_AVAILABLE </error></value>" << endl;
203 break;
204 }
205 }
206 xmldump << "</data></array></value>" << endl;
207 return xmldump.str();
208}
: Interface for management of storage of data formated dynamically in its TypeCode....
Definition: Any.hxx:79
virtual std::string getStringValue() const =0
virtual int getIntValue() const =0
virtual double getDoubleValue() const =0
virtual bool getBoolValue() const =0
TypeCode * edGetType() const
Definition: DataPort.hxx:53
Any * getValueAtRank(int i) const
unsigned getNumberOfElements() const
Class for sequence objects.
Definition: TypeCode.hxx:160
YACSLIBENGINE_EXPORT std::string ToBase64(const std::string &bytes)
Definition: Any.cxx:85

References YACS::ENGINE::Bool, YACS::ENGINE::Double, YACS::ENGINE::DataPort::edGetType(), YACS::ENGINE::Any::getBoolValue(), YACS::ENGINE::Any::getDoubleValue(), YACS::ENGINE::Any::getIntValue(), getNumberOfElements(), YACS::ENGINE::Any::getStringValue(), getValueAtRank(), yacsorb.CORBAEngineTest::i, YACS::ENGINE::Int, YACS::ENGINE::Objref, YACS::ENGINE::String, and YACS::ENGINE::ToBase64().

◆ getNumberOfElements()

unsigned SeqAnyInputPort::getNumberOfElements ( ) const

Definition at line 161 of file ForEachLoop.cxx.

162{
163 const SequenceAny * valCsted=(const SequenceAny *) _value;
164 if (valCsted) return valCsted->size();
165 return 0;
166}
unsigned int size() const
Definition: Any.hxx:209

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

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

◆ getValueAtRank()

Any * SeqAnyInputPort::getValueAtRank ( int  i) const
private

Definition at line 168 of file ForEachLoop.cxx.

169{
170 const SequenceAny * valCsted=(const SequenceAny *) _value;
171 AnyPtr ret=(*valCsted)[i];
172 ret->incrRef();
173 return ret;
174}
: Allow to manage memory of instances of T. The only constraint on T is to have method incrRef and De...
Definition: SharedPtr.hxx:30

References YACS::ENGINE::AnyInputPort::_value, and yacsorb.CORBAEngineTest::i.

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

Friends And Related Function Documentation

◆ ForEachLoopGen

friend class ForEachLoopGen
friend

Definition at line 77 of file ForEachLoop.hxx.

◆ SplitterNode

friend class SplitterNode
friend

Definition at line 78 of file ForEachLoop.hxx.


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