Version: 9.15.0
YACS::ENGINE::InputXmlPort Class Reference

Class for XML Input Ports. More...

#include <XMLPorts.hxx>

Inheritance diagram for YACS::ENGINE::InputXmlPort:
Collaboration diagram for YACS::ENGINE::InputXmlPort:

Public Member Functions

 InputXmlPort (const std::string &name, Node *node, TypeCode *type)
 
 InputXmlPort (const InputXmlPort &other, Node *newHelder)
 
bool edIsManuallyInitialized () const
 Specifies if this port has been manually set by the call of InputPort::edInit. More...
 
void edRemoveManInit ()
 Removes eventually previous manual initialisation. More...
 
virtual void put (const void *data)
 
void put (const char *data)
 
void releaseData () override
 
InputPortclone (Node *newHelder) const
 
virtual const char * getXml () const
 
void * get () const
 
bool isEmpty ()
 
virtual void exSaveInit ()
 Save the current data value for further reinitialization of the port. More...
 
virtual void exRestoreInit ()
 Restore the saved data value to current data value. More...
 
virtual std::string dump ()
 
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::InputPort
virtual ~InputPort ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
virtual InputPortgetPublicRepresentant ()
 returns the final physical port behind 'this'. More...
 
virtual bool isIntermediate () const
 
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 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 std::string getHumanRepr ()
 
virtual void setStringRef (std::string strRef)
 
virtual std::string typeName ()
 
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 ()
 
- 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 ()
 

Protected Attributes

std::string _data
 
std::string _initData
 
- 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)
 
void edRemoveAllLinksLinkedWithMe ()
 
virtual void edNotifyReferencedBy (OutPort *fromPort, bool isLoopProof=true)
 
virtual void edNotifyDereferencedBy (OutPort *fromPort)
 
virtual void getAllRepresentants (std::set< InPort * > &repr) const
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

Class for XML Input Ports.

See also
XmlNode

Definition at line 37 of file XMLPorts.hxx.

Constructor & Destructor Documentation

◆ InputXmlPort() [1/2]

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

Definition at line 30 of file XMLPorts.cxx.

31  : InputPort(name, node, type), DataPort(name, node, type), Port(node), _initData(""), _data("")
32 {
33 }
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

Referenced by clone().

◆ InputXmlPort() [2/2]

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

Definition at line 35 of file XMLPorts.cxx.

35  :InputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder),_initData(other._initData),_data(other._data)
36 {
37 }

Member Function Documentation

◆ clone()

InputPort * InputXmlPort::clone ( Node newHelder) const
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 82 of file XMLPorts.cxx.

83 {
84  return new InputXmlPort(*this,newHelder);
85 }
InputXmlPort(const std::string &name, Node *node, TypeCode *type)
Definition: XMLPorts.cxx:30

References InputXmlPort().

◆ dump()

std::string InputXmlPort::dump ( )
virtual

Reimplemented from YACS::ENGINE::InputPort.

Reimplemented in YACS::ENGINE::InputStudyPort, and YACS::ENGINE::InputPresetPort.

Definition at line 106 of file XMLPorts.cxx.

107 {
108  return _data;
109 }

References _data.

◆ edIsManuallyInitialized()

bool InputXmlPort::edIsManuallyInitialized ( ) const
virtual

Specifies if this port has been manually set by the call of InputPort::edInit.

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 39 of file XMLPorts.cxx.

40 {
41  return _initData != "";
42 }

References _initData.

◆ edRemoveManInit()

void InputXmlPort::edRemoveManInit ( )
virtual

Removes eventually previous manual initialisation.

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 44 of file XMLPorts.cxx.

45 {
46  _initData="";
48 }
virtual void edRemoveManInit()
Removes eventually previous manual initialisation.
Definition: InputPort.cxx:140

References _initData, and YACS::ENGINE::InputPort::edRemoveManInit().

◆ exRestoreInit()

void InputXmlPort::exRestoreInit ( )
virtual

Restore the saved data value to current data value.

If no data has been saved (_initData == 0) don't restore

Implements YACS::ENGINE::InputPort.

Definition at line 100 of file XMLPorts.cxx.

101 {
102  if(_initData!="")return;
104 }

References _data, and _initData.

◆ exSaveInit()

void InputXmlPort::exSaveInit ( )
virtual

Save the current data value for further reinitialization of the port.

Implements YACS::ENGINE::InputPort.

Definition at line 91 of file XMLPorts.cxx.

92 {
94 }

References _data, and _initData.

◆ get()

void * InputXmlPort::get ( ) const
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 56 of file XMLPorts.cxx.

57 {
58  return (void *) _data.c_str();
59 }

References _data.

◆ getXml()

const char * InputXmlPort::getXml ( ) const
virtual

Definition at line 50 of file XMLPorts.cxx.

51 {
52  DEBTRACE(_data);
53  return _data.c_str();
54 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References _data, and DEBTRACE.

◆ isEmpty()

bool InputXmlPort::isEmpty ( )
virtual

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 77 of file XMLPorts.cxx.

78 {
79  return _data.empty();
80 }

References _data.

◆ put() [1/2]

void InputXmlPort::put ( const char *  data)

Definition at line 67 of file XMLPorts.cxx.

68 {
69  DEBTRACE(data);
70  _data = data;
71 }

References _data, and DEBTRACE.

◆ put() [2/2]

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

Implements YACS::ENGINE::InputPort.

Definition at line 61 of file XMLPorts.cxx.

62 {
63  DEBTRACE("put(void *)");
64  put((const char*)data);
65 }
virtual void put(const void *data)
Definition: XMLPorts.cxx:61

References DEBTRACE.

◆ releaseData()

void InputXmlPort::releaseData ( )
overridevirtual

Implements YACS::ENGINE::InputPort.

Definition at line 73 of file XMLPorts.cxx.

74 {//nothing because _data has no ref counter
75 }

◆ valFromStr()

void InputXmlPort::valFromStr ( std::string  valstr)
virtual

Allows to set data from a string representation used in user interface.

Implemented in derived classes, depending on runtime, to set the data from its user interface representation. Typical use, a Python string representation that can be used in edition or restitution.

Reimplemented from YACS::ENGINE::DataFlowPort.

Definition at line 116 of file XMLPorts.cxx.

117 {
118  _data = valstr;
119 }

References _data.

◆ valToStr()

std::string InputXmlPort::valToStr ( )
virtual

Gives a string representation of the data, for user interfaces.

Implemented in derived classes, depending on runtime, to provide the data representation for user interfaces. Typical use, a Python string representation that can be used in edition or restitution.

Reimplemented from YACS::ENGINE::DataFlowPort.

Definition at line 111 of file XMLPorts.cxx.

112 {
113  return _data;
114 }

References _data.

Member Data Documentation

◆ _data

◆ _initData

std::string YACS::ENGINE::InputXmlPort::_initData
protected

Definition at line 58 of file XMLPorts.hxx.

Referenced by edIsManuallyInitialized(), edRemoveManInit(), exRestoreInit(), and exSaveInit().


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