00001 #ifndef _ots_ROCDACs_h_
00002 #define _ots_ROCDACs_h_
00003
00004 #include <map>
00005 #include <string>
00006 #include <utility>
00007
00008 namespace ots
00009 {
00010 typedef std::map<std::string, std::pair<unsigned int, unsigned int> > DACList;
00011
00012 class ROCDACs
00013 {
00014 public:
00015 ROCDACs(void) { ; }
00016 virtual ~ROCDACs(void) { ; }
00017 void clear(void) { theDACList_.clear(); }
00018
00019
00020
00021
00022
00023
00024 void setDAC(std::string name, unsigned int address, unsigned int value)
00025 {
00026 theDACList_[name] = std::pair<unsigned int, unsigned int>(address, value);
00027 }
00028
00029
00030 const std::pair<unsigned int, unsigned int>& getDAC(std::string name) const
00031 {
00032 return theDACList_.find(name)->second;
00033 }
00034 unsigned int getDACAddress(std::string name) const
00035 {
00036 return theDACList_.find(name)->second.first;
00037 }
00038 unsigned int getDACValue(std::string name) const
00039 {
00040 return theDACList_.find(name)->second.second;
00041 }
00042 const DACList getDACList(void) const { return theDACList_; }
00043
00044 protected:
00045 DACList theDACList_;
00046 };
00047 }
00048 #endif