#include <OMKIConvertor.h>
Inheritance diagram for OMK::Iii::IConvertorT< TypeOut, TypeIn >:
Public Member Functions | |
virtual | ~IConvertorT () |
virtual void | convert (TypeOut &value, const TypeIn &newValue)=0 |
Set the value. | |
Static Public Member Functions | |
static IConvertorT< TypeOut, TypeIn > * | create (const ConfigurationParameterDescriptor *node) |
Helper method to create a convertor dynamically. |
This interface is a template class, the parameters are:
It is used in shared connectors.
Definition at line 195 of file OMKIConvertor.h.
virtual OMK::Iii::IConvertorT< TypeOut, TypeIn >::~IConvertorT | ( | ) | [inline, virtual] |
Definition at line 198 of file OMKIConvertor.h.
Referenced by OMK::Iii::IConvertorT< Type, std::vector< Type > >::~IConvertorT().
virtual void OMK::Iii::IConvertorT< TypeOut, TypeIn >::convert | ( | TypeOut & | value, | |
const TypeIn & | newValue | |||
) | [pure virtual] |
Set the value.
[out] | The | output value set to its new value. |
[in] | newValue | The input value. |
Referenced by OMK::Iii::SharedConnectorT< Type >::updateParameter(), and OMK::Iii::IConvertorT< Type, std::vector< Type > >::~IConvertorT().
IConvertorT< TypeOut, TypeIn > * OMK::Iii::IConvertorT< TypeOut, TypeIn >::create | ( | const ConfigurationParameterDescriptor * | node | ) | [static] |
Helper method to create a convertor dynamically.
[in] | node | The configuration node where to find the informations. |
Definition at line 36 of file OMKIConvertor.inl.
References OMK::ParametersAccessor::get(), OMK::ConfigurationParameterDescriptor::getSubDescriptorByName(), and OMASSERTM.
Referenced by OMK::Iii::IConvertorT< Type, std::vector< Type > >::~IConvertorT().
00037 { 00038 IConvertorT< TypeOut, TypeIn >* convertor = 0 ; 00039 std::string convertorClassId ; 00040 const MultipleConfigurationParameter* convertorNode = dynamic_cast< const MultipleConfigurationParameter* >( node->getSubDescriptorByName( "Convertor" ) ) ; 00041 if( !convertorNode && ParametersAccessor::get( node, "Convertor", convertorClassId ) ) 00042 { 00043 convertor = OBT::Singleton< ConvertorFactoryT< TypeOut, TypeIn > >::getInstance().create( convertorClassId )( node ) ; 00044 OMASSERTM( convertor, "Unable to create the convertor \"" << convertorClassId << "\", may be not registered !" ) ; 00045 } 00046 else if( convertorNode ) 00047 { 00048 if( ParametersAccessor::get( convertorNode, "Class", convertorClassId ) ) 00049 { 00050 convertor = OBT::Singleton< ConvertorFactoryT< TypeOut, TypeIn > >::getInstance().create( convertorClassId )( convertorNode ) ; 00051 OMASSERTM( convertor, "Unable to create the convertor \"" << convertorClassId << "\", may be not registered !" ) ; 00052 } 00053 else 00054 { 00055 OMASSERTM( false, "Unable to create the convertor because the \"Class\" cannot be found in the \"Convertor\" node of" << std::endl << *node ) ; 00056 } 00057 } 00058 return convertor ; 00059 }
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |