Version: 9.15.0
YACS::ENGINE::ProxyPort Class Reference

Base class for Proxy Input Ports. More...

#include <InputPort.hxx>

Inheritance diagram for YACS::ENGINE::ProxyPort:
Collaboration diagram for YACS::ENGINE::ProxyPort:

Public Member Functions

 ProxyPort (InputPort *p)
 
 ~ProxyPort ()
 
void edRemoveAllLinksLinkedWithMe ()
 
InputPortclone (Node *newHelder) const
 
void edNotifyReferencedBy (OutPort *fromPort, bool isLoopProof=true) override
 
void edNotifyDereferencedBy (OutPort *fromPort)
 
std::set< OutPort * > edSetOutPort () const
 Returns physical backlinks NOT user backlinks. More...
 
InputPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
void * get () const
 
virtual void put (const void *data)
 
void releaseData () override
 
int edGetNumberOfLinks () const
 Returns number of physical backlinks NOT number of user backlinks. More...
 
bool isIntermediate () const
 
void exRestoreInit ()
 
void exSaveInit ()
 
void getAllRepresentants (std::set< InPort * > &repr) const
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::InputPort
virtual ~InputPort ()
 
std::string getNameOfTypeOfCurrentInstance () 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 bool isEmpty ()
 
virtual std::string dump ()
 
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
 
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
 
int getNumId () const
 
void modified ()
 
- Public Member Functions inherited from YACS::ENGINE::InPort
bool canSafelySqueezeMemory () const
 
bool isBackLinked () const
 
virtual ~InPort ()
 

Protected Attributes

InputPort_port
 
- 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
 

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::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)
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

Base class for Proxy Input Ports.

Definition at line 99 of file InputPort.hxx.

Constructor & Destructor Documentation

◆ ProxyPort()

ProxyPort::ProxyPort ( InputPort p)

Definition at line 179 of file InputPort.cxx.

179  :InputPort("Convertor", p->getNode(), p->edGetType()),DataPort("Convertor", p->getNode(), p->edGetType()),
180  Port( p->getNode())
181 {
182  _port = p;
183 }
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
InputPort(const InputPort &other, Node *newHelder)
Definition: InputPort.cxx:36
Port(Node *node)
Definition: Port.cxx:34
Proc * p
Definition: driver.cxx:216

References _port, and p.

◆ ~ProxyPort()

ProxyPort::~ProxyPort ( )

Definition at line 185 of file InputPort.cxx.

186 {
187  //For the moment, there is no case in YACS we have a proxy port in a proxy port
188  //So don't test that. _port may be already deleted. The test is not sure.
189  /*
190  if(_port->isIntermediate())
191  delete _port;
192  */
193 }

Member Function Documentation

◆ clone()

InputPort * ProxyPort::clone ( Node newHelder) const
virtual
Note
: Should never been called because Node clone process does not duplicate data attributes relative to links. This part is done afterwards on relink process.

Implements YACS::ENGINE::InputPort.

Definition at line 204 of file InputPort.cxx.

205 {
206  throw Exception("ProxyPort::clone : internal error - should never happened");
207 }

◆ edGetNumberOfLinks()

int ProxyPort::edGetNumberOfLinks ( ) const
virtual

Returns number of physical backlinks NOT number of user backlinks.

Reimplemented from YACS::ENGINE::InPort.

Definition at line 224 of file InputPort.cxx.

225 {
226  return _port->edGetNumberOfLinks();
227 }
virtual int edGetNumberOfLinks() const
Returns number of physical backlinks NOT number of user backlinks.
Definition: InPort.cxx:45

References _port, and YACS::ENGINE::InPort::edGetNumberOfLinks().

◆ edNotifyDereferencedBy()

void ProxyPort::edNotifyDereferencedBy ( OutPort fromPort)
virtual

Reimplemented from YACS::ENGINE::InPort.

Definition at line 214 of file InputPort.cxx.

215 {
216  _port->edNotifyDereferencedBy(fromPort);
217 }
virtual void edNotifyDereferencedBy(OutPort *fromPort)
Definition: InPort.cxx:102

References _port, and YACS::ENGINE::InPort::edNotifyDereferencedBy().

◆ edNotifyReferencedBy()

void ProxyPort::edNotifyReferencedBy ( OutPort fromPort,
bool  isLoopProof = true 
)
overridevirtual
Parameters
[in]isLoopProof- Tells if the data coming from fromPort will be send again in case of this is initialized. This value is important if this is an InPort of a Node contained directly or not inside a Loop, ForEachLoop, OptimizerLoop. In this case, to optimize memory consumption (see squeezeMemory method), we need to know if data coming from fromPort will be generated again in case. If true (the default) it means that for that link is a link loop proof so no need to take care. If false, the link is not loop proof so event in the context of agressive memory management the data can't be safely released.

Reimplemented from YACS::ENGINE::InPort.

Definition at line 209 of file InputPort.cxx.

210 {
211  _port->edNotifyReferencedBy(fromPort,isLoopProof);
212 }
virtual void edNotifyReferencedBy(OutPort *fromPort, bool isLoopProof=true)
Definition: InPort.cxx:93

References _port, and YACS::ENGINE::InPort::edNotifyReferencedBy().

◆ edRemoveAllLinksLinkedWithMe()

void ProxyPort::edRemoveAllLinksLinkedWithMe ( )
virtual

Reimplemented from YACS::ENGINE::InPort.

Definition at line 195 of file InputPort.cxx.

196 {
198 }
void edRemoveAllLinksLinkedWithMe()
Definition: InPort.cxx:50

References _port, and YACS::ENGINE::InPort::edRemoveAllLinksLinkedWithMe().

◆ edSetOutPort()

std::set< OutPort * > ProxyPort::edSetOutPort ( ) const
virtual

Returns physical backlinks NOT user backlinks.

Reimplemented from YACS::ENGINE::InPort.

Definition at line 219 of file InputPort.cxx.

220 {
221  return _port->edSetOutPort();
222 }
virtual std::set< OutPort * > edSetOutPort() const
Returns physical backlinks NOT user backlinks.
Definition: InPort.cxx:65

References _port, and YACS::ENGINE::InPort::edSetOutPort().

◆ exRestoreInit()

void ProxyPort::exRestoreInit ( )
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 229 of file InputPort.cxx.

230 {
231  _port->exRestoreInit();
232 }
virtual void exRestoreInit()=0

References _port, and YACS::ENGINE::InputPort::exRestoreInit().

◆ exSaveInit()

void ProxyPort::exSaveInit ( )
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 234 of file InputPort.cxx.

235 {
236  _port->exSaveInit();
237 }
virtual void exSaveInit()=0

References _port, and YACS::ENGINE::InputPort::exSaveInit().

◆ get()

void * ProxyPort::get ( ) const
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 248 of file InputPort.cxx.

249 {
250  return _port->get();
251 }
virtual void * get() const =0

References _port, and YACS::ENGINE::InputPort::get().

◆ getAllRepresentants()

void ProxyPort::getAllRepresentants ( std::set< InPort * > &  repr) const
virtual

Reimplemented from YACS::ENGINE::InPort.

Definition at line 263 of file InputPort.cxx.

264 {
265  DEBTRACE("ProxyPort::getAllRepresentants");
266  _port->getAllRepresentants(repr);
267 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual void getAllRepresentants(std::set< InPort * > &repr) const
Definition: InPort.cxx:110

References _port, DEBTRACE, and YACS::ENGINE::InPort::getAllRepresentants().

◆ getPublicRepresentant()

InputPort * ProxyPort::getPublicRepresentant ( )
virtual

returns the final physical port behind 'this'.

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 242 of file InputPort.cxx.

244 {
245  return _port->getPublicRepresentant();
246 }
virtual InputPort * getPublicRepresentant()
returns the final physical port behind 'this'.
Definition: InputPort.hxx:57

References YACS::ENGINE::InputPort::getPublicRepresentant().

◆ isIntermediate()

bool YACS::ENGINE::ProxyPort::isIntermediate ( ) const
inlinevirtual

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 119 of file InputPort.hxx.

119 { return true; }

◆ put()

void ProxyPort::put ( const void *  data)
virtual

Implements YACS::ENGINE::InputPort.

Reimplemented in YACS::ENGINE::XmlPython, YACS::ENGINE::XmlNeutral, YACS::ENGINE::XmlCpp, YACS::ENGINE::XmlCorba, YACS::ENGINE::PyXml, YACS::ENGINE::PyNeutral, YACS::ENGINE::PyInit, YACS::ENGINE::PyCpp, YACS::ENGINE::PyCorbaStruct, YACS::ENGINE::PyCorbaSequence, YACS::ENGINE::PyCorbaObjref, YACS::ENGINE::PyCorbaBool, YACS::ENGINE::PyCorbaString, YACS::ENGINE::PyCorbaDouble, YACS::ENGINE::PyCorbaInt, YACS::ENGINE::NeutralXml, YACS::ENGINE::NeutralPyStruct, YACS::ENGINE::NeutralPySequence, YACS::ENGINE::NeutralPyObjref, YACS::ENGINE::NeutralPyBool, YACS::ENGINE::NeutralPyString, YACS::ENGINE::NeutralPyInt, YACS::ENGINE::NeutralPyDouble, YACS::ENGINE::NeutralInit, YACS::ENGINE::NeutralCpp, YACS::ENGINE::NeutralCorbaStruct, YACS::ENGINE::NeutralCorbaObjref, YACS::ENGINE::NeutralCorbaString, YACS::ENGINE::NeutralCorbaSequence, YACS::ENGINE::NeutralCorbaBool, YACS::ENGINE::NeutralCorbaDouble, YACS::ENGINE::NeutralCorbaInt, YACS::ENGINE::CppXml, YACS::ENGINE::CppPy, YACS::ENGINE::CppNeutral, YACS::ENGINE::CppCpp, YACS::ENGINE::CppCorba, YACS::ENGINE::CorbaXml, YACS::ENGINE::CorbaPyStruct, YACS::ENGINE::CorbaPySequence, YACS::ENGINE::CorbaPyObjref, YACS::ENGINE::CorbaPyBool, YACS::ENGINE::CorbaPyString, YACS::ENGINE::CorbaPyInt, YACS::ENGINE::CorbaPyDouble, YACS::ENGINE::CorbaNeutral, YACS::ENGINE::CorbaCpp, and YACS::ENGINE::CorbaCorba.

Definition at line 258 of file InputPort.cxx.

259 {
260  _port->put(data);
261 }
virtual void put(const void *data)=0

References _port, and YACS::ENGINE::InputPort::put().

◆ releaseData()

void ProxyPort::releaseData ( )
overridevirtual

Implements YACS::ENGINE::InputPort.

Definition at line 253 of file InputPort.cxx.

254 {
255  _port->releaseData();
256 }
virtual void releaseData()=0

References _port, and YACS::ENGINE::InputPort::releaseData().

◆ typeName()

virtual std::string YACS::ENGINE::ProxyPort::typeName ( )
inlinevirtual

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 123 of file InputPort.hxx.

123 {return "YACS__ENGINE__ProxyPort";}

Member Data Documentation

◆ _port


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