Version: 8.3.0
YACS::ENGINE::OutputCalStreamPort Class Reference

Class for Output Calcium DataStream Ports. More...

#include <CalStreamPort.hxx>

Inheritance diagram for YACS::ENGINE::OutputCalStreamPort:
Collaboration diagram for YACS::ENGINE::OutputCalStreamPort:

Public Member Functions

 OutputCalStreamPort (const std::string &name, Node *node, TypeCode *type)
 
 OutputCalStreamPort (const OutputCalStreamPort &other, Node *newHelder)
 
virtual ~OutputCalStreamPort ()
 
void setDepend (const std::string &depend)
 
void setLevel (const std::string &schema)
 
std::string getDepend ()
 
int getLevel ()
 
void setSchema (const std::string &schema)
 
std::string getSchema ()
 
void setProperty (const std::string &name, const std::string &value)
 Set a new value for a property of the port. More...
 
virtual bool addInPort (InPort *inPort) throw (Exception)
 
std::string getNameOfTypeOfCurrentInstance () const
 
OutputCalStreamPortclone (Node *newHelder) const
 
virtual int removeInPort (InPort *inPort, bool forward) throw (Exception)
 
- Public Member Functions inherited from YACS::ENGINE::OutputDataStreamPort
 OutputDataStreamPort (const OutputDataStreamPort &other, Node *newHelder)
 
 OutputDataStreamPort (const std::string &name, Node *node, TypeCode *type)
 
virtual ~OutputDataStreamPort ()
 
std::set< InPort * > edSetInPort () const
 
bool isAlreadyLinkedWith (InPort *withp) const
 
virtual bool edAddInputDataStreamPort (InputDataStreamPort *port) throw (ConversionException)
 
int edRemoveInputDataStreamPort (InputDataStreamPort *inPort, bool forward) throw (Exception)
 
void edRemoveAllLinksLinkedWithMe () throw (Exception)
 
virtual std::string typeName ()
 
- 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::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)
 

Static Public Attributes

static const char NAME [] ="OutputCalStreamPort"
 
- Static Public Attributes inherited from YACS::ENGINE::OutputDataStreamPort
static const char NAME [] ="OutputDataStreamPort"
 
- 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
 
int _level
 
double _delta
 
- Protected Attributes inherited from YACS::ENGINE::OutputDataStreamPort
std::set< InputDataStreamPort * > _setOfInputDataStreamPort
 
- 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
 

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::OutPort
 OutPort (const OutPort &other, Node *newHelder)
 
 OutPort (const std::string &name, Node *node, TypeCode *type)
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Detailed Description

Class for Output Calcium DataStream Ports.

Definition at line 82 of file CalStreamPort.hxx.

Constructor & Destructor Documentation

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

Definition at line 214 of file CalStreamPort.cxx.

Referenced by clone().

215  :
216  OutputDataStreamPort(name, node, type),
217  DataPort(name, node, type),
218  Port(node),_depend("TIME_DEPENDENCY"),_schema("TI_SCHEM"),_level(-1)
219 {
}
OutputCalStreamPort::OutputCalStreamPort ( const OutputCalStreamPort other,
Node newHelder 
)

Definition at line 221 of file CalStreamPort.cxx.

222  :
223  OutputDataStreamPort(other,newHelder),
224  DataPort(other,newHelder),
225  Port(other,newHelder),
226  _depend(other._depend),_schema(other._schema),_level(other._level)
227 {
}
OutputCalStreamPort::~OutputCalStreamPort ( )
virtual

Definition at line 229 of file CalStreamPort.cxx.

230 {
231 }

Member Function Documentation

bool OutputCalStreamPort::addInPort ( InPort inPort) throw (Exception)
virtual

Reimplemented from YACS::ENGINE::OutputDataStreamPort.

Definition at line 281 of file CalStreamPort.cxx.

References DEBTRACE, YACS::ENGINE::InputCalStreamPort::getDepend(), YACS::ENGINE::InputCalStreamPort::NAME, and PMMLBasicsTestLauncher::ret.

282 {
283  DEBTRACE("OutputCalStreamPort::addInPort " << InputCalStreamPort::NAME );
285  {
286  string what="not compatible type of port requested during building of link FROM ";
287  what+=NAME; what+=" TO "; what+=inPort->getNameOfTypeOfCurrentInstance();
288  throw Exception(what);
289  }
290 
291  InputCalStreamPort* port=static_cast<InputCalStreamPort*>(inPort);
292  if(port->getDepend() != _depend)
293  {
294  std::string what= "incompatible DependencyType properties: "+_depend+" != "+ port->getDepend();
295  throw Exception(what);
296  }
297  bool ret;
298  ret= edAddInputDataStreamPort(port);
299  return ret;
300 }
OutputCalStreamPort * OutputCalStreamPort::clone ( Node newHelder) const
virtual

Reimplemented from YACS::ENGINE::OutputDataStreamPort.

Definition at line 276 of file CalStreamPort.cxx.

References OutputCalStreamPort().

277 {
278  return new OutputCalStreamPort(*this,newHelder);
279 }
std::string YACS::ENGINE::OutputCalStreamPort::getDepend ( )
inline

Definition at line 91 of file CalStreamPort.hxx.

References _depend.

91 {return _depend;};
int YACS::ENGINE::OutputCalStreamPort::getLevel ( )
inline

Definition at line 92 of file CalStreamPort.hxx.

References _level.

92 {return _level;};
std::string OutputCalStreamPort::getNameOfTypeOfCurrentInstance ( ) const
virtual

Reimplemented from YACS::ENGINE::OutputDataStreamPort.

Definition at line 271 of file CalStreamPort.cxx.

References NAME.

272 {
273  return NAME;
274 }
std::string YACS::ENGINE::OutputCalStreamPort::getSchema ( )
inline

Definition at line 94 of file CalStreamPort.hxx.

References _schema.

94 {return _schema;};
int OutputCalStreamPort::removeInPort ( InPort inPort,
bool  forward 
) throw (Exception)
virtual

Reimplemented from YACS::ENGINE::OutputDataStreamPort.

Definition at line 303 of file CalStreamPort.cxx.

References DEBTRACE, and YACS::ENGINE::InputCalStreamPort::NAME.

304 {
305  DEBTRACE("OutputCalStreamPort::removeInPort");
307  {
308  string what="not compatible type of port requested during destruction of for link FROM ";
309  what+=NAME; what+=" TO "; what+=inPort->getNameOfTypeOfCurrentInstance();
310  throw Exception(what);
311  }
312  return edRemoveInputDataStreamPort(static_cast<InputDataStreamPort *>(inPort),forward);
313 }
void OutputCalStreamPort::setDepend ( const std::string &  depend)

Definition at line 233 of file CalStreamPort.cxx.

References _depend, DEBTRACE, and YACS::ENGINE::OutPort::edGetNumberOfOutLinks().

Referenced by setProperty().

234 {
235  DEBTRACE("OutputCalStreamPort::setDepend: " << edGetNumberOfOutLinks());
236  if(edGetNumberOfOutLinks() > 0)
237  {
238  throw Exception("Can not modify DependencyType property on a connected port");
239  }
240  if(depend != "TIME_DEPENDENCY" && depend != "ITERATION_DEPENDENCY")
241  {
242  throw Exception("DependencyType property must be TIME_DEPENDENCY or ITERATION_DEPENDENCY");
243  }
244  _depend=depend;
245 }
void OutputCalStreamPort::setLevel ( const std::string &  schema)

Definition at line 255 of file CalStreamPort.cxx.

References _level.

Referenced by setProperty().

256 {
257  _level =atoi(level.c_str());
258 }
void OutputCalStreamPort::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 260 of file CalStreamPort.cxx.

References setDepend(), setLevel(), YACS::ENGINE::DataStreamPort::setProperty(), and setSchema().

261 {
262  if(name == "DependencyType")
263  setDepend(value);
264  else if(name == "DateCalSchem")
265  setSchema(value);
266  else if(name == "StorageLevel")
267  setLevel(value);
269 }
void OutputCalStreamPort::setSchema ( const std::string &  schema)

Definition at line 247 of file CalStreamPort.cxx.

References _schema.

Referenced by setProperty().

248 {
249  if(schema != "TI_SCHEM" && schema != "TF_SCHEM" && schema != "ALPHA_SCHEM")
250  {
251  throw Exception("DateCalSchem property must be TI_SCHEM, TF_SCHEM or ALPHA_SCHEM");
252  }
253  _schema=schema;
254 }

Member Data Documentation

double YACS::ENGINE::OutputCalStreamPort::_delta
protected

Definition at line 104 of file CalStreamPort.hxx.

std::string YACS::ENGINE::OutputCalStreamPort::_depend
protected

Definition at line 101 of file CalStreamPort.hxx.

Referenced by getDepend(), and setDepend().

int YACS::ENGINE::OutputCalStreamPort::_level
protected

Definition at line 103 of file CalStreamPort.hxx.

Referenced by getLevel(), and setLevel().

std::string YACS::ENGINE::OutputCalStreamPort::_schema
protected

Definition at line 102 of file CalStreamPort.hxx.

Referenced by getSchema(), and setSchema().

const char OutputCalStreamPort::NAME ="OutputCalStreamPort"
static

Definition at line 85 of file CalStreamPort.hxx.

Referenced by getNameOfTypeOfCurrentInstance().


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