Version: 9.15.0
YACS::ENGINE::InputCalStreamPort Class Reference

Class for Input Calcium DataStream Ports. More...

#include <CalStreamPort.hxx>

Inheritance diagram for YACS::ENGINE::InputCalStreamPort:
Collaboration diagram for YACS::ENGINE::InputCalStreamPort:

Public Member Functions

 InputCalStreamPort (const std::string &name, Node *node, TypeCode *type)
 
 InputCalStreamPort (const InputCalStreamPort &other, Node *newHelder)
 
virtual ~InputCalStreamPort ()
 
void setProperty (const std::string &name, const std::string &value)
 Set a new value for a property of the port. More...
 
std::string getNameOfTypeOfCurrentInstance () const
 
InputCalStreamPortclone (Node *newHelder) const
 
void setSchema (const std::string &value)
 
std::string getSchema ()
 
void setLevel (const std::string &value)
 
int getLevel ()
 
void setDepend (const std::string &value)
 
std::string getDepend ()
 
void setDelta (const std::string &value)
 
double getDelta ()
 
void setAlpha (const std::string &value)
 
double getAlpha ()
 
void setInterp (const std::string &value)
 
std::string getInterp ()
 
void setExtrap (const std::string &value)
 
std::string getExtrap ()
 
- Public Member Functions inherited from YACS::ENGINE::InputDataStreamPort
 InputDataStreamPort (const InputDataStreamPort &other, Node *newHelder)
 
 InputDataStreamPort (const std::string &name, Node *node, TypeCode *type)
 
virtual ~InputDataStreamPort ()
 
virtual std::string typeName ()
 
virtual void edAddOutputDataStreamPort (OutputDataStreamPort *port)
 
std::set< OutputDataStreamPort * > getConnectedOutputDataStreamPort ()
 
- Public Member Functions inherited from YACS::ENGINE::DataStreamPort
TypeOfChannel getTypeOfChannel () const
 returns type of channel the port will use for data exchange on runtime : DATAFLOW or DATASTREAM. More...
 
virtual void setProperties (std::map< std::string, std::string > properties)
 Set the values of all properties of the port. More...
 
virtual std::string getProperty (const std::string &name)
 Get the value of a property of the port. More...
 
std::map< std::string, std::string > getProperties () const
 
virtual void initPortProperties ()
 Initialize port properties at the start of calculation phase. More...
 
virtual ~DataStreamPort ()
 
- 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 InPortgetPublicRepresentant ()
 
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 [] ="InputCalStreamPort"
 
- Static Public Attributes inherited from YACS::ENGINE::InputDataStreamPort
static const char NAME [] ="InputDataStreamPort"
 
- Static Public Attributes inherited from YACS::ENGINE::DataStreamPort
static const char NAME [] ="DataStreamPort"
 
- Static Public Attributes inherited from YACS::ENGINE::DataPort
static const char NAME [] ="DataPort"
 

Protected Attributes

std::string _depend
 
std::string _schema
 
std::string _interp
 
std::string _extrap
 
int _level
 
double _delta
 
double _alpha
 
- Protected Attributes inherited from YACS::ENGINE::InputDataStreamPort
std::set< OutputDataStreamPort * > _setOfOutputDataStreamPort
 
- Protected Attributes inherited from YACS::ENGINE::DataStreamPort
std::map< std::string, std::string > _propertyMap
 
- 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)
 
- Protected Member Functions inherited from YACS::ENGINE::DataStreamPort
 DataStreamPort (const DataStreamPort &other, Node *newHelder)
 
 DataStreamPort (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 Input Calcium DataStream Ports.

Definition at line 40 of file CalStreamPort.hxx.

Constructor & Destructor Documentation

◆ InputCalStreamPort() [1/2]

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

Definition at line 34 of file CalStreamPort.cxx.

34  :
35  InputDataStreamPort(name, node, type),
36  DataPort(name, node, type),
37  Port(node),_depend("TIME_DEPENDENCY"),_schema("TI_SCHEM"),_delta(-1.),_level(-1),_alpha(0.),
38  _interp("L1_SCHEM"),_extrap("UNDEFINED_EXTRA_SCHEM")
39 {
40 }
DataPort(const DataPort &other, Node *newHelder)
Definition: DataPort.cxx:41
InputDataStreamPort(const InputDataStreamPort &other, Node *newHelder)
Port(Node *node)
Definition: Port.cxx:34

Referenced by clone().

◆ InputCalStreamPort() [2/2]

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

Definition at line 41 of file CalStreamPort.cxx.

41  :
42  InputDataStreamPort(other,newHelder),
43  DataPort(other,newHelder),
44  Port(other,newHelder),_depend(other._depend),_schema(other._schema),_delta(other._delta),_level(other._level),
45  _alpha(other._alpha),_interp(other._interp),_extrap(other._extrap)
46 {
47 }

◆ ~InputCalStreamPort()

InputCalStreamPort::~InputCalStreamPort ( )
virtual

Definition at line 49 of file CalStreamPort.cxx.

50 {
51 }

Member Function Documentation

◆ clone()

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

Reimplemented from YACS::ENGINE::InputDataStreamPort.

Definition at line 207 of file CalStreamPort.cxx.

208 {
209  return new InputCalStreamPort(*this,newHelder);
210 }
InputCalStreamPort(const std::string &name, Node *node, TypeCode *type)

References InputCalStreamPort().

◆ getAlpha()

double YACS::ENGINE::InputCalStreamPort::getAlpha ( )
inline

Definition at line 62 of file CalStreamPort.hxx.

62 {return _alpha;};

References _alpha.

◆ getDelta()

double YACS::ENGINE::InputCalStreamPort::getDelta ( )
inline

Definition at line 60 of file CalStreamPort.hxx.

60 {return _delta;};

References _delta.

◆ getDepend()

std::string YACS::ENGINE::InputCalStreamPort::getDepend ( )
inline

Definition at line 58 of file CalStreamPort.hxx.

58 {return _depend;};

References _depend.

Referenced by YACS::ENGINE::OutputCalStreamPort::addInPort().

◆ getExtrap()

std::string YACS::ENGINE::InputCalStreamPort::getExtrap ( )
inline

Definition at line 66 of file CalStreamPort.hxx.

66 {return _extrap;};

References _extrap.

◆ getInterp()

std::string YACS::ENGINE::InputCalStreamPort::getInterp ( )
inline

Definition at line 64 of file CalStreamPort.hxx.

64 {return _interp;};

References _interp.

◆ getLevel()

int YACS::ENGINE::InputCalStreamPort::getLevel ( )
inline

Definition at line 56 of file CalStreamPort.hxx.

56 {return _level;};

References _level.

◆ getNameOfTypeOfCurrentInstance()

std::string InputCalStreamPort::getNameOfTypeOfCurrentInstance ( ) const
virtual

Reimplemented from YACS::ENGINE::InputDataStreamPort.

Definition at line 202 of file CalStreamPort.cxx.

203 {
204  return NAME;
205 }

References NAME.

◆ getSchema()

std::string YACS::ENGINE::InputCalStreamPort::getSchema ( )
inline

Definition at line 54 of file CalStreamPort.hxx.

54 {return _schema;};

References _schema.

◆ setAlpha()

void InputCalStreamPort::setAlpha ( const std::string &  value)

Definition at line 84 of file CalStreamPort.cxx.

85 {
86  std::istringstream iss(value);
87  double temp;
88  if (!(iss >> temp)||temp<0. || temp >1.)
89  throw Exception("Alpha property must be a float > 0 and < 1");
90  _alpha=temp;
91 }

References _alpha.

Referenced by setProperty().

◆ setDelta()

void InputCalStreamPort::setDelta ( const std::string &  value)

Definition at line 92 of file CalStreamPort.cxx.

93 {
94  std::istringstream iss(value);
95  double temp;
96  if (!(iss >> temp)||temp<0. || temp >1.)
97  throw Exception("DeltaT property must be > 0 and < 1");
98  _delta=temp;
99 }

References _delta.

Referenced by setProperty().

◆ setDepend()

void InputCalStreamPort::setDepend ( const std::string &  value)

Definition at line 53 of file CalStreamPort.cxx.

54 {
55  DEBTRACE("InputCalStreamPort::setDepend: " << edGetNumberOfLinks());
56  if(edGetNumberOfLinks() > 0)
57  {
58  throw Exception("Can not modify DependencyType property on a connected port");
59  }
60  if(depend != "TIME_DEPENDENCY" && depend != "ITERATION_DEPENDENCY")
61  {
62  throw Exception("DependencyType property must be TIME_DEPENDENCY or ITERATION_DEPENDENCY");
63  }
64  _depend=depend;
65 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual int edGetNumberOfLinks() const
Returns number of physical backlinks NOT number of user backlinks.
Definition: InPort.cxx:45

References _depend, DEBTRACE, and YACS::ENGINE::InPort::edGetNumberOfLinks().

Referenced by setProperty().

◆ setExtrap()

void InputCalStreamPort::setExtrap ( const std::string &  value)

Definition at line 108 of file CalStreamPort.cxx.

109 {
110  if(value != "E0_SCHEM" && value != "E1_SCHEM")
111  {
112  throw Exception("ExtrapolationSchem property must be E0_SCHEM or E1_SCHEM");
113  }
114  _extrap=value;
115 }

References _extrap.

Referenced by setProperty().

◆ setInterp()

void InputCalStreamPort::setInterp ( const std::string &  value)

Definition at line 100 of file CalStreamPort.cxx.

101 {
102  if(value != "L0_SCHEM" && value != "L1_SCHEM")
103  {
104  throw Exception("InterpolationSchem property must be L0_SCHEM or L1_SCHEM");
105  }
106  _interp=value;
107 }

References _interp.

Referenced by setProperty().

◆ setLevel()

void InputCalStreamPort::setLevel ( const std::string &  value)

Definition at line 75 of file CalStreamPort.cxx.

76 {
77  DEBTRACE("InputCalStreamPort::setLevel: " << value);
78  std::istringstream iss(value);
79  int temp;
80  if (!(iss >> temp)|| temp<1)
81  throw Exception("StorageLevel property must be an integer > 0");
82  _level=temp;
83 }

References _level, and DEBTRACE.

Referenced by setProperty().

◆ setProperty()

void InputCalStreamPort::setProperty ( const std::string &  name,
const std::string &  value 
)
virtual

Set a new value for a property of the port.

Parameters
name: the name property
value: the value property

Reimplemented from YACS::ENGINE::DataStreamPort.

Definition at line 117 of file CalStreamPort.cxx.

118 {
119  DEBTRACE("InputCalStreamPort::setProperty: " << name << " " << value);
120  if(name == "DependencyType")
121  setDepend(value);
122  else if(name == "DateCalSchem")
123  setSchema(value);
124  else if(name == "StorageLevel")
125  setLevel(value);
126  else if(name == "Alpha")
127  setAlpha(value);
128  else if(name == "DeltaT")
129  setDelta(value);
130  else if(name == "InterpolationSchem")
131  setInterp(value);
132  else if(name == "ExtrapolationSchem")
133  setExtrap(value);
135 }
virtual void setProperty(const std::string &name, const std::string &value)
Set a new value for a property of the port.
void setSchema(const std::string &value)
void setLevel(const std::string &value)
void setDepend(const std::string &value)
void setAlpha(const std::string &value)
void setExtrap(const std::string &value)
void setDelta(const std::string &value)
void setInterp(const std::string &value)

References DEBTRACE, setAlpha(), setDelta(), setDepend(), setExtrap(), setInterp(), setLevel(), YACS::ENGINE::DataStreamPort::setProperty(), and setSchema().

◆ setSchema()

void InputCalStreamPort::setSchema ( const std::string &  value)

Definition at line 67 of file CalStreamPort.cxx.

68 {
69  if(schema != "TI_SCHEM" && schema != "TF_SCHEM" && schema != "ALPHA_SCHEM")
70  {
71  throw Exception("DateCalSchem property must be TI_SCHEM, TF_SCHEM or ALPHA_SCHEM");
72  }
73  _schema=schema;
74 }

References _schema.

Referenced by setProperty().

Member Data Documentation

◆ _alpha

double YACS::ENGINE::InputCalStreamPort::_alpha
protected

Definition at line 74 of file CalStreamPort.hxx.

Referenced by getAlpha(), and setAlpha().

◆ _delta

double YACS::ENGINE::InputCalStreamPort::_delta
protected

Definition at line 73 of file CalStreamPort.hxx.

Referenced by getDelta(), and setDelta().

◆ _depend

std::string YACS::ENGINE::InputCalStreamPort::_depend
protected

Definition at line 68 of file CalStreamPort.hxx.

Referenced by getDepend(), and setDepend().

◆ _extrap

std::string YACS::ENGINE::InputCalStreamPort::_extrap
protected

Definition at line 71 of file CalStreamPort.hxx.

Referenced by getExtrap(), and setExtrap().

◆ _interp

std::string YACS::ENGINE::InputCalStreamPort::_interp
protected

Definition at line 70 of file CalStreamPort.hxx.

Referenced by getInterp(), and setInterp().

◆ _level

int YACS::ENGINE::InputCalStreamPort::_level
protected

Definition at line 72 of file CalStreamPort.hxx.

Referenced by getLevel(), and setLevel().

◆ _schema

std::string YACS::ENGINE::InputCalStreamPort::_schema
protected

Definition at line 69 of file CalStreamPort.hxx.

Referenced by getSchema(), and setSchema().

◆ NAME

const char InputCalStreamPort::NAME ="InputCalStreamPort"
static

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