Version: 9.15.0
YACS::ENGINE::InPropertyPort Class Reference

class for Input Property Ports More...

#include <InPropertyPort.hxx>

Inheritance diagram for YACS::ENGINE::InPropertyPort:
Collaboration diagram for YACS::ENGINE::InPropertyPort:

Public Member Functions

virtual ~InPropertyPort ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual InPropertyPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
virtual std::string typeName ()
 
virtual void exNewPropertyValue (const std::string &name, const std::string &value)
 
virtual void exSaveInit ()
 
virtual void exRestoreInit ()
 
virtual InPropertyPortclone (Node *newHelder) const
 
virtual void * get () const
 
virtual void put (const void *data)
 
virtual void put (YACS::ENGINE::Any *data)
 
void releaseData () override
 
- Public Member Functions inherited from YACS::ENGINE::InputPort
virtual ~InputPort ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
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 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
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 ()
 

Static Public Attributes

static const char NAME [] ="InPropertyPort"
 
- 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

 InPropertyPort (const InPropertyPort &other, Node *newHelder)
 
 InPropertyPort (const std::string &name, Node *node, TypeCode *type, bool canBeNull=false)
 
- 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

YACS::ENGINE::Any_property_data
 
YACS::ENGINE::Any_init_property_data
 
- 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
 

Friends

class Runtime
 
class OutPort
 
class Node
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::DataPort
static DataPortisCrossingType (const std::vector< DataPort * > &historyOfLink)
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

class for Input Property Ports

Definition at line 37 of file InPropertyPort.hxx.

Constructor & Destructor Documentation

◆ ~InPropertyPort()

InPropertyPort::~InPropertyPort ( )
virtual

Definition at line 47 of file InPropertyPort.cxx.

47 {}

◆ InPropertyPort() [1/2]

InPropertyPort::InPropertyPort ( const InPropertyPort other,
Node newHelder 
)
protected

Definition at line 32 of file InPropertyPort.cxx.

33  : InputPort(other, newHelder),
34  DataPort(other, newHelder),
35  Port(other, newHelder),
37 {}
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
YACS::ENGINE::Any * _init_property_data
YACS::ENGINE::Any * _property_data
InputPort(const InputPort &other, Node *newHelder)
Definition: InputPort.cxx:36
Port(Node *node)
Definition: Port.cxx:34

Referenced by clone().

◆ InPropertyPort() [2/2]

InPropertyPort::InPropertyPort ( const std::string &  name,
Node node,
TypeCode type,
bool  canBeNull = false 
)
protected

Definition at line 39 of file InPropertyPort.cxx.

40  : InputPort(name, node, type, canBeNull),
41  DataPort(name, node, type),
42  Port(node),
44 {
45 }
bool canBeNull() const
Definition: InputPort.cxx:174

Member Function Documentation

◆ clone()

InPropertyPort * InPropertyPort::clone ( Node newHelder) const
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 75 of file InPropertyPort.cxx.

76 {
77  return new InPropertyPort(*this,newHelder);
78 }
InPropertyPort(const InPropertyPort &other, Node *newHelder)

References InPropertyPort().

◆ exNewPropertyValue()

void InPropertyPort::exNewPropertyValue ( const std::string &  name,
const std::string &  value 
)
virtual

Definition at line 55 of file InPropertyPort.cxx.

56 {
57  DEBTRACE("Adding new Property to the node " << name << " " << value);
58  _node->setProperty(name, value);
59 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual void setProperty(const std::string &name, const std::string &value)
Definition: Node.cxx:491
Node * _node
Definition: Port.hxx:55

References YACS::ENGINE::Port::_node, DEBTRACE, and YACS::ENGINE::Node::setProperty().

Referenced by put().

◆ exRestoreInit()

void InPropertyPort::exRestoreInit ( )
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 68 of file InPropertyPort.cxx.

69 {
70  if(!_init_property_data)return;
72 }

References _init_property_data, and _property_data.

◆ exSaveInit()

void InPropertyPort::exSaveInit ( )
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 62 of file InPropertyPort.cxx.

63 {
65 }

References _init_property_data, and _property_data.

◆ get()

void * InPropertyPort::get ( ) const
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 81 of file InPropertyPort.cxx.

82 {
83  return (void*) _property_data;
84 }

References _property_data.

◆ getNameOfTypeOfCurrentInstance()

string InPropertyPort::getNameOfTypeOfCurrentInstance ( ) const
virtual

Reimplemented from YACS::ENGINE::DataFlowPort.

Definition at line 49 of file InPropertyPort.cxx.

50 {
51  return NAME;
52 }

References NAME.

◆ getPublicRepresentant()

virtual InPropertyPort* YACS::ENGINE::InPropertyPort::getPublicRepresentant ( )
inlinevirtual

returns the final physical port behind 'this'.

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 53 of file InPropertyPort.hxx.

53 { return this; }

◆ put() [1/2]

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

Implements YACS::ENGINE::InputPort.

Definition at line 87 of file InPropertyPort.cxx.

88 {
89  put((YACS::ENGINE::Any *)data);
90 }
: Interface for management of storage of data formated dynamically in its TypeCode....
Definition: Any.hxx:79
virtual void put(const void *data)

◆ put() [2/2]

void InPropertyPort::put ( YACS::ENGINE::Any data)
virtual

Definition at line 100 of file InPropertyPort.cxx.

101 {
102  // Add new properties to the node
103  YACS::ENGINE::SequenceAny * seq_data = static_cast<YACS::ENGINE::SequenceAny*>(data);
104  for (int i = 0; i < seq_data->size(); i++)
105  {
106  std::string key = ((*seq_data)[i]["name"])->getStringValue();
107  std::string value = ((*seq_data)[i]["value"])->getStringValue();
108  exNewPropertyValue(key, value);
109  }
111  _property_data = data;
113  DEBTRACE("value ref count: " << _property_data->getRefCnt());
114 }
virtual void exNewPropertyValue(const std::string &name, const std::string &value)
unsigned int getRefCnt() const
Definition: RefCounter.hxx:32
unsigned int size() const
Definition: Any.hxx:209

References _property_data, DEBTRACE, exNewPropertyValue(), YACS::ENGINE::RefCounter::getRefCnt(), yacsorb.CORBAEngineTest::i, YACS::ENGINE::RefCounter::incrRef(), releaseData(), and YACS::ENGINE::SequenceAny::size().

◆ releaseData()

void InPropertyPort::releaseData ( )
overridevirtual

Implements YACS::ENGINE::InputPort.

Definition at line 92 of file InPropertyPort.cxx.

93 {
94  if(_property_data)
96  _property_data = nullptr;
97 }

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

Referenced by put().

◆ typeName()

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

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 55 of file InPropertyPort.hxx.

55 {return "YACS__ENGINE__InPropertyPort";}

Friends And Related Function Documentation

◆ Node

friend class Node
friend

Definition at line 41 of file InPropertyPort.hxx.

◆ OutPort

friend class OutPort
friend

Definition at line 40 of file InPropertyPort.hxx.

◆ Runtime

friend class Runtime
friend

Definition at line 39 of file InPropertyPort.hxx.

Member Data Documentation

◆ _init_property_data

YACS::ENGINE::Any* YACS::ENGINE::InPropertyPort::_init_property_data
protected

Definition at line 70 of file InPropertyPort.hxx.

Referenced by exRestoreInit(), and exSaveInit().

◆ _property_data

YACS::ENGINE::Any* YACS::ENGINE::InPropertyPort::_property_data
protected

Definition at line 69 of file InPropertyPort.hxx.

Referenced by exRestoreInit(), exSaveInit(), get(), put(), and releaseData().

◆ NAME

const char InPropertyPort::NAME ="InPropertyPort"
static

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