otsdaq_components  v2_02_00
ROCDACs.h
1 #ifndef _ots_ROCDACs_h_
2 #define _ots_ROCDACs_h_
3 
4 #include <map>
5 #include <string>
6 #include <utility>
7 
8 namespace ots{
9 
10 typedef std::map<std::string, std::pair<unsigned int, unsigned int> > DACList;
11 
12 class ROCDACs
13 {
14 
15 public:
16 
17  ROCDACs(void){;}
18  virtual ~ROCDACs(void){;}
19  void clear(void){theDACList_.clear();}
20 
21  //Setters
22  //void setDAC(std::string name, std::pair<unsigned int, unsigned int> aDAC) {theDACList_[name] = std::make_pair(aDAC.first,aDAC.second);}
23  //void setDAC(std::string name, unsigned int address, unsigned int value) {theDACList_[name].first = address; theDACList_[name].second = value;}
24  void setDAC(std::string name, unsigned int address, unsigned int value) {theDACList_[name] = std::pair<unsigned int, unsigned int>(address, value);}
25 
26  //Getters
27  const std::pair<unsigned int, unsigned int>& getDAC (std::string name) const {return theDACList_.find(name)->second;}
28  unsigned int getDACAddress (std::string name) const {return theDACList_.find(name)->second.first;}
29  unsigned int getDACValue (std::string name) const {return theDACList_.find(name)->second.second;}
30  const DACList getDACList (void) const {return theDACList_;}
31 
32 protected:
33  DACList theDACList_;
34 
35 };
36 }
37 #endif