1 #ifndef __DBITABLE_HPP_ 2 #define __DBITABLE_HPP_ 7 #include <unordered_map> 55 std::string dbhost=
"", std::string dbname=
"",
56 std::string dbport=
"", std::string dbuser=
"");
89 void SetDBInfo(std::string name, std::string host, std::string port,
91 void SetDBInfo(
const char* name,
const char* host,
const char* port,
118 int AddCol(std::string cname, std::string ctype);
136 { std::string cstr(cname);
return GetCol(cstr); }
150 bool WriteToCSV(std::string fname,
bool appendToFile=
false,
bool writeColNames=
false);
151 bool WriteToCSV(
const char* fname,
bool appendToFile=
false,
bool writeColNames=
false)
152 {
return WriteToCSV(std::string(fname),appendToFile,writeColNames); }
223 if (c->
Type() ==
"bool")
224 if (start != end)
return false;
237 std::stringstream startSS;
239 std::stringstream endSS;
269 friend std::ostream&
operator<< (std::ostream& stream,
const Table& t);
279 bool Tag(std::string tn=
"",
bool override=
false);
282 bool Write(
bool commit=
true);
291 std::vector<nutools::dbi::Row*>
GetVldRows(uint64_t channel);
387 std::vector<nutools::dbi::ColumnDef>
fCol;
388 std::vector<nutools::dbi::Row>
fRow;
399 std::unordered_map<uint64_t,std::vector<nutools::dbi::Row*> >
fChanRowMap;
415 for (
unsigned int j=0; j<t.
fRow.size(); ++j) {
416 stream << t.
fRow[j] << std::endl;
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.