15 #include "cetlib_except/exception.h" 46 tup = getTuple(dataset, 0);
56 tup = getTuple(dataset, 1);
58 if ( 0 ==
strcmp(buf,
"-") )
69 tup = getTuple(dataset, 2);
70 size_t ncols = getNfields(tup);
73 for (
size_t col=0; col<
ncols; ++col) {
82 tup = getTuple(dataset, 3);
84 for (
size_t col=0; col <
ncols; ++col) {
93 fData.reserve(nrows * ncols);
100 for(
size_t col = 0; col <
ncols; ++col) {
106 long value = strtol(buf, 0, 10);
116 double value = strtod(buf, 0);
121 mf::LogError(
"DBDataset") <<
"First column has wrong type real." <<
"\n";
122 throw cet::exception(
"DBDataset") <<
"First column has wrong type real.";
126 fData.emplace_back(std::make_unique<std::string>(buf));
130 mf::LogError(
"DBDataset") <<
"First column has wrong type text." <<
"\n";
131 throw cet::exception(
"DBDataset") <<
"First column has wrong type text.";
137 if(s ==
"true" || s ==
"True" || s ==
"TRUE" || s ==
"1")
139 else if(s ==
"false" || s ==
"False" || s ==
"FALSE" || s ==
"0")
142 mf::LogError(
"DBDataset") <<
"Unknown string representation of boolean " << s <<
"\n";
143 throw cet::exception(
"DBDataset") <<
"Unknown string representation of boolean " << s
150 mf::LogError(
"DBDataset") <<
"First column has wrong type boolean." <<
"\n";
151 throw cet::exception(
"DBDataset") <<
"First column has wrong type boolean.";
157 <<
": " << buf <<
"\n";
166 releaseDataset(dataset);
173 std::vector<std::string>&& col_names,
174 std::vector<std::string>&& col_types,
175 std::vector<DBChannelID_t>&&
channels,
176 std::vector<value_type>&&
data) :
196 while(high-low > 1) {
197 int mid = (low + high) / 2;
234 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
std::uint32_t DBChannelID_t
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
void err(const char *fmt,...)
const unsigned int kBUFFER_SIZE
std::vector< DBChannelID_t > fChannels
const std::vector< DBChannelID_t > & channels() const
int strcmp(const String &s1, const String &s2)
int getColNumber(const std::string &name) const
static IOVTimeStamp GetFromString(const std::string &ts)
static IOVTimeStamp MaxTimeStamp()
cet::coded_exception< error, detail::translate > exception