OMK::IAttribute Class Reference
[Attribute feature]

Attribute interface. More...

#include <OMKIAttribute.h>

Inheritance diagram for OMK::IAttribute:

Inheritance graph
[legend]
Collaboration diagram for OMK::IAttribute:

Collaboration graph
[legend]
List of all members.

Owner.

class ExtensibleSimulatedObject
 The extensible object is a friend to set itself as owner of the attribute.
ExtensibleSimulatedObject_owner
 The owner.
const ExtensibleSimulatedObject
*const 
getOwner () const
 Get the owner of the attribute.
void setOwner (ExtensibleSimulatedObject *owner, bool withOutput)
 Set the owner of the attribute.

Accessors.

Name _id
 Id of the attribute.
virtual const std::type_info & getTypeId () const=0
 returns the type of the attribute.
virtual const std::type_info & getModelTypeId () const=0
 returns the model type of the attribute.
std::pair< std::string, std::string > getTypes () const
const NamegetId () const
 Get the id of the attribute.

Update flag.

bool _updated
 Updated flag.
bool isUpdated () const
 Returns the updated flag value.
void resetUpdated ()
 Reset the _updated flag to false.

Input connection and events processing to manage connection.

EventListener_connectToListener
 The listener to handle the connect to id event.
EventListener_disconnectListener
 The listener to handle the disconnect id event.
const EventIdentifier _connectToId
 The id for the event connect to id.
const EventIdentifier _disconnectId
 The id for the event disconnect id.
typedef std::pair< Name, NameConnectToPrm
 Type of connection parameters.
bool processConnectTo (ConnectToEvent *e)
 Call back to process the connect to id event.
bool processDisconnect (Event *e)
 Call back to process the disconnect id event.
 DECLARE_TYPE_EVENT_LISTENER (ConnectToPrm, ConnectTo, IAttribute)
 Type of connection type and event.
bool connectTo (const Name &objectName, const Name &outputName)
 Connect the associated input of the attribute to the given object output.
void disconnect ()
 Disconnect the associated input of the attribute.

Events processing to manage value setting.

EventListener_getValueListener
 The listener to handle the get_value_of_id event (see getGetValueEventId).
EventListener_currentValueListener
 The listener to handle the current_value event.
EventListener_currentValueOfListener
 The listener to handle the current_value_of_id event.
const EventIdentifier _getValueId
 The "get_value_of_<i>id</i>" event id.
const EventIdentifier _currentValueOfId
 The "current_value_of_<i>id</i>" event id.
bool processGetValue (Event *e)
 Call back to process the get_value_of_id event.
virtual void sendIdAndValue (const Name &receiver, const EventIdentifier &eventId, const Name &attributeId)=0
 Sends the value to the receiver in a valued event with the specified event id.
virtual void sendValue (const Name &receiver, const EventIdentifier &eventId)=0
 Sends the value to the receiver with the specified event id.
void sendValueTo (const Name &receiver, const Name &attributeId, bool genericId)
 Sends an valued event to the receiver to set one of its attributes with the current value.
void sendValueOf (const Name &receiver, bool genericId)
 Sends an valued event to inform the receiver of the current value.
virtual void fireIdAndValue (const EventIdentifier &eventId, const Name &attributeId)=0
 Sends the value to the listening objects in a valued event with the specified event id.
virtual void fireValue (const EventIdentifier &eventId)=0
 Sends the value to the listening objects to inform them of the current value.
void fireValueTo (const Name &attributeId, bool genericId)
 Sends an valued event to the listening objects to set one of their attributes with the current value.
void fireValueOf (bool genericId)
 Sends an valued event to inform the listening objects of the current value.

Initialisation.

virtual bool loadParameters (const ConfigurationParameterDescriptor *node, const std::string *aliasName)
 The implementation of the parameters loading.
bool loadParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of IAttribute.
bool loadParameters (const ConfigurationParameterDescriptor *node, const std::string &aliasName)
 Configuration parameters loader of IAttribute.

Public Member Functions

Creation of input and output.
virtual void createInput ()=0
 Creates the associated input.
virtual InputNTgetInput ()=0
 Returns the associated input.
virtual void createOutput ()=0
 Creates the associated output.
virtual OutputNTgetOutput ()=0
 Returns the associated output.
Updating value according to the input or output.
virtual void getValueFromInput ()=0
 Sets the attribute value with the one retrived in the associated input.
virtual void setValueToOutput ()=0
 Sets the output value with the one retrived in the attribute.
Activation of event processing.
void activateConnectByEvent ()
 Activate the handling of connect_to_id and "disconnect <i>id</i>" events.
void activateConnectBySignal (const Name &emitter=Name())
 Activate the handling of connect_to_id and "disconnect <i>id</i>" events.
void activateGetByEvent ()
 Activate the handling of get_value_of_id event.
void activateGetBySignal (const Name &emitter=Name())
 Activate the handling of get_value_of_id event.
virtual void activateSetByEvent ()=0
 Activate the handling of current_value event.
virtual void activateSetByEventOf ()=0
 Activate the handling of current_value_of_id event.
void activateSetBySignal (const Name &emitter=Name())
 Activate the handling of current_value signal.
void activateSetBySignalOf (const Name &emitter=Name())
 Activate the handling of current_value_of_id signal.
Services for additional inputs.
use by connectors.

virtual InputNTcreateInput (const Name &name)=0
 Creates an input with the good type.
virtual void getValueFromInput (InputNT *input)=0
 Sets the attribute value with the one retrived in the given input.

Detailed Description

Attribute interface.

Date:
2007-05-01
Author:
Benoît Chanclou
This class defines an interface class and is the ancestor class for attribute templated class (IAttributeT and its implementations). It is a part of the attribute feature.

Configuration parameters :
With the attribute you can set the following parameters in the configuration: Example for the attribute "Foo" (an integer) in the object "MyObject" the following configuration will activate all the event handling, will create an associated output and will set the value to 18:
myObject
{
  Class MyObject
  UserParams
  {
    Foo 18
    FooOuput true
    FooConnectByEvent true
    FooGetByEvent true
    FooSetByEvent true
    FooSetByEventOf true
  }
}
Event listeners :
Received Event :
Emitted Events :
Emitted signals :

Definition at line 190 of file OMKIAttribute.h.


Member Typedef Documentation

typedef std::pair< Name, Name > OMK::IAttribute::ConnectToPrm

Type of connection parameters.

Parameters:
objectName The first item is the id of the object.
outputName The second item is the id of the output the input has to connect to.
See processConnectTo.

Definition at line 438 of file OMKIAttribute.h.


Constructor & Destructor Documentation

IAttribute::IAttribute ( const Name id  )  [protected]

Constructor.

Parameters:
[in] id The id of the attribute. See _id.
Initialises the event ids according to the given id. Set the listeners to nul, they will be created if necessary.

Definition at line 68 of file OMKIAttribute.cpp.

00069 : _owner( 0 ),
00070   _id( id ),
00071   _updated( false ),
00072   _connectToListener     ( 0 ),
00073   _disconnectListener    ( 0 ),
00074   _connectToId     ( EventId::getConnectToEventId   ( id.getCString() ) ),
00075   _disconnectId    ( EventId::getDisconnectEventId  ( id.getCString() ) ),
00076   _getValueListener      ( 0 ),
00077   _currentValueListener  ( 0 ),
00078   _currentValueOfListener( 0 ),
00079   _getValueId      ( EventId::getGetValueEventId    ( id.getCString() ) ),
00080   _currentValueOfId( EventId::getCurrentValueEventId( id.getCString() ) )
00081 {
00082 }

IAttribute::~IAttribute (  )  [virtual]

Destructor.

Should delete the event listeners

Definition at line 85 of file OMKIAttribute.cpp.

References _connectToListener, _currentValueListener, _currentValueOfListener, _disconnectListener, _getValueListener, _owner, getId(), and OMK::ExtensibleSimulatedObject::removeAttribute().

00086 {
00087   // Delete the event listeners
00088   delete _connectToListener ;
00089   delete _disconnectListener ;
00090   delete _getValueListener ;
00091   delete _currentValueListener ;
00092   delete _currentValueOfListener ;
00093   if( _owner ) _owner->removeAttribute( getId() ) ;
00094 }

IAttribute::IAttribute ( const Name id  )  [protected]

Constructor.

Parameters:
[in] id The id of the attribute. See _id.
Initialises the event ids according to the given id. Set the listeners to nul, they will be created if necessary.

Definition at line 68 of file OMKIAttribute.cpp.

00069 : _owner( 0 ),
00070   _id( id ),
00071   _updated( false ),
00072   _connectToListener     ( 0 ),
00073   _disconnectListener    ( 0 ),
00074   _connectToId     ( EventId::getConnectToEventId   ( id.getCString() ) ),
00075   _disconnectId    ( EventId::getDisconnectEventId  ( id.getCString() ) ),
00076   _getValueListener      ( 0 ),
00077   _currentValueListener  ( 0 ),
00078   _currentValueOfListener( 0 ),
00079   _getValueId      ( EventId::getGetValueEventId    ( id.getCString() ) ),
00080   _currentValueOfId( EventId::getCurrentValueEventId( id.getCString() ) )
00081 {
00082 }

IAttribute::~IAttribute (  )  [virtual]

Destructor.

Should delete the event listeners

Definition at line 85 of file OMKIAttribute.cpp.

References _connectToListener, _currentValueListener, _currentValueOfListener, _disconnectListener, _getValueListener, _owner, getId(), and OMK::ExtensibleSimulatedObject::removeAttribute().

00086 {
00087   // Delete the event listeners
00088   delete _connectToListener ;
00089   delete _disconnectListener ;
00090   delete _getValueListener ;
00091   delete _currentValueListener ;
00092   delete _currentValueOfListener ;
00093   if( _owner ) _owner->removeAttribute( getId() ) ;
00094 }


Member Function Documentation

const ExtensibleSimulatedObject *const IAttribute::getOwner (  )  const

Get the owner of the attribute.

Returns:
a const reference to the attribute owner

Definition at line 98 of file OMKIAttribute.cpp.

References _owner.

Referenced by OMK::getAttrOwnerMsg().

00099 {
00100         return _owner ;
00101 }

void IAttribute::setOwner ( ExtensibleSimulatedObject owner,
bool  withOutput 
) [private]

Set the owner of the attribute.

Parameters:
[in] owner The owner of the attribute, must be valid.
[in] withOutput if true, or if the idOutput onfiguration parameter is set to true, a output will be created.
This method is called by the extensible object when it is adding the attribute to its attributes list to initialise the owner of the attribute (See addAttribute method). It also read configuration to see if the flag idOutput is set to true (See AttributeConfiguration).

Definition at line 104 of file OMKIAttribute.cpp.

References _owner, createOutput(), OMK::ParametersAccessor::get(), OMK::SimulatedObject::getConfigurationParameters(), getId(), and OMASSERTM.

Referenced by OMK::ExtensibleSimulatedObject::addAttribute().

00105 {
00106   // Set the owner
00107   OMASSERTM( !_owner, "cannot be intialised twice !" ) ;
00108   _owner = owner ;
00109   OMASSERTM( _owner, "must be valid !" ) ;
00110 
00111   // Look for the creation of the associated output
00112   bool createOutputCfg = false ;
00113   std::string strId( getId().getCString() ) ;
00114   ParametersAccessor::get( _owner->getConfigurationParameters(), strId + "Output" , createOutputCfg ) ;
00115 
00116   if( withOutput || createOutputCfg )
00117   {
00118     createOutput() ;
00119   }
00120 }

virtual const std::type_info& OMK::IAttribute::getTypeId (  )  const [pure virtual]

returns the type of the attribute.

Returns:
the type of the attribute.
As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeBaseT< PrmType >, OMK::IAttributeBaseT< float >, OMK::IAttributeBaseT< int >, OMK::IAttributeBaseT< T >, OMK::IAttributeBaseT< Type >, OMK::IAttributeBaseT< bool >, OMK::IAttributeBaseT< HBT::PostureData >, and OMK::IAttributeBaseT< OMK::Type::Transform >.

Referenced by OMK::debugMsg(), and OMK::Iii::InteractiveExtension::loadExtensionParameters().

virtual const std::type_info& OMK::IAttribute::getModelTypeId (  )  const [pure virtual]

returns the model type of the attribute.

Returns:
the model type of the attribute.
As it depends of the model type of the attribute, it is implemented in IAttributeBaseT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

std::pair< std::string, std::string > OMK::IAttribute::getTypes (  )  const [inline]

Definition at line 254 of file OMKIAttribute.h.

Referenced by OMK::Iii::InteractorOutput::create().

00255   {
00256     return std::pair< std::string, std::string >( getTypeId().name(), getModelTypeId().name() ) ;
00257   }

const Name & OMK::IAttribute::getId (  )  const [inline]

Get the id of the attribute.

Returns:
the id of the attribute, see _id.

Definition at line 705 of file OMKIAttribute.h.

References _id.

Referenced by OMK::ExtensibleSimulatedObject::addAttribute(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::createInput(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::createOutput(), OMK::debugMsg(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::fireIdAndValue(), fireValueOf(), OMK::Iii::JointInteractorExtension::loadExtensionParameters(), loadParameters(), OMK::IAttributeBaseT< PrmType >::loadParameters(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::processSetValue(), sendValueOf(), setOwner(), OMK::Iii::JointInteractorExtension::startRetroPropagation(), OMK::Iii::JointInteractorExtension::stopRetroPropagation(), OMK::DuplicatedAttributeExtension< AttributType, Type >::~DuplicatedAttributeExtension(), and ~IAttribute().

00706 { 
00707   return _id ; 
00708 }

bool OMK::IAttribute::isUpdated (  )  const [inline]

Returns the updated flag value.

Definition at line 273 of file OMKIAttribute.h.

Referenced by OMK::MultiTriggerEmitterExtensionT< T, ModelType >::postComputeParameters(), OMK::TriggerEmitterExtensionT< T, ModelType >::postComputeParameters(), OMK::TriggerEmitterExtension::postComputeParameters(), OMK::Iii::JointExtension::postComputeParameters(), OMK::NotAttributeExtension::preComputeParameters(), OMK::MKMMoveToTaskExtension::preComputeParameters(), and OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType >::setValueToOutput().

00273 { return _updated ; }

void OMK::IAttribute::resetUpdated (  )  [inline]

Reset the _updated flag to false.

Definition at line 275 of file OMKIAttribute.h.

00275 { _updated = false ; }

bool OMK::IAttribute::loadParameters ( const ConfigurationParameterDescriptor node  )  [inline]

Configuration parameters loader of IAttribute.

Parameters:
[in] node the root node of the configuration parameter.
Returns:
true if all the parameters are well retrieved.
This method allows the attribute to get parameters to initialise itself. See AttributeConfiguration.

This method is automatically called by the object for each registered attribute.

Definition at line 296 of file OMKIAttribute.h.

Referenced by OMK::IAttributeBaseT< PrmType >::loadParameters().

00297   {
00298     return loadParameters( node, 0 ) ;
00299   }

bool OMK::IAttribute::loadParameters ( const ConfigurationParameterDescriptor node,
const std::string &  aliasName 
) [inline]

Configuration parameters loader of IAttribute.

Parameters:
[in] node The root node of the configuration parameter.
[in] aliasName The alias name use to identify the parameters.
Returns:
true if all the parameters are well retrieved.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This method allows the attribute to get parameters to initialise itself. See AttributeConfiguration.

This method can be called by an extension to initialise the attribute with an alias name. For example, if an extension named extensionName adds an attribute for its activation named extensionNameActivation (extensionName+Activation is better than the simpliest Activation because this one is too generic), it is easier to use this loader for the attribute explicitly called by the extension, instead of the other one called automatically by the object.

Example: The following code can be used

 bool MyExtension::loadExtensionParameters( const ConfigurationParameterDescriptor * node ) 
 {
   _activation.loadParameters( node, "Activation" ) ;
   return MyExtensionAncestor::loadExtensionParameters( node ) ;
 }
This allows this kind of configuration
 UserParams
 {
 }
 Extensions
 {
   extensionName
   {
     Class MyExtension
     Activation false
     ActivationConnect [triggerObject Reached]
     ActivationConnectByEvent on
   }
 }
Instead of this one which is equivalent but more difficult to configure due to the concatenated name of the parameters.
 UserParams
 {
   extensionNameActivation false
   extensionNameActivationConnect [triggerObject Reached]
   extensionNameActivationConnectByEvent on
 }
 Extensions
 {
   extensionName
   {
     Class MyExtension
   }
 }
See usage in the extensions DistanceToExtension and TriggerExtension.

Definition at line 359 of file OMKIAttribute.h.

00360   {
00361     return loadParameters( node, &aliasName ) ;
00362   }

bool IAttribute::loadParameters ( const ConfigurationParameterDescriptor node,
const std::string *  aliasName 
) [protected, virtual]

The implementation of the parameters loading.

Parameters:
[in] node The root node of the configuration parameter.
[in] aliasName The alias name use to identify the parameters, if nul, the id of the attribute is used.
Returns:
true if all the parameters are well retrieved.
Load all the needed parameters in the configuration node.

Reimplemented in OMK::IAttributeBaseT< PrmType >, OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType >, OMK::IAttributeBaseT< float >, OMK::IAttributeBaseT< int >, OMK::IAttributeBaseT< T >, OMK::IAttributeBaseT< Type >, OMK::IAttributeBaseT< bool >, OMK::IAttributeBaseT< HBT::PostureData >, OMK::IAttributeBaseT< OMK::Type::Transform >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Definition at line 122 of file OMKIAttribute.cpp.

References activateConnectByEvent(), activateConnectBySignal(), activateGetByEvent(), activateGetBySignal(), activateSetByEvent(), activateSetByEventOf(), activateSetBySignal(), activateSetBySignalOf(), connectTo(), OMK::ParametersAccessor::get(), and getId().

00124 {
00125   std::string strId( aliasName ? *aliasName : getId().getCString() ) ;
00126   // Read parameters to connect the input, ignores if cannot
00127   // to get the parameters
00128   std::pair< std::string, std::string > connectParam; // first = target name / second = output name
00129   if( ParametersAccessor::get( node, strId + "Connect", connectParam ) )
00130   {
00131     connectTo( connectParam.first, connectParam.second ) ;
00132   }
00133   // Event activation
00134   bool activate = false ;
00135   std::vector< Name > emitters ;
00136 
00137   activate = false ;
00138   ParametersAccessor::get( node, strId + "ConnectByEvent", activate ) ;
00139   if( activate ) activateConnectByEvent()  ;
00140   activate = false ;
00141   emitters.clear() ;
00142   if( ParametersAccessor::get( node, strId + "ConnectBySignal", activate )
00143    && activate ) 
00144   {
00145     activateConnectBySignal()  ;
00146   }
00147   else if( ParametersAccessor::get( node, strId + "ConnectBySignal", emitters ) )
00148   {
00149     for( size_t i = 0 ; i < emitters.size() ; i++ )
00150     {
00151       activateConnectBySignal( emitters[ i ] ) ;
00152     }
00153   }
00154 
00155   activate = false ;
00156   ParametersAccessor::get( node, strId + "GetByEvent", activate ) ;
00157   if( activate ) activateGetByEvent() ;
00158   activate = false ;
00159   emitters.clear() ;
00160   if( ParametersAccessor::get( node, strId + "GetBySignal", activate ) 
00161    && activate ) 
00162   {
00163     activateGetBySignal() ;
00164   }
00165   else if( ParametersAccessor::get( node, strId + "GetBySignal", emitters ) )
00166   {
00167     for( size_t i = 0 ; i < emitters.size() ; i++ )
00168     {
00169       activateGetBySignal( emitters[ i ] ) ;
00170     }
00171   }
00172 
00173 
00174   activate = false ;
00175   ParametersAccessor::get( node, strId + "SetByEvent", activate ) ;
00176   if( activate ) activateSetByEvent() ;
00177   activate = false ;
00178   emitters.clear() ;
00179   if( ParametersAccessor::get( node, strId + "SetBySignal", activate ) 
00180    && activate ) 
00181   {
00182     activateSetBySignal() ;
00183   }
00184   else if( ParametersAccessor::get( node, strId + "SetBySignal", emitters ) )
00185   {
00186     for( size_t i = 0 ; i < emitters.size() ; i++ )
00187     {
00188       activateSetBySignal( emitters[ i ] ) ;
00189     }
00190   }
00191 
00192   activate = false ;
00193   ParametersAccessor::get( node, strId + "SetByEventOf", activate ) ;
00194   if( activate ) activateSetByEventOf() ;
00195   activate = false ;
00196   emitters.clear() ;
00197   if( ParametersAccessor::get( node, strId + "SetBySignalOf", activate )
00198    && activate ) 
00199   {
00200     activateSetBySignalOf() ;
00201   }
00202   else if( ParametersAccessor::get( node, strId + "SetBySignalOf", emitters ) )
00203   {
00204     for( size_t i = 0 ; i < emitters.size() ; i++ )
00205     {
00206       activateSetBySignalOf( emitters[ i ] ) ;
00207     }
00208   }
00209 
00210   return true ;
00211 }

virtual void OMK::IAttribute::createInput (  )  [pure virtual]

Creates the associated input.

The value will be retrieved with getValueFromInput().

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by OMK::Iii::SharedConnectorT< Type >::connect(), OMK::Iii::SimpleConnectorT< Type >::connect(), and connectTo().

virtual InputNT* OMK::IAttribute::getInput (  )  [pure virtual]

Returns the associated input.

Returns:
The associated input.
As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by connectTo(), and disconnect().

virtual void OMK::IAttribute::createOutput (  )  [pure virtual]

Creates the associated output.

The call to this method must be done during the creation of the object which is the owner of the attribute.

The output will be set with setValueToOutput.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by OMK::Iii::InteractorExtension::InteractorExtension(), and setOwner().

virtual OutputNT* OMK::IAttribute::getOutput (  )  [pure virtual]

Returns the associated output.

Returns:
The associated output.
As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by OMK::Iii::IConnector::IConnector(), and OMK::Iii::InteractorExtension::InteractorExtension().

virtual void OMK::IAttribute::getValueFromInput (  )  [pure virtual]

Sets the attribute value with the one retrived in the associated input.

If the associated input is not already created, the attribute value stays unchanged. The input can be created with the method createInput.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

virtual void OMK::IAttribute::setValueToOutput (  )  [pure virtual]

Sets the output value with the one retrived in the attribute.

If the associated output is not created this method does nothing. The output can be created with the method createOutput.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeAnimatorT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeAnimatorT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

OMK::IAttribute::DECLARE_TYPE_EVENT_LISTENER ( ConnectToPrm  ,
ConnectTo  ,
IAttribute   
)

Type of connection type and event.

See processConnectTo.

bool IAttribute::connectTo ( const Name objectName,
const Name outputName 
)

Connect the associated input of the attribute to the given object output.

Parameters:
[in] objectName the id of the object to connect to
[in] outputName name the id of the output to connect to
If necessary creates the associated input

Definition at line 276 of file OMKIAttribute.cpp.

References OMK::InputNT::connect(), createInput(), OMK::debugMsg(), getInput(), OMK::Name::getString(), OMK_DEBUG_OMK_ATTR, and OMTRACEID.

Referenced by loadParameters(), OMK::HumanoRecorder::loadParameters(), and processConnectTo().

00277 {
00278   InputNT *associatedInput = getInput() ;
00279   if( !associatedInput )
00280   { // No input defined => create it and try again
00281     createInput() ;
00282     associatedInput = getInput() ;
00283   }
00284   bool ok = associatedInput && associatedInput->connect( objectName, outputName ) ;
00285   if( !ok )
00286   {
00287     // No associated input or unable to connect
00288     OMTRACEID( OMK_DEBUG_OMK_ATTR, 
00289                "Error for " << OMK::debugMsg( this ) << std::endl
00290                    << ">>> :-( Unable to connect the attribute to the output \"" << outputName.getString() 
00291                    << "\" of the object \"" << objectName.getString() << "\" !" ) ;
00292   }
00293   else
00294   {
00295     // No associated input or unable to connect
00296     OMTRACEID( OMK_DEBUG_OMK_ATTR, 
00297                "Information for " << OMK::debugMsg( this ) << std::endl
00298                    << ">>> :-) Connect the attribute to the output \"" << outputName.getString() 
00299                    << "\" of the object \"" << objectName.getString() << "\" !" ) ;
00300   }
00301   return ok ;
00302 }

void IAttribute::disconnect (  ) 

Disconnect the associated input of the attribute.

Definition at line 305 of file OMKIAttribute.cpp.

References OMK::InputNT::disconnect(), and getInput().

Referenced by processDisconnect().

00306 {
00307   InputNT *associatedInput = getInput() ;
00308   if( associatedInput ) associatedInput->disconnect() ;
00309 }

bool IAttribute::processConnectTo ( ConnectToEvent *  e  )  [protected]

Call back to process the connect to id event.

Calls connectTo with the right arguments. See activateConnectByEvent to see the creation of the listener which handles the event.

Definition at line 312 of file OMKIAttribute.cpp.

References _connectToId, connectTo(), and OMASSERTM.

Referenced by activateConnectByEvent().

00313 {
00314   OMASSERTM( _connectToId == e->eventId, "Not the good event id !" ) ;
00315   return connectTo( e->value.getValue().first, e->value.getValue().second ) ;
00316 }

bool IAttribute::processDisconnect ( Event e  )  [protected]

Call back to process the disconnect id event.

Calls disconnect. See activateConnectByEvent to see the creation of the listener which handles the event.

Definition at line 319 of file OMKIAttribute.cpp.

References disconnect().

Referenced by activateConnectByEvent().

00320 {
00321   disconnect() ;
00322   return true ;
00323 }

virtual void OMK::IAttribute::sendIdAndValue ( const Name receiver,
const EventIdentifier eventId,
const Name attributeId 
) [pure virtual]

Sends the value to the receiver in a valued event with the specified event id.

Parameters:
[in] receiver The id of the object which will receive the event
[in] eventId The event id to use
[in] attributeId The id puts in the event
The valued event will be a pair of attributeId and the current value.

As it depends of the type of the attribute, it is implemented in IAttributeT see also IdAndValuePrm.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by OMK::Iii::SharedConnectorT< Type >::sendValue(), OMK::Iii::SimpleConnectorT< Type >::sendValue(), sendValueOf(), and sendValueTo().

virtual void OMK::IAttribute::sendValue ( const Name receiver,
const EventIdentifier eventId 
) [pure virtual]

Sends the value to the receiver with the specified event id.

Parameters:
[in] receiver The id of the object which will receive the event
[in] eventId the event id to use.
The valued event will be the current value.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by processGetValue(), sendValueOf(), and sendValueTo().

void IAttribute::sendValueTo ( const Name receiver,
const Name attributeId,
bool  genericId 
)

Sends an valued event to the receiver to set one of its attributes with the current value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in] receiver The id of the object which will receive the event
[in] attributeId The attribute id to set
[in] genericId Flag to tell which event id will be used.
Two kinds of event will be sent depending on the value of the genericId flag.

Definition at line 366 of file OMKIAttribute.cpp.

References OMK::EventId::CURRENT_ATTRIBUTE_VALUE, OMK::EventId::getCurrentValueEventId(), OMK::Name::getString(), sendIdAndValue(), and sendValue().

Referenced by OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType >::setValueToOutput().

00367 {
00368   if( genericId )
00369   {
00370     sendIdAndValue( receiver, EventId::CURRENT_ATTRIBUTE_VALUE, attributeId ) ;
00371   }
00372   else
00373   {
00374     sendValue( receiver, EventId::getCurrentValueEventId( attributeId.getString() ) ) ;
00375   }
00376 }

void IAttribute::sendValueOf ( const Name receiver,
bool  genericId 
)

Sends an valued event to inform the receiver of the current value.

Parameters:
[in] receiver The id of the object which will receive the event
[in] genericId Flag to tell which event id will be used.
Two kinds of event will be sent depending on the value of the genericId flag.

Definition at line 378 of file OMKIAttribute.cpp.

References _currentValueOfId, OMK::EventId::CURRENT_ATTRIBUTE_VALUE, getId(), sendIdAndValue(), and sendValue().

00379 {
00380   if( genericId )
00381   {
00382     sendIdAndValue( receiver, EventId::CURRENT_ATTRIBUTE_VALUE, getId() ) ;
00383   }
00384   else
00385   {
00386     sendValue( receiver, _currentValueOfId ) ;
00387   }
00388 }

virtual void OMK::IAttribute::fireIdAndValue ( const EventIdentifier eventId,
const Name attributeId 
) [pure virtual]

Sends the value to the listening objects in a valued event with the specified event id.

Parameters:
[in] eventId The event id to use
[in] attributeId The id puts in the event
The valued event will be a pair of attributeId and the current value.

As it depends of the type of the attribute, it is implemented in IAttributeT see also IdAndValuePrm.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by fireValueOf(), and fireValueTo().

virtual void OMK::IAttribute::fireValue ( const EventIdentifier eventId  )  [pure virtual]

Sends the value to the listening objects to inform them of the current value.

Parameters:
[in] eventId the event id to use.
The valued event will be the current value.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by fireValueOf(), and fireValueTo().

void IAttribute::fireValueTo ( const Name attributeId,
bool  genericId 
)

Sends an valued event to the listening objects to set one of their attributes with the current value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in] attributeId The attribute id to set
[in] genericId Flag to tell which event id will be used.
Two kinds of event will be sent depending on the value of the genericId flag.

Definition at line 390 of file OMKIAttribute.cpp.

References OMK::EventId::CURRENT_ATTRIBUTE_VALUE, fireIdAndValue(), fireValue(), OMK::EventId::getCurrentValueEventId(), and OMK::Name::getString().

Referenced by OMK::IAttributeAnimatorT< PrmType, ModelType, AccessorType >::setValueToOutput().

00391 {
00392   if( genericId )
00393   {
00394     fireIdAndValue( EventId::CURRENT_ATTRIBUTE_VALUE, attributeId ) ;
00395   }
00396   else
00397   {
00398     fireValue(  EventId::getCurrentValueEventId( attributeId.getString() ) ) ;
00399   }
00400 }

void IAttribute::fireValueOf ( bool  genericId  ) 

Sends an valued event to inform the listening objects of the current value.

Parameters:
[in] genericId Flag to tell which event id will be used.
Two kinds of event will be sent depending on the value of the genericId flag.

Definition at line 402 of file OMKIAttribute.cpp.

References _currentValueOfId, OMK::EventId::CURRENT_ATTRIBUTE_VALUE, fireIdAndValue(), fireValue(), and getId().

00403 {
00404   if( genericId )
00405   {
00406     fireIdAndValue( EventId::CURRENT_ATTRIBUTE_VALUE, getId() ) ;
00407   }
00408   else
00409   {
00410     fireValue( _currentValueOfId ) ;
00411   }
00412 }

bool IAttribute::processGetValue ( Event e  )  [protected]

Call back to process the get_value_of_id event.

Calls disconnect. See activateGetByEvent to see the creation of the listener which handles the event.

Definition at line 352 of file OMKIAttribute.cpp.

References _currentValueOfId, OMK::EventId::getCurrentValueEventId(), OMK::Name::getString(), OMK::Event::sender, sendValue(), and OMK::ValuedEvent< UserType >::value.

Referenced by activateGetByEvent().

00353 {
00354   ValuedEvent< Name >* eventName = dynamic_cast< ValuedEvent< Name >* >( e ) ;
00355   if( eventName )
00356   {
00357     sendValue( e->sender, EventId::getCurrentValueEventId( eventName->value.getString() ) ) ;
00358   }
00359   else
00360   {
00361     sendValue( e->sender, _currentValueOfId ) ;
00362   }
00363   return true ;
00364 }

void IAttribute::activateConnectByEvent (  ) 

Activate the handling of connect_to_id and "disconnect <i>id</i>" events.

Creates the listeners for the two events to handle. See _connectToListener and _disconnectListener.

Definition at line 214 of file OMKIAttribute.cpp.

References _connectToId, _connectToListener, _disconnectId, _disconnectListener, _owner, OMK::debugMsg(), OMK_DEBUG_OMK_ATTR, OMTRACEID, processConnectTo(), and processDisconnect().

Referenced by activateConnectBySignal(), and loadParameters().

00215 {
00216   if( !_connectToListener )
00217   {
00218     _connectToListener = new ConnectToEventListener
00219       ( *_owner, this, 
00220         (ConnectToEventListener::CallBackFct)&IAttribute::processConnectTo, 
00221         _connectToId ) ;
00222     _disconnectListener = new EventListenerCallBack< IAttribute >
00223       ( *_owner, this, 
00224         (EventListenerCallBack< IAttribute >::CallBackFct)&IAttribute::processDisconnect, 
00225         _disconnectId ) ;
00226     OMTRACEID( OMK_DEBUG_OMK_ATTR, 
00227       "Information for " << OMK::debugMsg( this ) << std::endl
00228       << ">>> :-) Connection by event is activated!" ) ;
00229   }
00230 }

void IAttribute::activateConnectBySignal ( const Name emitter = Name()  ) 

Activate the handling of connect_to_id and "disconnect <i>id</i>" events.

Parameters:
[in] emitter The emitter of the signal, if undefined (the default), listen broadcasted signals.
Creates the listeners for the two signals to handle. See _connectToListener and _disconnectListener.

Definition at line 232 of file OMKIAttribute.cpp.

References _connectToId, _disconnectId, _owner, activateConnectByEvent(), OMK::SimulatedObject::registerForSignal(), OMK::SimulatedObject::registerForSignalBy(), and OMK::Name::undefined().

Referenced by loadParameters().

00233 {
00234   activateConnectByEvent() ;
00235   if( emitter.undefined() )
00236   {
00237     _owner->registerForSignal( _connectToId ) ;
00238     _owner->registerForSignal( _disconnectId ) ;
00239   }
00240   else
00241   {
00242     _owner->registerForSignalBy( _connectToId, emitter ) ;
00243     _owner->registerForSignalBy( _disconnectId, emitter ) ;
00244   }
00245 }

void IAttribute::activateGetByEvent (  ) 

Activate the handling of get_value_of_id event.

Creates the listener for the event to handle. See _getValueListener.

Definition at line 248 of file OMKIAttribute.cpp.

References _getValueId, _getValueListener, _owner, OMK::debugMsg(), OMK_DEBUG_OMK_ATTR, OMTRACEID, and processGetValue().

Referenced by activateGetBySignal(), and loadParameters().

00249 {
00250   if( !_getValueListener )
00251   {
00252     _getValueListener = new EventListenerCallBack< IAttribute >
00253       ( *_owner, this, 
00254         (EventListenerCallBack< IAttribute >::CallBackFct)&IAttribute::processGetValue, 
00255         _getValueId ) ;
00256     OMTRACEID( OMK_DEBUG_OMK_ATTR, 
00257       "Information for " << OMK::debugMsg( this ) << std::endl
00258       << ">>> :-) Get by event is activated!" ) ;
00259   }
00260 }

void IAttribute::activateGetBySignal ( const Name emitter = Name()  ) 

Activate the handling of get_value_of_id event.

Parameters:
[in] emitter The emitter of the signal, if undefined (the default), listen broadcasted signals.
Creates the listener for the signal to handle. See _getValueListener.

Definition at line 262 of file OMKIAttribute.cpp.

References _getValueId, _owner, activateGetByEvent(), OMK::SimulatedObject::registerForSignal(), OMK::SimulatedObject::registerForSignalBy(), and OMK::Name::undefined().

Referenced by loadParameters().

00263 {
00264   activateGetByEvent() ;
00265   if( emitter.undefined() )
00266   {
00267     _owner->registerForSignal( _getValueId ) ;
00268   }
00269   else
00270   {
00271     _owner->registerForSignalBy( _getValueId, emitter ) ;
00272   }
00273 }

virtual void OMK::IAttribute::activateSetByEvent (  )  [pure virtual]

Activate the handling of current_value event.

Creates the listener for the event to handle. See _currentValueListener.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by activateSetBySignal(), and loadParameters().

virtual void OMK::IAttribute::activateSetByEventOf (  )  [pure virtual]

Activate the handling of current_value_of_id event.

Creates the listeners for the event to handle. See _currentValueFromListener.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

Referenced by activateSetBySignalOf(), and loadParameters().

void IAttribute::activateSetBySignal ( const Name emitter = Name()  ) 

Activate the handling of current_value signal.

Parameters:
[in] emitter The emitter of the signal, if undefined (the default), listen broadcasted signals.
Creates the listener for the event to handle. Uses activateSetByEvent to create the listener and make a "OMK::SimulatedObject::registerForSignal" registerForSignal or a "OMK::SimulatedObject::registerForSignalBy" registerForSignalBy according to the value of the emitter.

If the attribute can be set by signal it can be also be set by event, because the listener is the same.

Definition at line 326 of file OMKIAttribute.cpp.

References _owner, activateSetByEvent(), OMK::EventId::CURRENT_ATTRIBUTE_VALUE, OMK::SimulatedObject::registerForSignal(), OMK::SimulatedObject::registerForSignalBy(), and OMK::Name::undefined().

Referenced by loadParameters().

00327 {
00328   activateSetByEvent() ;
00329   if( emitter.undefined() )
00330   {
00331     _owner->registerForSignal( EventId::CURRENT_ATTRIBUTE_VALUE ) ;
00332   }
00333   else
00334   {
00335     _owner->registerForSignalBy( EventId::CURRENT_ATTRIBUTE_VALUE, emitter ) ;
00336   }
00337 }

void IAttribute::activateSetBySignalOf ( const Name emitter = Name()  ) 

Activate the handling of current_value_of_id signal.

Parameters:
[in] emitter The emitter of the signal, if undefined (the default), listen broadcasted signals.
Creates the listener for the event to handle. Uses activateSetByEventOf to create the listener and make a "OMK::SimulatedObject::registerForSignal" registerForSignal or a "OMK::SimulatedObject::registerForSignalBy" registerForSignalBy according to the value of the emitter.

If the attribute can be set by signal it can be also be set by event, because the listener is the same.

Definition at line 339 of file OMKIAttribute.cpp.

References _currentValueOfId, _owner, activateSetByEventOf(), OMK::SimulatedObject::registerForSignal(), OMK::SimulatedObject::registerForSignalBy(), and OMK::Name::undefined().

Referenced by loadParameters().

00340 {
00341   activateSetByEventOf() ;
00342   if( emitter.undefined() )
00343   {
00344     _owner->registerForSignal( _currentValueOfId ) ;
00345   }
00346   else
00347   {
00348     _owner->registerForSignalBy( _currentValueOfId, emitter ) ;
00349   }
00350 }

virtual InputNT* OMK::IAttribute::createInput ( const Name name  )  [pure virtual]

Creates an input with the good type.

Parameters:
[in] name The name of the input to create.
The value will be retrieved with getValueFromInput to set the attribute or with getValueFromInput to get the value, this last method needs a type.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.

virtual void OMK::IAttribute::getValueFromInput ( InputNT input  )  [pure virtual]

Sets the attribute value with the one retrived in the given input.

Parameters:
[in] input The input in which the value will be retrieved.
If the input is not valid (null or of the wrong type), the attribute value stays unchanged. The input should be created with the method createInput.

As it depends of the type of the attribute, it is implemented in IAttributeT.

Implemented in OMK::IAttributeBaseT< PrmType >, OMK::IAttributeT< PrmType, ModelType, AccessorType >, OMK::IAttributeBaseT< float >, OMK::IAttributeBaseT< int >, OMK::IAttributeBaseT< T >, OMK::IAttributeBaseT< Type >, OMK::IAttributeBaseT< bool >, OMK::IAttributeBaseT< HBT::PostureData >, OMK::IAttributeBaseT< OMK::Type::Transform >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorFctT< PrmType, ObjectType > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorAccT< PrmType, PrmAccType > >, OMK::IAttributeT< PrmType, PrmType, OMK::AccessorT< PrmType > >, OMK::IAttributeT< T, OMK::Type::SimpleTypeT< T >, OMK::AccessorT< T > >, OMK::IAttributeT< bool, OMK::Type::SimpleTypeT< bool >, OMK::AccessorT< bool > >, OMK::IAttributeT< OMK::Type::Transform, OMK::Type::SimpleTypeT< OMK::Type::Transform >, OMK::AccessorT< OMK::Type::Transform > >, OMK::IAttributeT< HBT::PostureData, OMK::Type::SimpleTypeT< HBT::PostureData >, OMK::AccessorT< HBT::PostureData > >, OMK::IAttributeT< Type, OMK::Type::SimpleTypeT< Type >, OMK::AccessorAccT< Type, AttributType > >, OMK::IAttributeT< float, OMK::Type::SimpleTypeT< float >, OMK::AccessorT< float > >, OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorT< PrmType > >, and OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >.


Friends And Related Function Documentation

friend class ExtensibleSimulatedObject [friend]

The extensible object is a friend to set itself as owner of the attribute.

Definition at line 218 of file OMKIAttribute.h.


Member Data Documentation

ExtensibleSimulatedObject* OMK::IAttribute::_owner [protected]

The owner.

The owner is the simulated object which owns the attribute. It will be used to send event, create output and input,...

Definition at line 236 of file OMKIAttribute.h.

Referenced by activateConnectByEvent(), activateConnectBySignal(), activateGetByEvent(), activateGetBySignal(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::activateSetByEventOf(), activateSetBySignal(), activateSetBySignalOf(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::createInput(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::createOutput(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::fireIdAndValue(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::fireValue(), getOwner(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::sendIdAndValue(), OMK::IAttributeT< PrmType, ModelType, AccessorType >::sendValue(), setOwner(), ~IAttribute(), and OMK::IAttributeT< PrmType, ModelType, AccessorType >::~IAttributeT().

Name OMK::IAttribute::_id [protected]

Id of the attribute.

This id is unique for the object and identifies the attribute. The other objects knows the attribute only by this id. It is defined at the creation of the attribute and cannot be changed during its life.

Definition at line 266 of file OMKIAttribute.h.

Referenced by getId().

bool OMK::IAttribute::_updated [protected]

Updated flag.

This flag is set to true each time the attribute is updated by a call to set. To reset its value to false call resetUpdated. You can retrieve the flag value with _isUpdated method.

Definition at line 281 of file OMKIAttribute.h.

Referenced by OMK::IAttributeT< PrmType, OMK::Type::SimpleTypeT< PrmType >, OMK::AccessorFctT< PrmType, ObjectType > >::set().

EventListener* OMK::IAttribute::_connectToListener [protected]

The listener to handle the connect to id event.

It is undefined by default. It is created by activateConnectByEvent activation method, and uses the call back processConnectTo.

Definition at line 467 of file OMKIAttribute.h.

Referenced by activateConnectByEvent(), and ~IAttribute().

EventListener* OMK::IAttribute::_disconnectListener [protected]

The listener to handle the disconnect id event.

It is undefined by default. It is created by activateConnectByEvent activation method, and uses the call back processDisconnect.

Definition at line 471 of file OMKIAttribute.h.

Referenced by activateConnectByEvent(), and ~IAttribute().

const EventIdentifier OMK::IAttribute::_connectToId [protected]

The id for the event connect to id.

See processConnectTo.

Definition at line 474 of file OMKIAttribute.h.

Referenced by activateConnectByEvent(), activateConnectBySignal(), and processConnectTo().

const EventIdentifier OMK::IAttribute::_disconnectId [protected]

The id for the event disconnect id.

See processDisconnect.

Definition at line 477 of file OMKIAttribute.h.

Referenced by activateConnectByEvent(), and activateConnectBySignal().

EventListener* OMK::IAttribute::_getValueListener [protected]

The listener to handle the get_value_of_id event (see getGetValueEventId).

It is undefined by default. It is created by activateGetByEvent activation method, and uses the call back processGetValue.

Definition at line 582 of file OMKIAttribute.h.

Referenced by activateGetByEvent(), and ~IAttribute().

EventListener* OMK::IAttribute::_currentValueListener [protected]

The listener to handle the current_value event.

It is undefined by default. It is created by activateSetByEvent activation method (implemented by IAttributeT), and uses the call back processSetValue of IAttributeT.

See activateSetByEvent.

Definition at line 591 of file OMKIAttribute.h.

Referenced by OMK::IAttributeT< PrmType, ModelType, AccessorType >::activateSetByEvent(), and ~IAttribute().

EventListener* OMK::IAttribute::_currentValueOfListener [protected]

The listener to handle the current_value_of_id event.

It is undefined by default. It is created by activateSetByEventOf activation method, and uses the call back processSetValue of IAttributeT.

See activateSetByEventOf.

Definition at line 599 of file OMKIAttribute.h.

Referenced by OMK::IAttributeT< PrmType, ModelType, AccessorType >::activateSetByEventOf(), and ~IAttribute().

const EventIdentifier OMK::IAttribute::_getValueId [protected]

The "get_value_of_<i>id</i>" event id.

Concatenated by getGetValueEventId and used by_getValueListener.

Definition at line 602 of file OMKIAttribute.h.

Referenced by activateGetByEvent(), and activateGetBySignal().

const EventIdentifier OMK::IAttribute::_currentValueOfId [protected]

The "current_value_of_<i>id</i>" event id.

Concatenated by getCurrentValueEventId and used by_currentValueOfListener.

Definition at line 605 of file OMKIAttribute.h.

Referenced by activateSetBySignalOf(), fireValueOf(), processGetValue(), and sendValueOf().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007