OMK::AbstractInput< Type > Class Template Reference

class AbstractInput More...

#include <OMKAbstractInput.h>

Inheritance diagram for OMK::AbstractInput< Type >:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AbstractInput (const Name &inputName, SimulatedObject &owner, bool makeConnectable, const int precisionLevel=OMK::Type::PolatorNT::defaultPrecisionLevel)
 Constructor.
virtual ~AbstractInput ()
 Destructor.
virtual bool connect (const Name &objectName, const Name &outputName)=0
 connect this input to the output of an other simulated object.
virtual bool connect (SimulatedObject &object, const Name &outputName)=0
 connect this input to the output of an other simulated object.
virtual bool connect (SimulatedObject *pointerToObject, const Name &outputName)=0
 connect this input to the output of an other simulated object.
virtual bool connect (const Name &objectName, const Name &outputName, const Type &initialValue)=0
 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 connect (SimulatedObject &object, const Name &outputName, const Type &initialValue)=0
 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 connect (SimulatedObject *pointerToObject, const Name &outputName, const Type &initialValue)=0
 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 Name &objectName, const Name &controlParameterName)=0
 connect this input to a control parameter of an other simulated object.
virtual bool connectToControlParameter (SimulatedObject &object, const Name &controlParameterName)=0
 connect this input to the controlParameter of an other simulated object.
virtual bool connectToControlParameter (SimulatedObject *pointerToObject, const Name &controlParameterName)=0
 connect this input to the controlParameter of an other simulated object.
virtual bool connectToControlParameter (const Name &objectName, const Name &controlParameterName, const Type &initialValue)=0
 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 (SimulatedObject &object, const Name &controlParameterName, const Type &initialValue)=0
 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 (SimulatedObject *pointerToObject, const Name &controlParameterName, const Type &initialValue)=0
 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 isConnectable () const
 isConnectable.
bool isConnected () const
 To know if the input is connected to an output.
virtual void setConnectable (bool nextConnectableState)
 setConnectable.
virtual const OutputNTgetConnectedOutput () const=0
 get a pointer to output this input is connected to
const EventIdentifiergetConnectionEventId () const
 get the connection event ID
const EventIdentifiergetConnectionToControlParameterEventId () const
 get the connection event ID, when the connection request comes from a control parameter
virtual const Type & get (int deltaT=0)=0
 get a value from this input
virtual int getDistanceToExactValue () const=0
 get distance to exact value.
virtual const Type & getLastExactValue () const=0
 get the last exact value.
virtual const DategetDateOfLastExactValue () const=0
 get the date of the last exact value.
virtual void printDebuggingInformation (std::ostream &err) const=0
 print any usefull debugging information for this input
virtual int getPrecisionLevel () const
 get the polation level used by this input
virtual int setPrecisionLevel (const int newValue)
 change the polation level of this input
virtual void notifyAliasing (InputAlias< Type > *aliasingInputAlias)
 called when this input is aliased
virtual void notifyUnaliasing (InputAlias< Type > *aliasingInputAlias)
 called when this input is no longer aliased

Protected Attributes

std::list< InputAlias< Type > * > _listOfAliases
 list of aliases of this input
int _precisionLevel
 precision level asked for when a value is fetched from the connected output
bool _connectable
 can simulated objects other than the owner change the connection of this input
const EventIdentifier _connectionEventId
 the connection event Identifier
const EventIdentifier _connectionToControlParameterEventId
 the connection event Identifier

Detailed Description

template<class Type>
class OMK::AbstractInput< Type >

class AbstractInput

Author:
: Olivier Filangi
Version:
: 1.4

Definition at line 38 of file OMKAbstractInput.h.


Constructor & Destructor Documentation

template<typename Type>
OMK::AbstractInput< Type >::AbstractInput ( const Name inputName,
SimulatedObject owner,
bool  makeConnectable,
const int  precisionLevel = OMK::Type::PolatorNT::defaultPrecisionLevel 
) [inline]

Constructor.

Parameters:
inputName the input name
owner the input owner
makeConnectable true is this input must accept connection requests originating from other simulated objects than it's owner
precisionLevel the degre of precision of any polation operation. The scale of this degree is meaningfull only on a polator level. The higher this degre, the more precise calculation should get.

Definition at line 273 of file OMKAbstractInput.h.

References OMK::InputNT::registerMe().

00277   : InputNT( owner, inputName ),
00278     _precisionLevel( precisionLevel ),
00279     _connectable( makeConnectable ),
00280     _connectionEventId( ( "newConnection " + inputName.getString() ).c_str() ),
00281     _connectionToControlParameterEventId( ( "newConnectionToControlParameter "
00282                                             + inputName.getString() ).c_str() )
00283 {
00284 #ifdef _DEBUGTYPEUTIL
00285   std::cout << "AbstractInput<Type>::AbstractInput --> constructor " 
00286             << std::endl ;
00287 #endif
00288   registerMe() ;
00289 }

template<typename Type>
OMK::AbstractInput< Type >::~AbstractInput (  )  [inline, virtual]

Destructor.

Definition at line 294 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_listOfAliases.

00295 {
00296   typename std::list< InputAlias< Type > * >::iterator i ;
00297   for( i =_listOfAliases.begin() ; i != _listOfAliases.end() ; ++i )
00298   {
00299     (*i)->inputAliasedDeleted() ;
00300   }
00301 }


Member Function Documentation

template<class Type>
virtual bool OMK::AbstractInput< Type >::connect ( const Name objectName,
const Name outputName 
) [pure virtual]

connect this 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 OMK::InputNT.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::connect(), and OMK::AbstractInput< Type >::connect().

template<class Type>
virtual bool OMK::AbstractInput< Type >::connect ( SimulatedObject object,
const Name outputName 
) [pure 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 OMK::InputNT.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<typename Type>
bool OMK::AbstractInput< Type >::connect ( SimulatedObject pointerToObject,
const Name outputName 
) [inline, pure 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 OMK::InputNT.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Definition at line 390 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::connect(), OMERROR, and OMK::AbstractInput< Type >::printDebuggingInformation().

00392 {
00393   if( pointerToObject != 0 )
00394   {
00395     return connect( *pointerToObject, outputName ) ;
00396   }
00397   else
00398   {
00399     OMERROR( "AbstractInput<Type>::connect : got null pointer" ) ;
00400     printDebuggingInformation( std::cerr ) ;
00401     return false ;
00402   }
00403 }

template<class Type>
virtual bool OMK::AbstractInput< Type >::connect ( const Name objectName,
const Name outputName,
const Type &  initialValue 
) [pure 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:
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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<class Type>
virtual bool OMK::AbstractInput< Type >::connect ( SimulatedObject object,
const Name outputName,
const Type &  initialValue 
) [pure 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:
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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<typename Type>
bool OMK::AbstractInput< Type >::connect ( SimulatedObject pointerToObject,
const Name outputName,
const Type &  initialValue 
) [inline, pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Definition at line 408 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::connect(), OMERROR, and OMK::AbstractInput< Type >::printDebuggingInformation().

00411 {
00412   if( pointerToObject != 0 )
00413   {
00414     return connect( *pointerToObject, outputName, initialValue ) ;
00415   }
00416   else
00417   {
00418     OMERROR( "AbstractInput< Type >::connect : got null pointer" ) ;
00419     printDebuggingInformation( std::cerr ) ;
00420     return false ;
00421   }
00422 }

template<class Type>
virtual bool OMK::AbstractInput< Type >::connectToControlParameter ( const Name objectName,
const Name controlParameterName 
) [pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::connectToControlParameter(), and OMK::AbstractInput< Type >::connectToControlParameter().

template<class Type>
virtual bool OMK::AbstractInput< Type >::connectToControlParameter ( SimulatedObject object,
const Name controlParameterName 
) [pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<typename Type>
bool OMK::AbstractInput< Type >::connectToControlParameter ( SimulatedObject pointerToObject,
const Name controlParameterName 
) [inline, pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Definition at line 427 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::connectToControlParameter(), OMERROR, and OMK::AbstractInput< Type >::printDebuggingInformation().

00430 {
00431   if( pointerToObject != 0 )
00432   {
00433     return connectToControlParameter( *pointerToObject, outputName ) ;
00434   }
00435   else
00436   {
00437     OMERROR( "AbstractInput< Type >::connect : got null pointer" ) ;
00438     printDebuggingInformation( std::cerr ) ;
00439     return false ;
00440   }
00441 }

template<class Type>
virtual bool OMK::AbstractInput< Type >::connectToControlParameter ( const Name objectName,
const Name controlParameterName,
const Type &  initialValue 
) [pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<class Type>
virtual bool OMK::AbstractInput< Type >::connectToControlParameter ( SimulatedObject object,
const Name controlParameterName,
const Type &  initialValue 
) [pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

template<typename Type>
bool OMK::AbstractInput< Type >::connectToControlParameter ( SimulatedObject pointerToObject,
const Name controlParameterName,
const Type &  initialValue 
) [inline, pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Definition at line 446 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::connectToControlParameter(), OMERROR, and OMK::AbstractInput< Type >::printDebuggingInformation().

00450 {
00451   if( pointerToObject != 0 )
00452   {
00453     return connectToControlParameter( *pointerToObject,
00454                                       outputName,
00455                                       initialValue ) ;
00456   }
00457   else
00458   {
00459     OMERROR( "AbstractInput< Type >::connect : got null pointer" ) ;
00460     printDebuggingInformation( std::cerr ) ;
00461     return false ;
00462   }
00463 }

template<typename Type>
bool OMK::AbstractInput< Type >::isConnectable (  )  const [inline, virtual]

isConnectable.

find out if this input accepts connection requests from other simulated objects

Definition at line 348 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_connectable.

00349 {
00350   return _connectable ;
00351 }

template<class Type>
bool OMK::AbstractInput< Type >::isConnected (  )  const [inline]

To know if the input is connected to an output.

Returns:
true if is connected.

Definition at line 165 of file OMKAbstractInput.h.

00165 { return getConnectedOutput() != 0 ; }

template<typename Type>
void OMK::AbstractInput< Type >::setConnectable ( bool  nextConnectableState  )  [virtual]

setConnectable.

Definition at line 356 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_connectable, OMK::KernelAttribute::_owner, OMK::SimulatedObject::getController(), OMK::CurrentActiveObject::getCurrentActiveObject(), OMK::KernelAttribute::getName(), OMK::SimulatedObject::getName(), and OMERROR.

00357 {
00358   if( CurrentActiveObject::getCurrentActiveObject() == & _owner ||
00359       CurrentActiveObject::getCurrentActiveObject() == & _owner.getController() ||
00360       CurrentActiveObject::getCurrentActiveObject() == 0 )
00361   {
00362     _connectable = newConnectableState ;
00363   }
00364   else 
00365   {
00366     OMERROR( "Warning: " << _owner.getName() << "::" << getName()
00367              << "only the owner can change the connectable state of an input" ) ;
00368   }
00369 }

template<class Type>
virtual const OutputNT* OMK::AbstractInput< Type >::getConnectedOutput (  )  const [pure virtual]

get a pointer to output this input is connected to

Implements OMK::InputNT.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::getConnectedOutput(), and OMK::AbstractInput< OMK::Type::SimpleTypeT< Type > >::isConnected().

template<typename Type>
const EventIdentifier & OMK::AbstractInput< Type >::getConnectionEventId (  )  const [inline]

get the connection event ID

Definition at line 374 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_connectionEventId.

00375 {
00376   return _connectionEventId ;
00377 }

template<typename Type>
const EventIdentifier & OMK::AbstractInput< Type >::getConnectionToControlParameterEventId (  )  const [inline]

get the connection event ID, when the connection request comes from a control parameter

Definition at line 382 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_connectionToControlParameterEventId.

00383 {
00384   return _connectionToControlParameterEventId ;
00385 }

template<class Type>
virtual const Type& OMK::AbstractInput< Type >::get ( int  deltaT = 0  )  [pure virtual]

get a value from this input

Parameters:
delta the delay between the current date and the date of the value expected. If this delay is negative, a value in the future will be calculated.
Returns:
a reference to the value asked for, wich could be an exact value or an approximation calculated by the plugged output's polator. The status of the value can be querried through the getDistanceToExactValue() member function

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::get().

template<class Type>
virtual int OMK::AbstractInput< Type >::getDistanceToExactValue (  )  const [pure 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.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::getDistanceToExactValue().

template<class Type>
virtual const Type& OMK::AbstractInput< Type >::getLastExactValue (  )  const [pure 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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::getLastExactValue().

template<class Type>
virtual const Date& OMK::AbstractInput< Type >::getDateOfLastExactValue (  )  const [pure virtual]

get the date of the last exact value.

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

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::InputAlias< T >::getDateOfLastExactValue().

template<class Type>
virtual void OMK::AbstractInput< Type >::printDebuggingInformation ( std::ostream &  err  )  const [pure virtual]

print any usefull debugging information for this input

Implements OMK::KernelAttribute.

Implemented in OMK::Input< T >, OMK::InputAlias< T >, OMK::Input< ModelType >, OMK::Input< OMK::Type::SimpleTypeT< bool > >, OMK::Input< OMK::Type::SimpleTypeT< float > >, OMK::Input< OMK::Type::SimpleTypeT< T > >, OMK::Input< OMK::Type::SimpleTypeT< PrmType > >, OMK::Input< PrmType >, OMK::Input< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::Input< OMK::Type::SimpleTypeT< HBT::PostureData > >, OMK::Input< OMK::Type::SimpleTypeT< Type > >, OMK::InputAlias< ModelType >, OMK::InputAlias< OMK::Type::SimpleTypeT< bool > >, OMK::InputAlias< OMK::Type::SimpleTypeT< float > >, OMK::InputAlias< OMK::Type::SimpleTypeT< T > >, OMK::InputAlias< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputAlias< PrmType >, OMK::InputAlias< Type >, OMK::InputAlias< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputAlias< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >.

Referenced by OMK::AbstractInput< Type >::connect(), and OMK::AbstractInput< Type >::connectToControlParameter().

template<typename Type>
int OMK::AbstractInput< Type >::getPrecisionLevel (  )  const [inline, virtual]

get the polation level used by this input

Definition at line 306 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_precisionLevel.

00307 {
00308   return _precisionLevel ;
00309 }

template<typename Type>
int OMK::AbstractInput< Type >::setPrecisionLevel ( const int  newValue  )  [inline, virtual]

change the polation level of this input

Parameters:
newValue the new value
Returns:
the old polationValue

Definition at line 314 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_precisionLevel.

00315 {
00316   int oldValue = _precisionLevel ;
00317   _precisionLevel = newValue ;
00318   return oldValue ;
00319 }

template<typename Type>
void OMK::AbstractInput< Type >::notifyAliasing ( InputAlias< Type > *  aliasingInputAlias  )  [inline, virtual]

called when this input is aliased

Parameters:
aliasingInputAlias : the input alias aliasing this input

Definition at line 324 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_listOfAliases.

Referenced by OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >::InputAlias().

00326 {
00327   if( aliasingInputAlias != 0 )
00328   {
00329     _listOfAliases.push_back( aliasingInputAlias ) ;
00330   }
00331 }

template<typename Type>
void OMK::AbstractInput< Type >::notifyUnaliasing ( InputAlias< Type > *  aliasingInputAlias  )  [inline, virtual]

called when this input is no longer aliased

Parameters:
aliasingInputAlias : the input alias aliasing this input

Definition at line 336 of file OMKAbstractInput.h.

References OMK::AbstractInput< Type >::_listOfAliases.

Referenced by OMK::InputAlias< OMK::Type::SimpleTypeT< Type > >::~InputAlias().

00338 {
00339   if( aliasingInputAlias != 0 )
00340   {
00341     _listOfAliases.push_back( aliasingInputAlias ) ;
00342   }
00343 }


Member Data Documentation

template<class Type>
std::list<InputAlias<Type> *> OMK::AbstractInput< Type >::_listOfAliases [protected]

list of aliases of this input

Definition at line 241 of file OMKAbstractInput.h.

Referenced by OMK::AbstractInput< Type >::notifyAliasing(), OMK::AbstractInput< Type >::notifyUnaliasing(), and OMK::AbstractInput< Type >::~AbstractInput().

template<class Type>
int OMK::AbstractInput< Type >::_precisionLevel [protected]

precision level asked for when a value is fetched from the connected output

Definition at line 244 of file OMKAbstractInput.h.

Referenced by OMK::AbstractInput< Type >::getPrecisionLevel(), and OMK::AbstractInput< Type >::setPrecisionLevel().

template<class Type>
bool OMK::AbstractInput< Type >::_connectable [protected]

can simulated objects other than the owner change the connection of this input

Definition at line 247 of file OMKAbstractInput.h.

Referenced by OMK::AbstractInput< Type >::isConnectable(), and OMK::AbstractInput< Type >::setConnectable().

template<class Type>
const EventIdentifier OMK::AbstractInput< Type >::_connectionEventId [protected]

the connection event Identifier

Definition at line 250 of file OMKAbstractInput.h.

Referenced by OMK::AbstractInput< Type >::getConnectionEventId().

template<class Type>
const EventIdentifier OMK::AbstractInput< Type >::_connectionToControlParameterEventId [protected]

the connection event Identifier

Definition at line 253 of file OMKAbstractInput.h.

Referenced by OMK::AbstractInput< Type >::getConnectionToControlParameterEventId().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:01 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007