13 #include "cetlib_except/exception.h" 40 tup = getTuple(dataset, 0);
50 tup = getTuple(dataset, 1);
52 if (0 == strcmp(buf,
"-"))
63 tup = getTuple(dataset, 2);
64 size_t ncols = getNfields(tup);
76 tup = getTuple(dataset, 3);
87 fData.reserve(nrows * ncols);
88 for (
size_t row = 0; row <
nrows; ++row) {
100 long value = strtol(buf, 0, 10);
110 double value = strtod(buf, 0);
115 mf::LogError(
"DBDataset") <<
"First column has wrong type real." 117 throw cet::exception(
"DBDataset") <<
"First column has wrong type real.";
121 fData.emplace_back(std::make_unique<std::string>(buf));
125 mf::LogError(
"DBDataset") <<
"First column has wrong type text." 127 throw cet::exception(
"DBDataset") <<
"First column has wrong type text.";
132 std::string s = std::string(buf);
133 if (s ==
"true" || s ==
"True" || s ==
"TRUE" || s ==
"1")
135 else if (s ==
"false" || s ==
"False" || s ==
"FALSE" || s ==
"0")
138 mf::LogError(
"DBDataset") <<
"Unknown string representation of boolean " << s <<
"\n";
140 <<
"Unknown string representation of boolean " << s <<
"\n";
146 mf::LogError(
"DBDataset") <<
"First column has wrong type boolean." 148 throw cet::exception(
"DBDataset") <<
"First column has wrong type boolean.";
154 <<
"Unknown datatype = " <<
fColTypes[
col] <<
": " << buf <<
"\n";
162 if (release) releaseDataset(dataset);
169 std::vector<std::string>&& col_names,
170 std::vector<std::string>&& col_types,
171 std::vector<DBChannelID_t>&&
channels,
172 std::vector<value_type>&&
data)
193 while (high - low > 1) {
194 int mid = (low + high) / 2;
231 for (
size_t i = 0; i <
fColNames.size(); ++i) {
const unsigned int kNUMBER_HEADER_ROWS
std::variant< long, double, std::unique_ptr< std::string > > value_type
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::vector< std::string > fColNames
int getRowNumber(DBChannelID_t ch) const
const std::vector< value_type > & data() const
std::vector< std::string > fColTypes
std::vector< value_type > fData
const unsigned int kBUFFER_SIZE
std::vector< DBChannelID_t > fChannels
const std::vector< DBChannelID_t > & channels() const
int getColNumber(const std::string &name) const
static IOVTimeStamp GetFromString(const std::string &ts)
static IOVTimeStamp MaxTimeStamp()
cet::coded_exception< error, detail::translate > exception