Version: 8.3.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) throw (ConversionException)
 
void put (const char *data) throw (ConversionException)
 
InputPortclone (Node *newHelder) const
 
virtual const char * getXml () const
 
void * get () const throw (Exception)
 
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 throw (Exception)
 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...
 
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::InPort
std::set< OutPort * > _backLinks
 
- 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::InputPort
static const char NAME [] ="InputPort"
 
- 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)
 
- 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::InputXmlPort ( const std::string &  name,
Node node,
TypeCode type 
)

Definition at line 30 of file XMLPorts.cxx.

Referenced by clone().

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

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

Implements YACS::ENGINE::InputPort.

Definition at line 78 of file XMLPorts.cxx.

References InputXmlPort().

79 {
80  return new InputXmlPort(*this,newHelder);
81 }
std::string InputXmlPort::dump ( )
virtual

Reimplemented from YACS::ENGINE::InputPort.

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

Definition at line 102 of file XMLPorts.cxx.

References _data.

103 {
104  return _data;
105 }
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.

References _initData.

40 {
41  return _initData != "";
42 }
void InputXmlPort::edRemoveManInit ( )
virtual

Removes eventually previous manual initialisation.

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 44 of file XMLPorts.cxx.

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

45 {
46  _initData="";
48 }
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 96 of file XMLPorts.cxx.

References _data, and _initData.

97 {
98  if(_initData!="")return;
100 }
void InputXmlPort::exSaveInit ( )
virtual

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

Implements YACS::ENGINE::InputPort.

Definition at line 87 of file XMLPorts.cxx.

References _data, and _initData.

88 {
90 }
void * InputXmlPort::get ( ) const throw (Exception)
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 56 of file XMLPorts.cxx.

References _data.

57 {
58  return (void *) _data.c_str();
59 }
const char * InputXmlPort::getXml ( ) const
virtual

Definition at line 50 of file XMLPorts.cxx.

References _data, and DEBTRACE.

Referenced by YACS::ENGINE::XmlNode::execute().

51 {
52  DEBTRACE(_data);
53  return _data.c_str();
54 }
bool InputXmlPort::isEmpty ( )
virtual

Reimplemented from YACS::ENGINE::InputPort.

Definition at line 73 of file XMLPorts.cxx.

References _data.

74 {
75  return _data.empty();
76 }
void InputXmlPort::put ( const void *  data) throw (ConversionException)
virtual

Implements YACS::ENGINE::InputPort.

Definition at line 61 of file XMLPorts.cxx.

References DEBTRACE.

62 {
63  DEBTRACE("put(void *)");
64  put((const char*)data);
65 }
void InputXmlPort::put ( const char *  data) throw (ConversionException)

Definition at line 67 of file XMLPorts.cxx.

References DEBTRACE.

68 {
69  DEBTRACE(data);
70  _data = data;
71 }
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 112 of file XMLPorts.cxx.

References _data.

113 {
114  _data = valstr;
115 }
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 107 of file XMLPorts.cxx.

References _data.

108 {
109  return _data;
110 }

Member Data Documentation

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

Definition at line 57 of file XMLPorts.hxx.

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


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