File indexing completed on 2024-04-06 12:23:16
0001
0002 #ifndef OnlineDB_SiStripConfigDb_SiStripDbParams_h
0003 #define OnlineDB_SiStripConfigDb_SiStripDbParams_h
0004
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "OnlineDB/SiStripConfigDb/interface/SiStripPartition.h"
0008 #include "boost/range/iterator_range.hpp"
0009 #include <ostream>
0010 #include <sstream>
0011 #include <string>
0012 #include <vector>
0013 #include <map>
0014
0015 class SiStripDbParams;
0016
0017
0018 std::ostream& operator<<(std::ostream&, const SiStripDbParams&);
0019
0020
0021
0022
0023
0024
0025 class SiStripDbParams {
0026 public:
0027
0028
0029 SiStripDbParams();
0030
0031 SiStripDbParams(const SiStripDbParams&);
0032
0033 SiStripDbParams& operator=(const SiStripDbParams&);
0034
0035 bool operator==(const SiStripDbParams&) const;
0036
0037 bool operator!=(const SiStripDbParams&) const;
0038
0039 ~SiStripDbParams();
0040
0041
0042
0043 typedef std::map<std::string, SiStripPartition> SiStripPartitions;
0044
0045 typedef SiStripPartitions::size_type size_type;
0046
0047 typedef boost::iterator_range<SiStripPartitions::const_iterator> const_iterator_range;
0048
0049 typedef boost::iterator_range<SiStripPartitions::iterator> iterator_range;
0050
0051
0052
0053 bool usingDb() const;
0054
0055 std::string confdb() const;
0056
0057 std::string user() const;
0058
0059 std::string passwd() const;
0060
0061 std::string path() const;
0062
0063 bool usingDbCache() const;
0064
0065 std::string sharedMemory() const;
0066
0067 std::string tnsAdmin() const;
0068
0069
0070
0071
0072 const_iterator_range partitions() const;
0073
0074
0075 iterator_range partitions();
0076
0077
0078 SiStripPartitions::const_iterator partition(std::string partition_name) const;
0079
0080
0081 SiStripPartitions::iterator partition(std::string partition_name);
0082
0083
0084 void clearPartitions();
0085
0086
0087 void addPartition(const SiStripPartition&);
0088
0089
0090 std::vector<std::string> partitionNames() const;
0091
0092
0093 std::vector<std::string> partitionNames(std::string) const;
0094
0095
0096 std::string partitionNames(const std::vector<std::string>&) const;
0097
0098
0099 size_type partitionsSize() const;
0100
0101
0102
0103 void usingDb(bool);
0104
0105 void usingDbCache(bool);
0106
0107 void sharedMemory(std::string);
0108
0109 void pset(const edm::ParameterSet&);
0110
0111 void confdb(const std::string&);
0112
0113 void confdb(const std::string& user, const std::string& passwd, const std::string& path);
0114
0115 void reset();
0116
0117
0118
0119 std::vector<std::string> inputModuleXmlFiles() const;
0120
0121 std::vector<std::string> inputDcuInfoXmlFiles() const;
0122
0123 std::vector<std::string> inputFecXmlFiles() const;
0124
0125 std::vector<std::string> inputFedXmlFiles() const;
0126
0127 std::string outputModuleXml() const;
0128
0129 std::string outputDcuInfoXml() const;
0130
0131 std::string outputFecXml() const;
0132
0133 std::string outputFedXml() const;
0134
0135 void print(std::stringstream&) const;
0136
0137
0138
0139 private:
0140 bool usingDb_;
0141
0142 std::string confdb_;
0143
0144 std::string user_;
0145
0146 std::string passwd_;
0147
0148 std::string path_;
0149
0150 bool usingDbCache_;
0151
0152 std::string sharedMemory_;
0153
0154 std::string tnsAdmin_;
0155
0156 SiStripPartitions partitions_;
0157
0158 std::string outputModuleXml_;
0159
0160 std::string outputDcuInfoXml_;
0161
0162 std::string outputFecXml_;
0163
0164 std::string outputFedXml_;
0165 };
0166
0167
0168
0169 inline bool SiStripDbParams::usingDb() const { return usingDb_; }
0170 inline std::string SiStripDbParams::confdb() const { return confdb_; }
0171 inline std::string SiStripDbParams::user() const { return user_; }
0172 inline std::string SiStripDbParams::passwd() const { return passwd_; }
0173 inline std::string SiStripDbParams::path() const { return path_; }
0174 inline bool SiStripDbParams::usingDbCache() const { return usingDbCache_; }
0175 inline std::string SiStripDbParams::sharedMemory() const { return sharedMemory_; }
0176 inline std::string SiStripDbParams::tnsAdmin() const { return tnsAdmin_; }
0177
0178 inline SiStripDbParams::const_iterator_range SiStripDbParams::partitions() const {
0179 return const_iterator_range(partitions_.begin(), partitions_.end());
0180 }
0181 inline SiStripDbParams::iterator_range SiStripDbParams::partitions() {
0182 return iterator_range(partitions_.begin(), partitions_.end());
0183 }
0184
0185 inline SiStripDbParams::size_type SiStripDbParams::partitionsSize() const { return partitions_.size(); }
0186
0187 inline std::string SiStripDbParams::outputModuleXml() const { return outputModuleXml_; }
0188 inline std::string SiStripDbParams::outputDcuInfoXml() const { return outputDcuInfoXml_; }
0189 inline std::string SiStripDbParams::outputFecXml() const { return outputFecXml_; }
0190 inline std::string SiStripDbParams::outputFedXml() const { return outputFedXml_; }
0191
0192 inline void SiStripDbParams::clearPartitions() { partitions_.clear(); }
0193 inline void SiStripDbParams::usingDb(bool using_db) { usingDb_ = using_db; }
0194 inline void SiStripDbParams::usingDbCache(bool using_cache) { usingDbCache_ = using_cache; }
0195 inline void SiStripDbParams::sharedMemory(std::string name) { sharedMemory_ = name; }
0196
0197 #endif