CMS 3D CMS Logo

SiStripDbParams.h
Go to the documentation of this file.
1 
2 #ifndef OnlineDB_SiStripConfigDb_SiStripDbParams_h
3 #define OnlineDB_SiStripConfigDb_SiStripDbParams_h
4 
8 #include "boost/range/iterator_range.hpp"
9 #include <ostream>
10 #include <sstream>
11 #include <string>
12 #include <vector>
13 #include <map>
14 
15 class SiStripDbParams;
16 
18 std::ostream& operator<<(std::ostream&, const SiStripDbParams&);
19 
26 public:
27  // ---------- cons(de)structors ----------
28 
30 
32 
34 
35  bool operator==(const SiStripDbParams&) const;
36 
37  bool operator!=(const SiStripDbParams&) const;
38 
40 
41  // ---------- typedefs ----------
42 
43  typedef std::map<std::string, SiStripPartition> SiStripPartitions;
44 
46 
47  typedef boost::iterator_range<SiStripPartitions::const_iterator> const_iterator_range;
48 
49  typedef boost::iterator_range<SiStripPartitions::iterator> iterator_range;
50 
51  // ---------- database-related ----------
52 
53  bool usingDb() const;
54 
55  std::string confdb() const;
56 
57  std::string user() const;
58 
59  std::string passwd() const;
60 
61  std::string path() const;
62 
63  bool usingDbCache() const;
64 
65  std::string sharedMemory() const;
66 
67  std::string tnsAdmin() const;
68 
69  // ---------- partition-related ----------
70 
73 
76 
78  SiStripPartitions::const_iterator partition(std::string partition_name) const;
79 
81  SiStripPartitions::iterator partition(std::string partition_name);
82 
84  void clearPartitions();
85 
87  void addPartition(const SiStripPartition&);
88 
90  std::vector<std::string> partitionNames() const;
91 
93  std::vector<std::string> partitionNames(std::string) const;
94 
96  std::string partitionNames(const std::vector<std::string>&) const;
97 
99  size_type partitionsSize() const;
100 
101  // ---------- setters ----------
102 
103  void usingDb(bool);
104 
105  void usingDbCache(bool);
106 
108 
109  void pset(const edm::ParameterSet&);
110 
111  void confdb(const std::string&);
112 
113  void confdb(const std::string& user, const std::string& passwd, const std::string& path);
114 
115  void reset();
116 
117  // ---------- xml file names ----------
118 
119  std::vector<std::string> inputModuleXmlFiles() const;
120 
121  std::vector<std::string> inputDcuInfoXmlFiles() const;
122 
123  std::vector<std::string> inputFecXmlFiles() const;
124 
125  std::vector<std::string> inputFedXmlFiles() const;
126 
128 
130 
131  std::string outputFecXml() const;
132 
133  std::string outputFedXml() const;
134 
135  void print(std::stringstream&) const;
136 
137  // ---------- private member data ----------
138 
139 private:
140  bool usingDb_;
141 
143 
145 
147 
149 
151 
153 
155 
157 
159 
161 
163 
165 };
166 
167 // ---------- inline methods ----------
168 
169 inline bool SiStripDbParams::usingDb() const { return usingDb_; }
170 inline std::string SiStripDbParams::confdb() const { return confdb_; }
171 inline std::string SiStripDbParams::user() const { return user_; }
172 inline std::string SiStripDbParams::passwd() const { return passwd_; }
173 inline std::string SiStripDbParams::path() const { return path_; }
174 inline bool SiStripDbParams::usingDbCache() const { return usingDbCache_; }
177 
179  return const_iterator_range(partitions_.begin(), partitions_.end());
180 }
182  return iterator_range(partitions_.begin(), partitions_.end());
183 }
184 
186 
191 
193 inline void SiStripDbParams::usingDb(bool using_db) { usingDb_ = using_db; }
194 inline void SiStripDbParams::usingDbCache(bool using_cache) { usingDbCache_ = using_cache; }
196 
197 #endif // OnlineDB_SiStripConfigDb_SiStripDbParams_h
SiStripDbParams::tnsAdmin_
std::string tnsAdmin_
Definition: SiStripDbParams.h:154
SiStripDbParams::partitionNames
std::vector< std::string > partitionNames() const
Definition: SiStripDbParams.cc:253
SiStripDbParams::passwd_
std::string passwd_
Definition: SiStripDbParams.h:146
SiStripDbParams::inputFecXmlFiles
std::vector< std::string > inputFecXmlFiles() const
Definition: SiStripDbParams.cc:380
SiStripPartition.h
SiStripDbParams::iterator_range
boost::iterator_range< SiStripPartitions::iterator > iterator_range
Definition: SiStripDbParams.h:49
SiStripDbParams::path_
std::string path_
Definition: SiStripDbParams.h:148
SiStripPartition
Container class for database partition parameters.
Definition: SiStripPartition.h:24
SiStripDbParams::~SiStripDbParams
~SiStripDbParams()
Definition: SiStripDbParams.cc:98
SiStripDbParams::tnsAdmin
std::string tnsAdmin() const
Definition: SiStripDbParams.h:176
SiStripDbParams::operator!=
bool operator!=(const SiStripDbParams &) const
Definition: SiStripDbParams.cc:94
SiStripDbParams::partition
SiStripPartitions::const_iterator partition(std::string partition_name) const
Definition: SiStripDbParams.cc:227
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
SiStripDbParams::partitions_
SiStripPartitions partitions_
Definition: SiStripDbParams.h:156
SiStripDbParams::user
std::string user() const
Definition: SiStripDbParams.h:171
SiStripDbParams::sharedMemory_
std::string sharedMemory_
Definition: SiStripDbParams.h:152
SiStripDbParams::outputFedXml_
std::string outputFedXml_
Definition: SiStripDbParams.h:164
SiStripDbParams::clearPartitions
void clearPartitions()
Definition: SiStripDbParams.h:192
SiStripDbParams::outputDcuInfoXml_
std::string outputDcuInfoXml_
Definition: SiStripDbParams.h:160
SiStripDbParams::sharedMemory
std::string sharedMemory() const
Definition: SiStripDbParams.h:175
SiStripDbParams::partitionsSize
size_type partitionsSize() const
Definition: SiStripDbParams.h:185
SiStripDbParams::outputModuleXml
std::string outputModuleXml() const
Definition: SiStripDbParams.h:187
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripConstants.h
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripDbParams::usingDb_
bool usingDb_
Definition: SiStripDbParams.h:140
SiStripDbParams::usingDb
bool usingDb() const
Definition: SiStripDbParams.h:169
SiStripDbParams::path
std::string path() const
Definition: SiStripDbParams.h:173
SiStripDbParams::user_
std::string user_
Definition: SiStripDbParams.h:144
SiStripDbParams::addPartition
void addPartition(const SiStripPartition &)
Definition: SiStripDbParams.cc:121
SiStripDbParams::outputFecXml
std::string outputFecXml() const
Definition: SiStripDbParams.h:189
SiStripDbParams::outputDcuInfoXml
std::string outputDcuInfoXml() const
Definition: SiStripDbParams.h:188
SiStripDbParams::partitions
const_iterator_range partitions() const
Definition: SiStripDbParams.h:178
SiStripDbParams::operator=
SiStripDbParams & operator=(const SiStripDbParams &)
Definition: SiStripDbParams.cc:49
SiStripDbParams::inputFedXmlFiles
std::vector< std::string > inputFedXmlFiles() const
Definition: SiStripDbParams.cc:392
SiStripDbParams::operator==
bool operator==(const SiStripDbParams &) const
Definition: SiStripDbParams.cc:70
SiStripDbParams::SiStripDbParams
SiStripDbParams()
Definition: SiStripDbParams.cc:11
SiStripDbParams::confdb
std::string confdb() const
Definition: SiStripDbParams.h:170
SiStripDbParams::usingDbCache_
bool usingDbCache_
Definition: SiStripDbParams.h:150
SiStripDbParams::const_iterator_range
boost::iterator_range< SiStripPartitions::const_iterator > const_iterator_range
Definition: SiStripDbParams.h:47
operator<<
std::ostream & operator<<(std::ostream &, const SiStripDbParams &)
Definition: SiStripDbParams.cc:347
SiStripDbParams::inputModuleXmlFiles
std::vector< std::string > inputModuleXmlFiles() const
Definition: SiStripDbParams.cc:356
SiStripDbParams::outputFedXml
std::string outputFedXml() const
Definition: SiStripDbParams.h:190
SiStripDbParams
Container class for database connection parameters.
Definition: SiStripDbParams.h:25
SiStripDbParams::inputDcuInfoXmlFiles
std::vector< std::string > inputDcuInfoXmlFiles() const
Definition: SiStripDbParams.cc:368
SiStripDbParams::outputModuleXml_
std::string outputModuleXml_
Definition: SiStripDbParams.h:158
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripDbParams::usingDbCache
bool usingDbCache() const
Definition: SiStripDbParams.h:174
ParameterSet.h
SiStripDbParams::print
void print(std::stringstream &) const
Definition: SiStripDbParams.cc:304
SiStripDbParams::pset
void pset(const edm::ParameterSet &)
Definition: SiStripDbParams.cc:151
SiStripDbParams::outputFecXml_
std::string outputFecXml_
Definition: SiStripDbParams.h:162
SiStripDbParams::confdb_
std::string confdb_
Definition: SiStripDbParams.h:142
SiStripDbParams::size_type
SiStripPartitions::size_type size_type
Definition: SiStripDbParams.h:45
SiStripDbParams::reset
void reset()
Definition: SiStripDbParams.cc:102
SiStripDbParams::passwd
std::string passwd() const
Definition: SiStripDbParams.h:172
SiStripDbParams::SiStripPartitions
std::map< std::string, SiStripPartition > SiStripPartitions
Definition: SiStripDbParams.h:43