Version: 9.15.0
YACS::ENGINE::OutputCppPort Class Reference

#include <CppPorts.hxx>

Inheritance diagram for YACS::ENGINE::OutputCppPort:
Collaboration diagram for YACS::ENGINE::OutputCppPort:

Public Member Functions

 OutputCppPort (const std::string &name, Node *node, TypeCode *type)
 
 OutputCppPort (const OutputCppPort &other, Node *newHelder)
 
 ~OutputCppPort ()
 
virtual void put (const void *data)
 
void put (YACS::ENGINE::Any *data)
 
OutputPortclone (Node *newHelder) const
 
virtual YACS::ENGINE::Anyget () const
 
virtual std::string dump ()
 
- Public Member Functions inherited from YACS::ENGINE::OutputPort
virtual ~OutputPort ()
 
std::set< InPort * > edSetInPort () const
 
bool isAlreadyLinkedWith (InPort *withp) const
 
bool isAlreadyInSet (InputPort *inputPort) const
 
bool isConnected () const
 
std::string getNameOfTypeOfCurrentInstance () const
 
int removeInPort (InPort *inPort, bool forward)
 
virtual bool edAddInputPort (InputPort *phyPort)
 
virtual bool edAddInPropertyPort (InPropertyPort *phyPort)
 
virtual int edRemoveInputPort (InputPort *inputPort, bool forward)
 
bool addInPort (InPort *inPort)
 
void edRemoveAllLinksLinkedWithMe ()
 
virtual void exInit ()
 
virtual void checkBasicConsistency () const
 Check validity of output port. Nothing on base class. More...
 
virtual std::string typeName ()
 
- 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::OutPort
virtual void checkConsistency (LinkInfo &info) const
 
virtual int edGetNumberOfOutLinks () const
 
virtual void getAllRepresented (std::set< OutPort * > &represented) const
 
virtual ~OutPort ()
 
std::vector< DataPort * > calculateHistoryOfLinkWith (InPort *end)
 

Protected Attributes

YACS::ENGINE::Any_data
 
- Protected Attributes inherited from YACS::ENGINE::OutputPort
std::set< InputPort * > _setOfInputPort
 
- Protected Attributes inherited from YACS::ENGINE::DataPort
TypeCode_type
 
std::string _name
 
- Protected Attributes inherited from YACS::ENGINE::Port
Node_node
 
int _id
 

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::OutputPort
static const char NAME [] ="OutputPort"
 
- 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::OutputPort
 OutputPort (const OutputPort &other, Node *newHelder)
 
 OutputPort (const std::string &name, Node *node, TypeCode *type)
 
const std::set< InputPort * > & getSetOfPhyLinks () const
 Returns physical links linked to this. Contrary to edSetInPort that returns semantic links. More...
 
- 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::OutPort
 OutPort (const OutPort &other, Node *newHelder)
 
 OutPort (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

Definition at line 62 of file CppPorts.hxx.

Constructor & Destructor Documentation

◆ OutputCppPort() [1/2]

OutputCppPort::OutputCppPort ( const std::string &  name,
Node node,
TypeCode type 
)

Definition at line 149 of file CppPorts.cxx.

150  : OutputPort(name, node, type), DataPort(name, node, type), Port(node)
151 {
152  _data = NULL;
153 }
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
YACS::ENGINE::Any * _data
Definition: CppPorts.hxx:74
OutputPort(const OutputPort &other, Node *newHelder)
Definition: OutputPort.cxx:38
Port(Node *node)
Definition: Port.cxx:34

References _data.

Referenced by clone().

◆ OutputCppPort() [2/2]

OutputCppPort::OutputCppPort ( const OutputCppPort other,
Node newHelder 
)

Definition at line 164 of file CppPorts.cxx.

164  :OutputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder),
165  _data(NULL)
166 {
167 }

◆ ~OutputCppPort()

OutputCppPort::~OutputCppPort ( )

Definition at line 155 of file CppPorts.cxx.

156 {
157  if(_data)
158  {
159  DEBTRACE("_data ref count: " << _data->getRefCnt());
160  _data->decrRef();
161  }
162 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
unsigned int getRefCnt() const
Definition: RefCounter.hxx:32

References _data, DEBTRACE, YACS::ENGINE::RefCounter::decrRef(), and YACS::ENGINE::RefCounter::getRefCnt().

Member Function Documentation

◆ clone()

OutputPort * OutputCppPort::clone ( Node newHelder) const
virtual

Implements YACS::ENGINE::OutputPort.

Definition at line 185 of file CppPorts.cxx.

186 {
187  return new OutputCppPort(*this,newHelder);
188 }
OutputCppPort(const std::string &name, Node *node, TypeCode *type)
Definition: CppPorts.cxx:149

References OutputCppPort().

◆ dump()

std::string OutputCppPort::dump ( )
virtual

Reimplemented from YACS::ENGINE::OutputPort.

Definition at line 195 of file CppPorts.cxx.

196 {
197  if( _data == NULL)
198  return "<value>None</value>";
199  string xmldump = convertNeutralXml(edGetType(), _data);
200  return xmldump;
201 }
TypeCode * edGetType() const
Definition: DataPort.hxx:53
std::string convertNeutralXml(const TypeCode *t, YACS::ENGINE::Any *data)

References _data, YACS::ENGINE::convertNeutralXml(), and YACS::ENGINE::DataPort::edGetType().

◆ get()

YACS::ENGINE::Any * OutputCppPort::get ( ) const
virtual

Definition at line 190 of file CppPorts.cxx.

191 {
192  return _data;
193 }

References _data.

◆ put() [1/2]

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

Reimplemented from YACS::ENGINE::OutputPort.

Definition at line 169 of file CppPorts.cxx.

170 {
171  put((YACS::ENGINE::Any *)data);
172 }
: Interface for management of storage of data formated dynamically in its TypeCode....
Definition: Any.hxx:79
virtual void put(const void *data)
Definition: CppPorts.cxx:169

◆ put() [2/2]

void OutputCppPort::put ( YACS::ENGINE::Any data)

Definition at line 174 of file CppPorts.cxx.

175 {
176  InputPort *p;
177  if(_data)
178  _data->decrRef();
179  _data = data;
180  if(_data)
181  _data->incrRef();
182  OutputPort::put(data);
183 }
Base class for Input Ports.
Definition: InputPort.hxx:44
virtual void put(const void *data)
Definition: OutputPort.cxx:66
Proc * p
Definition: driver.cxx:216

References _data, YACS::ENGINE::RefCounter::decrRef(), YACS::ENGINE::RefCounter::incrRef(), p, and YACS::ENGINE::OutputPort::put().

Member Data Documentation

◆ _data

YACS::ENGINE::Any* YACS::ENGINE::OutputCppPort::_data
protected

Definition at line 74 of file CppPorts.hxx.

Referenced by dump(), get(), OutputCppPort(), put(), and ~OutputCppPort().


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