CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ODSRPConfig.h
Go to the documentation of this file.
1 #ifndef ODSRPCONFIG_H
2 #define ODSRPCONFIG_H
3 
4 #include <map>
5 #include <stdexcept>
8 
9 #define USE_NORM 1
10 #define USE_CHUN 2
11 #define USE_BUFF 3
12 
13 /* Buffer Size */
14 #define BUFSIZE 200;
15 
16 
17 class ODSRPConfig : public IODConfig {
18  public:
19  friend class EcalCondDBInterface;
20  ODSRPConfig();
21  ~ODSRPConfig();
22 
23  // User data methods
24  inline std::string getTable() { return "ECAL_SRP_CONFIGURATION"; }
25 
26  inline void setId(int id) { m_ID = id; }
27  inline int getId() const { return m_ID; }
28 
29  inline void setDebugMode(int x) { m_debug = x; }
30  inline int getDebugMode() const { return m_debug; }
31 
32  inline void setDummyMode(int x) { m_dummy= x; }
33  inline int getDummyMode() const { return m_dummy; }
34 
36  inline std::string getPatternDirectory() const { return m_patdir; }
37 
38  inline void setAutomaticMasks(int x) { m_auto = x; }
39  inline int getAutomaticMasks() const { return m_auto; }
40 
41  inline void setAutomaticSrpSelect(int x) { m_auto_srp = x; }
42  inline int getAutomaticSrpSelect() const { return m_auto_srp; }
43 
44  inline void setSRP0BunchAdjustPosition(int x) { m_bnch = x; }
45  inline int getSRP0BunchAdjustPosition() const { return m_bnch; }
46 
47  inline void setConfigFile(std::string x) { m_file = x; }
48  inline std::string getConfigFile() const { return m_file; }
49 
50  inline void setSRPClob(unsigned char* x) { m_srp_clob = x; }
51  inline unsigned char* getSRPClob() const { return m_srp_clob; }
52  inline unsigned int getSRPClobSize() const { return m_size; }
53 
54  void setParameters(const std::map<std::string,std::string>& my_keys_map);
55 
56  private:
57  void prepareWrite() throw(std::runtime_error);
58  void writeDB() throw(std::runtime_error);
59  void clear();
60  void fetchData(ODSRPConfig * result) throw(std::runtime_error);
61  int fetchID() throw(std::runtime_error);
62 
63 
64  int fetchNextId() throw(std::runtime_error);
65 
66  // User data
67  int m_ID;
68  unsigned char* m_srp_clob;
69  int m_debug;
70  int m_dummy;
71  std::string m_file;
72  std::string m_patdir;
74  int m_bnch;
75  unsigned int m_size;
76 
77 };
78 
79 #endif
int fetchNextId()
Definition: ODSRPConfig.cc:41
void setPatternDirectory(std::string x)
Definition: ODSRPConfig.h:35
int getId() const
Definition: ODSRPConfig.h:27
void setSRPClob(unsigned char *x)
Definition: ODSRPConfig.h:50
std::string m_file
Definition: ODSRPConfig.h:71
std::string getConfigFile() const
Definition: ODSRPConfig.h:48
unsigned char * m_srp_clob
Definition: ODSRPConfig.h:68
void setConfigFile(std::string x)
Definition: ODSRPConfig.h:47
unsigned int m_size
Definition: ODSRPConfig.h:75
unsigned int getSRPClobSize() const
Definition: ODSRPConfig.h:52
void fetchData(ODSRPConfig *result)
Definition: ODSRPConfig.cc:203
void setParameters(const std::map< std::string, std::string > &my_keys_map)
Definition: ODSRPConfig.cc:65
tuple result
Definition: mps_fire.py:83
int getAutomaticMasks() const
Definition: ODSRPConfig.h:39
std::string getTable()
Definition: ODSRPConfig.h:24
void clear()
Definition: ODSRPConfig.cc:26
int getDebugMode() const
Definition: ODSRPConfig.h:30
int m_auto_srp
Definition: ODSRPConfig.h:73
int getAutomaticSrpSelect() const
Definition: ODSRPConfig.h:42
int getSRP0BunchAdjustPosition() const
Definition: ODSRPConfig.h:45
std::string getPatternDirectory() const
Definition: ODSRPConfig.h:36
unsigned char * getSRPClob() const
Definition: ODSRPConfig.h:51
void setDebugMode(int x)
Definition: ODSRPConfig.h:29
void prepareWrite()
Definition: ODSRPConfig.cc:116
void writeDB()
Definition: ODSRPConfig.cc:166
void setSRP0BunchAdjustPosition(int x)
Definition: ODSRPConfig.h:44
int getDummyMode() const
Definition: ODSRPConfig.h:33
void setDummyMode(int x)
Definition: ODSRPConfig.h:32
void setId(int id)
Definition: ODSRPConfig.h:26
void setAutomaticMasks(int x)
Definition: ODSRPConfig.h:38
void setAutomaticSrpSelect(int x)
Definition: ODSRPConfig.h:41
std::string m_patdir
Definition: ODSRPConfig.h:72