Libbarrett  1.2.4
tests/systems/abstract/conversion_impl.h
00001 /*
00002  * conversion_impl.h
00003  *
00004  *  Created on: Oct 29, 2009
00005  *      Author: dc
00006  */
00007 
00008 #ifndef CONVERSION_IMPL_H_
00009 #define CONVERSION_IMPL_H_
00010 
00011 
00012 #include <barrett/detail/ca_macro.h>
00013 #include <barrett/systems/abstract/system.h>
00014 #include <barrett/systems/abstract/single_io.h>
00015 #include <barrett/systems/abstract/conversion.h>
00016 
00017 
00018 // SingleIO<> implements Conversion
00019 template<typename InputType, typename OutputType>
00020 class ConversionImpl :
00021                 public barrett::systems::SingleIO<InputType, OutputType> {
00022 public:
00023         ConversionImpl(const std::string& sysName = "ConversionImpl") :
00024                 barrett::systems::SingleIO<InputType, OutputType>(sysName) {}
00025         virtual ~ConversionImpl() { this->mandatoryCleanUp(); }
00026 
00027 protected:
00028         virtual void operate() {
00029                 data = static_cast<typename OutputType::Base>(this->input.getValue());
00030                 this->outputValue->setData(&data);
00031         }
00032 
00033         OutputType data;
00034 
00035 private:
00036         DISALLOW_COPY_AND_ASSIGN(ConversionImpl);
00037 };
00038 
00039 
00040 #endif /* CONVERSION_IMPL_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines