ControlMapper.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _ControlMapper_
00023 #define _ControlMapper_
00024
00025 #include "Mapping.hxx"
00026 #include "Array.hxx"
00027 #include "Processing.hxx"
00028 #include "InControl.hxx"
00029 #include "OutControl.hxx"
00030 #include <iosfwd>
00031 #include <string>
00032
00033 namespace CLAM {
00034
00035 class ControlMapperConfig:public ProcessingConfig
00036 {
00037 public:
00038 DYNAMIC_TYPE_USING_INTERFACE (ControlMapperConfig, 3,ProcessingConfig);
00039 DYN_ATTRIBUTE (0, public, std::string, Name);
00040 DYN_ATTRIBUTE (1, public, std::string, Mapping);
00041 DYN_ATTRIBUTE (2, public, DataArray, Arguments);
00042 protected:
00043 void DefaultInit(void);
00044 };
00045
00046 class ControlMapper:public Processing
00047 {
00048 private:
00049 typedef ControlMapperConfig Config;
00050 Config mConfig;
00051 Mapping* mMappingPtr;
00052
00053 FloatInControl mInput;
00054 FloatOutControl mOutput;
00055 public:
00056 ControlMapper(const Config& cfg = Config());
00057 ~ControlMapper()
00058 {
00059 }
00060 const char * GetClassName() const {return "ControlMapper";}
00061 bool ConcreteConfigure(const ProcessingConfig& c);
00062 void DoMap(TControlData val)
00063 {
00064 mOutput.SendControl(TControlData(mMappingPtr->Map(val)));
00065 }
00066 bool Do(void) { return true; }
00067 inline const ProcessingConfig &GetConfig() const { return mConfig;}
00068 };
00069
00070
00071 }
00072
00073 #endif //_ControlMapper_
00074
00075
00076