ConfigurationVariable.h

00001 #ifndef CONFIGURATIONVARIABLE_H
00002 #define CONFIGURATIONVARIABLE_H
00003 
00004 #include "Sct/Streamable.h"
00005 #include <boost/shared_ptr.hpp>
00006 #include <string>
00007 #include <map>
00008 
00009 using std::string;
00010 using std::map;
00011 using boost::shared_ptr;
00012 
00013 namespace SctData {
00014     
00015 class ModuleConfiguration;
00016 
00026 class ConfigurationVariable : public virtual Sct::Streamable {
00027 public:
00028     virtual ~ConfigurationVariable() throw() {}
00029  
00030     string getClassName() const throw();
00031     
00032     bool operator== (const ConfigurationVariable& var) const throw();
00033     
00034     bool operator!= (const ConfigurationVariable& var) const throw();
00035 
00036     //Informational stuff
00037     string getVariableName() const throw();
00038     string getStrategyDescription() const throw();
00039     
00040     //Conversions
00041     virtual double getLinkActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int link) const throw() = 0;    
00042     virtual double getChipActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00043     virtual double getChannelActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int channel) const throw() = 0;    
00044     
00045     virtual double getLinkLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int link) const throw() = 0;
00046     virtual double getChipLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int chip) const throw() = 0;    
00047     virtual double getChannelLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int channel) const throw() = 0;    
00048     
00049     //ModuleConfiguration interaction
00050     virtual double getChipActualPoint(const ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00051     virtual void setChipActualPoint(double actualPt, ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00052     
00053     virtual double getChipLogicalPoint(const ModuleConfiguration& config, unsigned int chip) const throw();
00054     virtual void setChipLogicalPoint(double logicalPt, ModuleConfiguration& config, unsigned int chip) const throw();
00055     
00056     virtual double getModuleLogicalPoint(const ModuleConfiguration& config) const throw();
00057     virtual void setModuleLogicalPoint(double logicalPt, ModuleConfiguration& config) const throw();
00058     
00059 protected:
00060     ConfigurationVariable(unsigned int typeVal, string variableName, string strategyDescription);
00061     
00062 private:
00063     ConfigurationVariable(unsigned int typeVal);
00064 
00065     unsigned short typeVal;
00066     string variableName;
00067     string strategyDescription;
00068     typedef map<unsigned short, shared_ptr<ConfigurationVariable> > VariableTypeMap; 
00069     static VariableTypeMap& getMap() throw();
00070     friend class ConfigurationVariableIOHelper;
00071 };
00072 
00073 
00074 class ConfigurationVariableIOHelper {
00075 public:
00076     static unsigned short getTypeRep(const ConfigurationVariable& var) throw();
00077     static shared_ptr<ConfigurationVariable> getFromTypeRep(unsigned short typeRep) throw();
00078 };
00079 
00080 
00081 }
00082 
00083 #endif //#ifndef CONFIGURATIONVARIABLE_H

Generated on Mon Feb 6 14:01:18 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6