Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsInputAlias< Type > Class Template Reference

Class PsInputAlias. More...

#include <PsInputAlias.h>

Inheritance diagram for PsInputAlias< Type >:

Inheritance graph
[legend]
Collaboration diagram for PsInputAlias< Type >:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsInputAlias (const PsName &inputName, PsSimulatedObject &owner, PsAbstractInput< Type > *aliasedInput, const int requestedPrecisionLevel=PsPolatorNT::defaultPrecisionLevel)
 Constructor.

virtual ~PsInputAlias (void)
 Destructor.

virtual const Type & get (int deltaT=0)
 get the value of the connected output a certain date.

virtual int getDistanceToExactValue () const
 get distance to exact value.

virtual const Type & getLastExactValue () const
 get the last exact value.

virtual const PsDategetDateOfLastExactValue () const
 get the date of the last exact value.

virtual bool connect (const PsName &objectName, const PsName &outputName)
 connect the aliased input to the output of an other simulated object.

virtual bool connect (PsSimulatedObject &object, const PsName &outputName)
 connect the aliased input to the output of an other simulated object.

virtual bool connect (PsSimulatedObject *pointerToObject, const PsName &outputName)
 connect this input to the output of an other simulated object.

virtual bool connect (const PsName &objectName, const PsName &outputName, const Type &initialValue)
 connect the aliased input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

virtual bool connect (PsSimulatedObject &object, const PsName &outputName, const Type &initialValue)
 connect the aliased input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

virtual bool connect (PsSimulatedObject *pointerToObject, const PsName &outputName, const Type &initialValue)
 connect this input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

virtual bool connectToControlParameter (const PsName &objectName, const PsName &controlParameterName)
 connect this input to a control parameter of an other simulated object.

virtual bool connectToControlParameter (PsSimulatedObject &object, const PsName &controlParameterName)
 connect this input to the controlParameter of an other simulated object.

virtual bool connectToControlParameter (PsSimulatedObject *pointerToObject, const PsName &controlParameterName)
 connect this input to the controlParameter of an other simulated object.

virtual bool connectToControlParameter (const PsName &objectName, const PsName &controlParameterName, const Type &initialValue)
 connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

virtual bool connectToControlParameter (PsSimulatedObject &object, const PsName &controlParameterName, const Type &initialValue)
 connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

virtual bool connectToControlParameter (PsSimulatedObject *pointerToObject, const PsName &controlParameterName, const Type &initialValue)
 connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

virtual const PsOutputNTgetConnectedOutput () const
 get a pointer to output this input is connected to

virtual void disconnect ()
 disconnect the input from the connected output

virtual void extract (istream &=cin)
 extraction from an input stream (input stream) no real semantic has yet been defined for this operation

virtual void insertInStream (ostream &=cout) const
 insert in an output stream no real semantic has yet been defined for this operation

virtual void printDebuggingInformation (ostream &err) const
 print any usefull debugging information for this input

virtual bool realConnect (PsOutputNT *output)
 the real connecting member function

virtual void inputAliasedDeleted ()
 called when the aliased input is deleted


Protected Attributes

PsAbstractInput< Type > * _aliasedInput
 pointer to the aliases input


Detailed Description

template<typename Type>
class PsInputAlias< Type >

Class PsInputAlias.

an alias to an input

Author:
: Olivier Filangi
Version:
: 1.1

Definition at line 36 of file PsInputAlias.h.


Constructor & Destructor Documentation

template<typename Type>
PsInputAlias< Type >::PsInputAlias const PsName   inputName,
PsSimulatedObject   owner,
PsAbstractInput< Type > *    aliasedInput,
const int    requestedPrecisionLevel = PsPolatorNT::defaultPrecisionLevel
[inline]
 

Constructor.

Parameters:
attributeName the name of the input as known by it's owner
owner the owner of the attribute
aliasedInput the aliased input
requestedPrecisionLevel the polation level asked for when the connected output is queried

Definition at line 46 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput, PsPolatorNT::defaultPrecisionLevel, and PsAbstractInput< Type >::isConnectable().

00050      : PsAbstractInput<Type>(inputName,
00051                              owner,
00052                              aliasedInput->isConnectable(),
00053                              requestedPrecisionLevel) ,
00054      _aliasedInput ( aliasedInput )
00055    {
00056       if ( _aliasedInput != NULL )
00057          {
00058             _aliasedInput->notifyAliasing(this) ;
00059          }
00060       else 
00061          {
00062             cerr<<"WARNING : PsInputAlias::PsInputAlias : aliased input is NULL "<<endl;
00063          }
00064    };

template<typename Type>
virtual PsInputAlias< Type >::~PsInputAlias void    [inline, virtual]
 

Destructor.

Definition at line 67 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00068    {
00069       if ( _aliasedInput != NULL )
00070          {
00071             _aliasedInput->notifyUnaliasing(this) ;
00072          }
00073    };


Member Function Documentation

template<typename Type>
bool PsInputAlias< Type >::connect PsSimulatedObject   pointerToObject,
const PsName   outputName,
const Type &    initialValue
[virtual]
 

connect this input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

Parameters:
pointerToObject the object owning outputName
outputName the name of the output to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 348 of file PsInputAlias.h.

References PsAbstractInput< Type >::connect().

00351 {
00352    return PsAbstractInput<Type>::connect( object, outputName, initialValue );
00353 }

template<typename Type>
bool PsInputAlias< Type >::connect PsSimulatedObject   object,
const PsName   outputName,
const Type &    initialValue
[virtual]
 

connect the aliased input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

Parameters:
object the object owning outputName
outputName the name of the output to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 340 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00343 {
00344    return _aliasedInput->connect( object, outputName, initialValue );
00345 }

template<typename Type>
bool PsInputAlias< Type >::connect const PsName   objectName,
const PsName   outputName,
const Type &    initialValue
[virtual]
 

connect the aliased input to the output of an other object, and propose an initial value in case the output hasn't been initialised yet.

Parameters:
objectName the object owning outputName
outputName the name of the output to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 331 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00334 {
00335    return _aliasedInput->connect( objectName, outputName, initialValue );
00336 }

template<typename Type>
bool PsInputAlias< Type >::connect PsSimulatedObject   pointerToObject,
const PsName   outputName
[virtual]
 

connect this input to the output of an other simulated object.

Parameters:
pointerToObject the object owning outputName
outputName the name of the output to be connected to
Returns:
bool connection successfull

Implements PsAbstractInput< Type >.

Definition at line 323 of file PsInputAlias.h.

References PsAbstractInput< Type >::connect().

00325 {
00326    return PsAbstractInput<Type>::connect(object, outputName);
00327 }

template<typename Type>
bool PsInputAlias< Type >::connect PsSimulatedObject   object,
const PsName   outputName
[virtual]
 

connect the aliased input to the output of an other simulated object.

Parameters:
object the object owning outputName
outputName the name of the output to be connected to
Returns:
bool connection successfull

Implements PsAbstractInput< Type >.

Definition at line 315 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00317 {
00318    return _aliasedInput->connect(object, outputName);
00319 }

template<typename Type>
bool PsInputAlias< Type >::connect const PsName   objectName,
const PsName   outputName
[virtual]
 

connect the aliased input to the output of an other simulated object.

Parameters:
objectName the object owning outputName
outputName the name of the output to be connected to
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 307 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00309 {
00310    return _aliasedInput->connect(objectName,outputName);
00311 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter PsSimulatedObject   pointerToObject,
const PsName   controlParameterName,
const Type &    initialValue
[virtual]
 

connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

Parameters:
pointerToObject the object owning outputName
controlParameterName the name of the control parameter to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 398 of file PsInputAlias.h.

References PsAbstractInput< Type >::connectToControlParameter().

00401 {
00402    return PsAbstractInput<Type>::connectToControlParameter( object, controlParameterName, initialValue );
00403 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter PsSimulatedObject   object,
const PsName   controlParameterName,
const Type &    initialValue
[virtual]
 

connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

Parameters:
object the object owning outputName
controlParameterName the name of the control parameter to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 389 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00392 {
00393    return _aliasedInput->connectToControlParameter( object, controlParameterName, initialValue );
00394 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter const PsName   objectName,
const PsName   controlParameterName,
const Type &    initialValue
[virtual]
 

connect this input to a control parameter of an other object, and propose an initial value in case the controlParameter hasn't been initialised yet.

Parameters:
objectName the object owning outputName
controlParameter the name of the controlParameter to be connected to
initialValue the proposed initial value to the output if it isn't initialised
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 380 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00383 {
00384    return _aliasedInput->connectToControlParameter( objectName, controlParameterName, initialValue );
00385 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter PsSimulatedObject   pointerToObject,
const PsName   controlParameterName
[virtual]
 

connect this input to the controlParameter of an other simulated object.

Parameters:
pointerToObject the object owning controlParameterName
controlParameterName the name of the output to be connected to
Returns:
bool connection successfull

Implements PsAbstractInput< Type >.

Definition at line 372 of file PsInputAlias.h.

References PsAbstractInput< Type >::connectToControlParameter().

00374 {
00375    return PsAbstractInput<Type>::connectToControlParameter(object, controlParameterName);
00376 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter PsSimulatedObject   object,
const PsName   controlParameterName
[virtual]
 

connect this input to the controlParameter of an other simulated object.

Parameters:
object the object owning controlParameterName
controlParameterName the name of the output to be connected to
Returns:
bool connection successfull

Implements PsAbstractInput< Type >.

Definition at line 364 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00366 {
00367    return _aliasedInput->connectToControlParameter(object, controlParameterName);
00368 }

template<typename Type>
bool PsInputAlias< Type >::connectToControlParameter const PsName   objectName,
const PsName   controlParameterName
[virtual]
 

connect this input to a control parameter of an other simulated object.

Parameters:
objectName the object owning controlParameterName
controlParameterName the name of the output to be connected to
Returns:
bool connecting successfull

Implements PsAbstractInput< Type >.

Definition at line 356 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00358 {
00359    return _aliasedInput->connectToControlParameter(objectName,controlParameterName);
00360 }

template<typename Type>
void PsInputAlias< Type >::disconnect   [virtual]
 

disconnect the input from the connected output

Implements PsInputNT.

Definition at line 407 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00408 {
00409    _aliasedInput->disconnect( );
00410 }

template<typename Type>
void PsInputAlias< Type >::extract istream &    = cin [inline, virtual]
 

extraction from an input stream (input stream) no real semantic has yet been defined for this operation

Implements PsAttribute.

Definition at line 270 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00271 {
00272   _aliasedInput->extract(in) ;
00273 }

template<typename Type>
const Type & PsInputAlias< Type >::get int    deltaT = 0 [inline, virtual]
 

get the value of the connected output a certain date.

Parameters:
deltaT the time decrement use : the value return is the one the would have be produced at current date - deltaT

Implements PsAbstractInput< Type >.

Definition at line 251 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00252 {
00253 #ifdef _DEBUGTYPEUTIL
00254   cout << "PsInputAlias<Type>::localGet calling get of _aliasedInput " << endl;
00255 #endif
00256   return _aliasedInput->get (deltaT);
00257 }

template<typename Type>
const PsOutputNT * PsInputAlias< Type >::getConnectedOutput   const [virtual]
 

get a pointer to output this input is connected to

Implements PsAbstractInput< Type >.

Definition at line 414 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00415 {
00416    return _aliasedInput->getConnectedOutput( );
00417 }

template<typename Type>
const PsDate & PsInputAlias< Type >::getDateOfLastExactValue   const [virtual]
 

get the date of the last exact value.

Returns:
the date of the last exact value readable at the moment of call

Implements PsAbstractInput< Type >.

Definition at line 302 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput, and PsDate.

00302                                                                  {
00303    return _aliasedInput->getDateOfLastExactValue() ;
00304 }

template<typename Type>
int PsInputAlias< Type >::getDistanceToExactValue   const [inline, virtual]
 

get distance to exact value.

Returns:
This member function returns the distance in milli seconds between the last value returned by get and the nearest exact value from which it was calculated. Distance is positive if the returned value is after the last exact value.

Implements PsAbstractInput< Type >.

Definition at line 262 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00263 {
00264   return _aliasedInput->getDistanceToExactValue();
00265 }

template<typename Type>
const Type & PsInputAlias< Type >::getLastExactValue   const [virtual]
 

get the last exact value.

Using this member function garanties that a value produced is returned, but it should only be used for specific needs, as it prevents any optimisation by the kernel, and the date of production of the value isn't accessible

Returns:
the last exact value readable at the moment of call

Implements PsAbstractInput< Type >.

Definition at line 296 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00296                                                          {
00297    return _aliasedInput->getLastExactValue() ;
00298 }

template<typename Type>
void PsInputAlias< Type >::inputAliasedDeleted   [inline, virtual]
 

called when the aliased input is deleted

Definition at line 243 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00244 {
00245    _aliasedInput = NULL ;
00246 }

template<typename Type>
void PsInputAlias< Type >::insertInStream ostream &    = cout const [inline, virtual]
 

insert in an output stream no real semantic has yet been defined for this operation

Implements PsAttribute.

Definition at line 278 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00279 {
00280   _aliasedInput->insertInStream(out) ;
00281 }

template<typename Type>
void PsInputAlias< Type >::printDebuggingInformation ostream &    err const [inline, virtual]
 

print any usefull debugging information for this input

Parameters:
err the output stream on which to print the debugging information

Implements PsAbstractInput< Type >.

Definition at line 286 of file PsInputAlias.h.

References PsAttribute::_owner, PsAbstractInput< Type >::_precisionLevel, and PsSimulatedObject::getName().

00287 {
00288   err << "**********************************************************" << endl;
00289   err << "Class PsInputAlias" << endl;
00290   err << "Owner : " << _owner.getName() << endl;
00291   err << "polation precision level : " << _precisionLevel << endl;
00292 }

template<typename Type>
virtual bool PsInputAlias< Type >::realConnect PsOutputNT   output [inline, virtual]
 

the real connecting member function

Parameters:
output a pointer to the real output to connect to
Returns:
connection was successfull

Implements PsInputNT.

Definition at line 227 of file PsInputAlias.h.

References PsInputAlias< Type >::_aliasedInput.

00227                                                   {
00228       return _aliasedInput->realConnect(output);
00229    }


Member Data Documentation

template<typename Type>
PsAbstractInput<Type>* PsInputAlias< Type >::_aliasedInput [protected]
 

pointer to the aliases input

Definition at line 236 of file PsInputAlias.h.

Referenced by PsInputAlias< Type >::connect(), PsInputAlias< Type >::connectToControlParameter(), PsInputAlias< Type >::disconnect(), PsInputAlias< Type >::extract(), PsInputAlias< Type >::get(), PsInputAlias< Type >::getConnectedOutput(), PsInputAlias< Type >::getDateOfLastExactValue(), PsInputAlias< Type >::getDistanceToExactValue(), PsInputAlias< Type >::getLastExactValue(), PsInputAlias< Type >::inputAliasedDeleted(), PsInputAlias< Type >::insertInStream(), PsInputAlias< Type >::PsInputAlias(), PsInputAlias< Type >::realConnect(), and PsInputAlias< Type >::~PsInputAlias().


The documentation for this class was generated from the following file:
logo OpenMask

Documentation generated on Mon Nov 25 15:26:04 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001