Version: 8.3.0
YACS::ENGINE::AnyOutputPort Class Reference

#include <AnyOutputPort.hxx>

Inheritance diagram for YACS::ENGINE::AnyOutputPort:
Collaboration diagram for YACS::ENGINE::AnyOutputPort:

Public Member Functions

 AnyOutputPort (const std::string &name, Node *node, TypeCode *type)
 
 AnyOutputPort (const AnyOutputPort &other, Node *newHelder)
 
virtual ~AnyOutputPort ()
 
virtual void setValue (Any *data)
 store the current dispatched value More...
 
virtual void put (const void *data) throw (ConversionException)
 
void put (Any *data) throw (ConversionException)
 
AnygetValue () const
 get the current dispatched value for update port value More...
 
virtual std::string getAsString ()
 returns port value as a string that can be used in a GUI for example More...
 
virtual std::string typeName ()
 
- 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) throw (Exception)
 
virtual bool edAddInputPort (InputPort *phyPort) throw (Exception)
 
virtual bool edAddInPropertyPort (InPropertyPort *phyPort) throw (Exception)
 
virtual int edRemoveInputPort (InputPort *inputPort, bool forward) throw (Exception)
 
bool addInPort (InPort *inPort) throw (Exception)
 
void edRemoveAllLinksLinkedWithMe () throw (Exception)
 
virtual void exInit ()
 
virtual void checkBasicConsistency () const throw (Exception)
 Check validity of output port. Nothing on base class. More...
 
virtual std::string dump ()
 
- 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::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)
 

Private Member Functions

OutputPortclone (Node *newHelder) const
 

Private Attributes

Any_data
 
YACS::BASES::Mutex _mutex
 

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

Detailed Description

Definition at line 33 of file AnyOutputPort.hxx.

Constructor & Destructor Documentation

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

Definition at line 31 of file AnyOutputPort.cxx.

Referenced by clone().

31  :OutputPort(name,node,type),
32  DataPort(name,node,type),Port(node),_data(0)
33 {
34 }
AnyOutputPort::AnyOutputPort ( const AnyOutputPort other,
Node newHelder 
)

Definition at line 36 of file AnyOutputPort.cxx.

36  :OutputPort(other,newHelder),
37  DataPort(other,newHelder),
38  Port(other,newHelder),_data(0)
39 {
40 }
AnyOutputPort::~AnyOutputPort ( )
virtual

Definition at line 42 of file AnyOutputPort.cxx.

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

43 {
44  if(_data)
45  _data->decrRef();
46 }

Member Function Documentation

OutputPort * AnyOutputPort::clone ( Node newHelder) const
privatevirtual

Implements YACS::ENGINE::OutputPort.

Definition at line 59 of file AnyOutputPort.cxx.

References AnyOutputPort().

60 {
61  return new AnyOutputPort(*this,newHelder);
62 }
std::string AnyOutputPort::getAsString ( )
virtual

returns port value as a string that can be used in a GUI for example

Do nothing here. To subclass

Reimplemented from YACS::ENGINE::DataPort.

Definition at line 75 of file AnyOutputPort.cxx.

References _data, _mutex, YACS::ENGINE::Runtime::convertNeutralAsString(), YACS::ENGINE::DataPort::edGetType(), and YACS::ENGINE::getRuntime().

Any* YACS::ENGINE::AnyOutputPort::getValue ( ) const
inline

get the current dispatched value for update port value

Definition at line 43 of file AnyOutputPort.hxx.

43 { return _data; }
void AnyOutputPort::put ( const void *  data) throw (ConversionException)
virtual
void AnyOutputPort::put ( Any data) throw (ConversionException)

Definition at line 69 of file AnyOutputPort.cxx.

References YACS::ENGINE::OutputPort::put().

70 {
71  setValue(data);
72  OutputPort::put(data);
73 }
void AnyOutputPort::setValue ( Any data)
virtual

store the current dispatched value

Definition at line 49 of file AnyOutputPort.cxx.

References _data, _mutex, YACS::ENGINE::RefCounter::decrRef(), and YACS::ENGINE::RefCounter::incrRef().

Referenced by YACS::ENGINE::DynParaLoop::putValueOnBranch().

50 {
52  if(_data)
53  _data->decrRef();
54  _data = data;
55  if(_data)
56  _data->incrRef();
57 }
virtual std::string YACS::ENGINE::AnyOutputPort::typeName ( )
inlinevirtual

Reimplemented from YACS::ENGINE::OutputPort.

Definition at line 45 of file AnyOutputPort.hxx.

45 {return "YACS__ENGINE__AnyOutputPort";}

Member Data Documentation

Any* YACS::ENGINE::AnyOutputPort::_data
private

Definition at line 47 of file AnyOutputPort.hxx.

Referenced by getAsString(), setValue(), and ~AnyOutputPort().

YACS::BASES::Mutex YACS::ENGINE::AnyOutputPort::_mutex
private

Definition at line 50 of file AnyOutputPort.hxx.

Referenced by getAsString(), and setValue().


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