Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

ConfigurationVariable.h

Go to the documentation of this file.
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     //Informational stuff
00035     string getVariableName() const throw();
00036     string getStrategyDescription() const throw();
00037     
00038     //Conversions
00039     virtual double getLinkActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int link) const throw() = 0;    
00040     virtual double getChipActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00041     virtual double getChannelActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int channel) const throw() = 0;    
00042     
00043     virtual double getLinkLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int link) const throw() = 0;
00044     virtual double getChipLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int chip) const throw() = 0;    
00045     virtual double getChannelLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int channel) const throw() = 0;    
00046     
00047     //ModuleConfiguration interaction
00048     virtual double getChipActualPoint(const ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00049     virtual void setChipActualPoint(double actualPt, ModuleConfiguration& config, unsigned int chip) const throw() = 0;
00050     
00051     virtual double getChipLogicalPoint(const ModuleConfiguration& config, unsigned int chip) const throw();
00052     virtual void setChipLogicalPoint(double logicalPt, ModuleConfiguration& config, unsigned int chip) const throw();
00053     
00054     virtual double getModuleLogicalPoint(const ModuleConfiguration& config) const throw();
00055     virtual void setModuleLogicalPoint(double logicalPt, ModuleConfiguration& config) const throw();
00056     
00057 protected:
00058     ConfigurationVariable(unsigned int typeVal, string variableName, string strategyDescription);
00059     
00060 private:
00061     unsigned short typeVal;
00062     string variableName;
00063     string strategyDescription;
00064     typedef map<unsigned short, shared_ptr<ConfigurationVariable> > VariableTypeMap; 
00065     static VariableTypeMap& getMap() throw();
00066     friend class ConfigurationVariableIOHelper;
00067 };
00068 
00069 
00070 class ConfigurationVariableIOHelper {
00071 public:
00072     static unsigned short getTypeRep(const ConfigurationVariable& var) throw();
00073     static shared_ptr<ConfigurationVariable> getFromTypeRep(unsigned short typeRep) throw();
00074 };
00075 
00076 
00077 }
00078 
00079 #endif //#ifndef CONFIGURATIONVARIABLE_H

Generated on Mon Dec 15 19:36:00 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3