LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "Table.h"
Public Member Functions | |
Table () | |
Table (std::string schemaName, std::string tableName, int tableType=kGenericTable, std::string dbhost="", std::string dbname="", std::string dbport="", std::string dbuser="") | |
~Table () | |
std::string | Name () |
std::string | DBName () |
std::string | DBHost () |
std::string | User () |
std::string | Role () |
std::string | DBPort () |
int | TableType () |
int | DataSource () |
int | DataTypeMask () |
void | SetTableName (std::string tname) |
void | SetTableName (const char *tname) |
void | SetDataSource (std::string ds) |
void | SetDataSource (int ids) |
bool | SetTableType (int t) |
void | SetDataTypeMask (int mask) |
void | SetIgnoreEnvVar (bool f) |
void | SetUser (std::string uname) |
void | SetUser (const char *uname) |
bool | SetRole (std::string role) |
bool | SetRole (const char *role) |
void | SetDBName (std::string dbname) |
void | SetDBName (const char *dbname) |
void | SetDBHost (std::string dbhost) |
void | SetDBHost (const char *dbhost) |
void | SetDBPort (std::string p) |
void | SetDBPort (const char *p) |
void | SetDBInfo (std::string name, std::string host, std::string port, std::string user) |
void | SetDBInfo (const char *name, const char *host, const char *port, const char *user) |
bool | SetPasswordFile (const char *fname=0) |
fname should be the name of the file More... | |
void | ClearPassword () |
void | DisablePasswordAccess () |
void | ResetRole () |
void | SetVerbosity (int i) |
int | NCol () |
int | NRow () |
void | Clear () |
void | ClearRows () |
nutools::dbi::Row *const | GetRow (int i) |
void | AddRow (const Row *row) |
void | AddRow (const Row &row) |
int | AddCol (std::string cname, std::string ctype) |
void | AddEmptyRows (unsigned int nrow) |
bool | RemoveRow (int i) |
nutools::dbi::Row *const | NewRow () |
std::vector< std::string > | GetColNames () |
std::map< std::string, int > | GetColNameToIndexMap () |
std::string | GetColName (int i) |
int | GetColIndex (std::string cname) |
const nutools::dbi::ColumnDef * | GetCol (int i) |
const nutools::dbi::ColumnDef * | GetCol (std::string &cname) |
const nutools::dbi::ColumnDef * | GetCol (const char *cname) |
void | SetTolerance (std::string &cname, float t) |
float | Tolerance (std::string &cname) |
bool | ExistsInDB () |
bool | ExecuteSQL (std::string cmd, PGresult *&res) |
bool | LoadFromCSV (std::string fname) |
bool | LoadFromCSV (const char *fname) |
bool | LoadFromDB () |
bool | WriteToDB (bool commit=true) |
use commit=false if just testing More... | |
bool | WriteToCSV (std::string fname, bool appendToFile=false, bool writeColNames=false) |
bool | WriteToCSV (const char *fname, bool appendToFile=false, bool writeColNames=false) |
void | ClearValidity () |
bool | AddDistinctColumn (unsigned int i) |
bool | AddDistinctColumn (std::string col) |
bool | AddDistinctColumn (const char *col) |
bool | RemoveDistinctColumn (unsigned int i) |
bool | RemoveDistinctColumn (std::string col) |
bool | RemoveDistinctColumn (const char *col) |
bool | AddOrderColumn (unsigned int i) |
bool | AddOrderColumn (std::string col) |
bool | AddOrderColumn (const char *col) |
bool | RemoveOrderColumn (unsigned int i) |
bool | RemoveOrderColumn (std::string col) |
bool | RemoveOrderColumn (const char *col) |
void | SetSelectLimit (int limit) |
void | SetSelectOffset (int offset) |
void | SetOrderDesc () |
void | SetOrderAsc () |
void | AddExcludeCol (std::string col) |
void | ClearExcludedCols () |
bool | GetCurrSeqVal (std::string col, long &iseq) |
bool | GetCurrSeqVal (const char *col, long &iseq) |
int | GetNPKeyCol () |
const nutools::dbi::ColumnDef * | GetPKeyCol (int i) |
void | PrintPQErrorMsg () const |
std::string | GetValiditySQL () |
void | SetValiditySQL (std::string cmd) |
bool | SetDetector (std::string det) |
bool | GetDetector (std::string &det) const |
void | SetSchema (std::string s) |
std::string | Schema () |
template<class T > | |
bool | SetValidityRange (std::string cname, T start, T end) |
template<class T > | |
bool | SetValidityRange (std::string cname, T start) |
void | RemoveValidityRange (std::string &cname) |
void | RemoveValidityRange (const char *cname) |
void | PrintColumns () |
bool | GetConnection (int ntry=0) |
bool | CloseConnection () |
void | SetConnectionTimeout (int n) |
int | GetConnectionTimeout () |
bool | ResetConnectionInfo () |
void | CacheDBCommand (std::string cmd) |
void | SetMinTSVld (double t) |
void | SetMaxTSVld (double t) |
double | GetMaxTSVld () const |
double | GetMinTSVld () const |
void | SetTag (std::string s) |
std::string | GetTag () |
bool | Tag (std::string tn="", bool override=false) |
bool | Load () |
bool | Write (bool commit=true) |
void | ClearChanRowMap () |
void | FillChanRowMap () |
int | NVldRows (uint64_t channel) |
int | NVldChannels () |
std::vector< uint64_t > | VldChannels () |
nutools::dbi::Row * | GetVldRow (uint64_t channel, double t) |
std::vector< nutools::dbi::Row * > | GetVldRows (uint64_t channel) |
void | SetRecordTime (double t) |
void | ClearRecordTime () |
void | EnableFlushCache () |
void | DisableFlushCache () |
void | DisableCache () |
void | EnableCache () |
void | SetWSURL (std::string url) |
void | SetQEURL (std::string url) |
void | SetTimeQueries (bool f) |
void | SetTimeParsing (bool f) |
bool | TimeQueries () |
bool | TimeParsing () |
void | SetMinChannel (uint64_t chan) |
void | SetMaxChannel (uint64_t chan) |
void | SetChannelRange (uint64_t chan1, uint64_t chan2) |
void | PrintVMUsed () |
void | PrintPMUsed () |
bool | GetColsFromDB (std::vector< std::string > pkeyList={}) |
void | SetFolder (std::string f) |
std::string | Folder () |
Private Member Functions | |
bool | LoadConditionsTable () |
bool | LoadUnstructuredConditionsTable () |
bool | LoadNonConditionsTable () |
bool | GetDataFromWebService (Dataset &, std::string) |
void | Reset () |
bool | GetConnectionInfo (int ntry=0) |
bool | CheckForNulls () |
bool | MakeConditionsCSVString (std::stringstream &ss) |
std::string | GetPassword () |
int | ParseSelfStatusLine (char *line) |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Table &t) |
nutools::dbi::Table::Table | ( | ) |
Definition at line 36 of file Table.cpp.
References addInsertTime, addInsertUser, addUpdateTime, addUpdateUser, fConnection, fConnectionTimeout, fDataSource, fDataTypeMask, fDBHost, fDBName, fDBPort, fDetector, fExistsInDB, fFolder, fHasConnection, fIgnoreDB, fIgnoreEnvVar, fMaxChannel, fMinChannel, fQEURL, fSchema, fTableName, fTableType, fTag, fTestedExists, fTimeParsing, fTimeQueries, fUConDBURL, fUser, fVerbosity, fWSURL, nutools::dbi::kGenericTable, nutools::dbi::kUnknownSource, and Reset().
nutools::dbi::Table::Table | ( | std::string | schemaName, |
std::string | tableName, | ||
int | tableType = kGenericTable , |
||
std::string | dbhost = "" , |
||
std::string | dbname = "" , |
||
std::string | dbport = "" , |
||
std::string | dbuser = "" |
||
) |
Definition at line 105 of file Table.cpp.
References CloseConnection(), ExistsInDB(), fCol, fConnection, fConnectionTimeout, fDataSource, fDBCacheFile, fExistsInDB, fFolder, fHasConnection, fIgnoreDB, fMaxChannel, fMinChannel, fSchema, fTimeParsing, fTimeQueries, fVerbosity, GetColsFromDB(), GetConnection(), nutools::dbi::kUnknownSource, Name(), Reset(), SetDBHost(), SetDBName(), SetDBPort(), SetTableName(), and SetUser().
nutools::dbi::Table::~Table | ( | ) |
Definition at line 237 of file Table.cpp.
References Clear(), CloseConnection(), and fHasConnection.
int nutools::dbi::Table::AddCol | ( | std::string | cname, |
std::string | ctype | ||
) |
Definition at line 333 of file Table.cpp.
References addInsertTime, addInsertUser, addUpdateTime, addUpdateUser, fCol, and Name().
Referenced by ClearRows().
bool nutools::dbi::Table::AddDistinctColumn | ( | unsigned int | i | ) |
Definition at line 2465 of file Table.cpp.
References fCol, and fDistinctCol.
Referenced by AddDistinctColumn(), and WriteToCSV().
bool nutools::dbi::Table::AddDistinctColumn | ( | std::string | col | ) |
Definition at line 2500 of file Table.cpp.
References fDistinctCol, and GetCol().
|
inline |
Definition at line 158 of file Table.h.
References AddDistinctColumn(), and RemoveDistinctColumn().
void nutools::dbi::Table::AddEmptyRows | ( | unsigned int | nrow | ) |
Definition at line 378 of file Table.cpp.
References fRow, and NewRow().
Referenced by ClearRows(), GetDataFromWebService(), LoadFromCSV(), and LoadFromDB().
|
inline |
bool nutools::dbi::Table::AddOrderColumn | ( | unsigned int | i | ) |
Definition at line 2537 of file Table.cpp.
References fCol, and fOrderCol.
Referenced by AddOrderColumn(), and RemoveDistinctColumn().
bool nutools::dbi::Table::AddOrderColumn | ( | std::string | col | ) |
Definition at line 2572 of file Table.cpp.
References fOrderCol, and GetCol().
|
inline |
void nutools::dbi::Table::AddRow | ( | const Row * | row | ) |
Definition at line 356 of file Table.cpp.
References nutools::dbi::Row::Col(), fCol, fNullList, fRow, nutools::dbi::Column::IsNull(), and Name().
Referenced by AddRow(), and ClearRows().
void nutools::dbi::Table::AddRow | ( | const Row & | row | ) |
void nutools::dbi::Table::CacheDBCommand | ( | std::string | cmd | ) |
Definition at line 438 of file Table.cpp.
References fDBCacheFile.
Referenced by GetConnectionTimeout(), and WriteToDB().
|
private |
Definition at line 422 of file Table.cpp.
References fCol, fNullList, and fVerbosity.
Referenced by Folder(), WriteToCSV(), and WriteToDB().
|
inline |
Definition at line 105 of file Table.h.
References fDistinctCol, fNullList, fOrderCol, fRow, fValidityChanged, fValidityEnd, fValiditySQL, and fValidityStart.
Referenced by ~Table().
|
inline |
Definition at line 284 of file Table.h.
References fChanRowMap, and FillChanRowMap().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 112 of file Table.h.
References AddCol(), AddEmptyRows(), AddRow(), fNullList, fRow, fValidityChanged, GetRow(), and RemoveRow().
void nutools::dbi::Table::ClearValidity | ( | ) |
Definition at line 484 of file Table.cpp.
References fValidityChanged, fValidityEnd, fValiditySQL, and fValidityStart.
Referenced by Reset(), and WriteToCSV().
bool nutools::dbi::Table::CloseConnection | ( | ) |
Definition at line 837 of file Table.cpp.
References fConnection, fHasConnection, and fVerbosity.
Referenced by ExecuteSQL(), ExistsInDB(), GetColsFromDB(), GetConnection(), GetCurrSeqVal(), LoadFromDB(), RemoveValidityRange(), Table(), WriteToDB(), and ~Table().
|
inline |
|
inline |
Definition at line 67 of file Table.h.
References fDataTypeMask, SetDataSource(), SetTableName(), and SetTableType().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool nutools::dbi::Table::ExecuteSQL | ( | std::string | cmd, |
PGresult *& | res | ||
) |
Definition at line 1030 of file Table.cpp.
References CloseConnection(), fConnection, fHasConnection, fIgnoreDB, fTimeQueries, fVerbosity, and GetConnection().
Referenced by GetCol().
bool nutools::dbi::Table::ExistsInDB | ( | ) |
Definition at line 893 of file Table.cpp.
References CloseConnection(), fConnection, fExistsInDB, fHasConnection, fIgnoreDB, fSchema, fTableType, fTestedExists, fVerbosity, GetConnection(), nutools::dbi::kConditionsTable, and Name().
Referenced by GetCol(), LoadFromDB(), Table(), and WriteToDB().
void nutools::dbi::Table::FillChanRowMap | ( | ) |
Definition at line 1989 of file Table.cpp.
References util::begin(), nutools::dbi::Row::Channel(), util::empty(), fChannelVec, fChanRowMap, GetRow(), NRow(), and nutools::dbi::Row::VldTime().
Referenced by ClearChanRowMap().
|
inline |
Definition at line 321 of file Table.h.
References CheckForNulls(), fFolder, GetConnectionInfo(), GetDataFromWebService(), GetPassword(), LoadConditionsTable(), LoadNonConditionsTable(), LoadUnstructuredConditionsTable(), MakeConditionsCSVString(), ParseSelfStatusLine(), and Reset().
Referenced by LoadUnstructuredConditionsTable().
|
inline |
Definition at line 133 of file Table.h.
References fCol.
Referenced by AddDistinctColumn(), AddOrderColumn(), GetCol(), LoadConditionsTable(), LoadNonConditionsTable(), MakeConditionsCSVString(), PrintColumns(), RemoveDistinctColumn(), RemoveOrderColumn(), and SetValidityRange().
const nutools::dbi::ColumnDef * nutools::dbi::Table::GetCol | ( | std::string & | cname | ) |
|
inline |
Definition at line 135 of file Table.h.
References ExecuteSQL(), ExistsInDB(), GetCol(), LoadFromCSV(), SetTolerance(), and Tolerance().
int nutools::dbi::Table::GetColIndex | ( | std::string | cname | ) |
|
inline |
std::vector< std::string > nutools::dbi::Table::GetColNames | ( | ) |
std::map< std::string, int > nutools::dbi::Table::GetColNameToIndexMap | ( | ) |
bool nutools::dbi::Table::GetColsFromDB | ( | std::vector< std::string > | pkeyList = {} | ) |
Definition at line 245 of file Table.cpp.
References addInsertTime, addInsertUser, addUpdateTime, addUpdateUser, CloseConnection(), fCol, fConnection, fExistsInDB, fHasConnection, fSchema, fTableName, fTableType, fVerbosity, GetConnection(), nutools::dbi::kConditionsTable, nutools::dbi::kUnstructuredConditionsTable, and nutools::dbi::ColumnDef::SetCanBeNull().
Referenced by main(), SetChannelRange(), and Table().
bool nutools::dbi::Table::GetConnection | ( | int | ntry = 0 | ) |
Definition at line 759 of file Table.cpp.
References CloseConnection(), e, fConnection, fConnectionTimeout, fDBHost, fDBName, fDBPort, fHasConnection, fIgnoreDB, fPassword, fUser, fVerbosity, GetConnectionInfo(), nutools::dbi::Util::RunningOnGrid(), SetPasswordFile(), and t1.
Referenced by ExecuteSQL(), ExistsInDB(), GetColsFromDB(), GetCurrSeqVal(), LoadFromDB(), RemoveValidityRange(), Table(), and WriteToDB().
|
private |
Definition at line 699 of file Table.cpp.
References fDBHost, fDBName, fDBPort, fIgnoreEnvVar, and fUser.
Referenced by Folder(), GetConnection(), and WriteToDB().
|
inline |
Definition at line 264 of file Table.h.
References CacheDBCommand(), fConnectionTimeout, operator<<, and ResetConnectionInfo().
bool nutools::dbi::Table::GetCurrSeqVal | ( | std::string | col, |
long & | iseq | ||
) |
Definition at line 970 of file Table.cpp.
References CloseConnection(), fConnection, fHasConnection, fIgnoreDB, fVerbosity, GetConnection(), Name(), and Schema().
Referenced by ClearExcludedCols(), GetCurrSeqVal(), and WriteToDB().
|
inline |
Definition at line 184 of file Table.h.
References GetCurrSeqVal().
|
private |
Definition at line 1572 of file Table.cpp.
References AddEmptyRows(), fCol, fConnectionTimeout, fRow, fTimeParsing, fTimeQueries, fVerbosity, Name(), and t1.
Referenced by Folder(), LoadConditionsTable(), and LoadNonConditionsTable().
bool nutools::dbi::Table::GetDetector | ( | std::string & | det | ) | const |
|
inline |
|
inline |
|
inline |
Definition at line 189 of file Table.h.
References fPKeyList.
|
private |
|
inline |
Definition at line 190 of file Table.h.
References fPKeyList, and PrintPQErrorMsg().
Row *const nutools::dbi::Table::GetRow | ( | int | i | ) |
Definition at line 413 of file Table.cpp.
References fRow.
Referenced by ClearRows(), FillChanRowMap(), and MakeConditionsCSVString().
|
inline |
|
inline |
nutools::dbi::Row * nutools::dbi::Table::GetVldRow | ( | uint64_t | channel, |
double | t | ||
) |
Definition at line 2035 of file Table.cpp.
References fChanRowMap.
Referenced by VldChannels().
std::vector< nutools::dbi::Row * > nutools::dbi::Table::GetVldRows | ( | uint64_t | channel | ) |
Definition at line 2028 of file Table.cpp.
References fChanRowMap.
Referenced by VldChannels().
bool nutools::dbi::Table::Load | ( | ) |
Definition at line 1971 of file Table.cpp.
References fConnectionTimeout, fTableType, nutools::dbi::kConditionsTable, nutools::dbi::kUnstructuredConditionsTable, LoadConditionsTable(), LoadNonConditionsTable(), LoadUnstructuredConditionsTable(), and nutools::dbi::Util::RunningOnGrid().
Referenced by GetTag(), and main().
|
private |
Definition at line 1880 of file Table.cpp.
References fDataTypeMask, fDisableCache, fExcludeCol, fFlushCache, fHasRecordTime, fMaxChannel, fMaxTSVld, fMinChannel, fMinTSVld, fRecordTime, fTag, fValiditySQL, fWSURL, GetCol(), GetDataFromWebService(), nutools::dbi::kDataOnly, nutools::dbi::kMCOnly, nutools::dbi::kNone, nutools::dbi::ColumnDef::Name(), Name(), NCol(), nutools::dbi::Util::RunningOnGrid(), and Schema().
Referenced by Folder(), and Load().
bool nutools::dbi::Table::LoadFromCSV | ( | std::string | fname | ) |
Definition at line 1298 of file Table.cpp.
References AddEmptyRows(), fCol, fin, fRow, fTableType, nutools::dbi::kConditionsTable, Name(), NewRow(), r, and value.
Referenced by GetCol(), LoadFromCSV(), and main().
|
inline |
Definition at line 145 of file Table.h.
References LoadFromCSV(), LoadFromDB(), WriteToCSV(), and WriteToDB().
bool nutools::dbi::Table::LoadFromDB | ( | ) |
Definition at line 1072 of file Table.cpp.
References AddEmptyRows(), CloseConnection(), ExistsInDB(), fCol, fConnection, fDescOrder, fDistinctCol, fHasConnection, fIgnoreDB, fOrderCol, fRow, fSchema, fSelectLimit, fSelectOffset, fTimeParsing, fTimeQueries, fValidityChanged, fValidityEnd, fValiditySQL, fValidityStart, fVerbosity, GetConnection(), Name(), and Schema().
Referenced by LoadFromCSV(), and LoadNonConditionsTable().
|
private |
Definition at line 1758 of file Table.cpp.
References fDescOrder, fDisableCache, fExcludeCol, fFlushCache, fOrderCol, fQEURL, fSelectLimit, fValidityEnd, fValiditySQL, fValidityStart, GetCol(), GetDataFromWebService(), LoadFromDB(), nutools::dbi::ColumnDef::Name(), Name(), NCol(), and Schema().
Referenced by Folder(), and Load().
|
private |
Definition at line 1850 of file Table.cpp.
References fMaxTSVld, fMinTSVld, Folder(), fUConDBURL, Name(), and nutools::dbi::Util::RunningOnGrid().
Referenced by Folder(), and Load().
|
private |
Definition at line 2305 of file Table.cpp.
References nutools::dbi::Row::Channel(), nutools::dbi::Row::Col(), GetCol(), GetRow(), nutools::dbi::ColumnDef::Name(), NCol(), NRow(), Tolerance(), nutools::dbi::ColumnDef::Type(), nutools::dbi::Row::VldTime(), and nutools::dbi::Row::VldTimeEnd().
Referenced by Folder(), Write(), and WriteToCSV().
|
inline |
Definition at line 59 of file Table.h.
References fTableName.
Referenced by AddCol(), AddRow(), ExistsInDB(), GetCol(), GetColIndex(), GetCurrSeqVal(), GetDataFromWebService(), LoadConditionsTable(), LoadFromCSV(), LoadFromDB(), LoadNonConditionsTable(), LoadUnstructuredConditionsTable(), PrintPMUsed(), PrintVMUsed(), RemoveValidityRange(), SetTolerance(), SetValidityRange(), Table(), Tag(), Tolerance(), Write(), and WriteToDB().
|
inline |
Definition at line 102 of file Table.h.
References fCol.
Referenced by LoadConditionsTable(), LoadNonConditionsTable(), MakeConditionsCSVString(), and PrintColumns().
|
inline |
Definition at line 126 of file Table.h.
References fCol, GetColNames(), GetColNameToIndexMap(), and r.
Referenced by AddEmptyRows(), and LoadFromCSV().
|
inline |
Definition at line 103 of file Table.h.
References fRow.
Referenced by FillChanRowMap(), and MakeConditionsCSVString().
|
inline |
Definition at line 287 of file Table.h.
References fChanRowMap.
|
inline |
Definition at line 286 of file Table.h.
References fChanRowMap.
|
private |
Definition at line 1522 of file Table.cpp.
Referenced by Folder(), PrintPMUsed(), and PrintVMUsed().
void nutools::dbi::Table::PrintColumns | ( | ) |
Definition at line 645 of file Table.cpp.
References GetCol(), art::left(), nutools::dbi::ColumnDef::Name(), NCol(), and nutools::dbi::ColumnDef::Type().
Referenced by RemoveValidityRange().
void nutools::dbi::Table::PrintPMUsed | ( | ) |
Definition at line 1553 of file Table.cpp.
References fclose(), file, Name(), ParseSelfStatusLine(), and Schema().
Referenced by SetChannelRange().
void nutools::dbi::Table::PrintPQErrorMsg | ( | ) | const |
void nutools::dbi::Table::PrintVMUsed | ( | ) |
Definition at line 1534 of file Table.cpp.
References fclose(), file, Name(), ParseSelfStatusLine(), and Schema().
Referenced by SetChannelRange().
bool nutools::dbi::Table::RemoveDistinctColumn | ( | unsigned int | i | ) |
Definition at line 2482 of file Table.cpp.
References fCol, and fDistinctCol.
Referenced by AddDistinctColumn(), and RemoveDistinctColumn().
bool nutools::dbi::Table::RemoveDistinctColumn | ( | std::string | col | ) |
Definition at line 2518 of file Table.cpp.
References fDistinctCol, and GetCol().
|
inline |
Definition at line 162 of file Table.h.
References AddOrderColumn(), and RemoveDistinctColumn().
bool nutools::dbi::Table::RemoveOrderColumn | ( | unsigned int | i | ) |
Definition at line 2554 of file Table.cpp.
References fCol, and fOrderCol.
Referenced by AddOrderColumn(), and RemoveOrderColumn().
bool nutools::dbi::Table::RemoveOrderColumn | ( | std::string | col | ) |
Definition at line 2590 of file Table.cpp.
References fOrderCol, and GetCol().
|
inline |
Definition at line 171 of file Table.h.
References RemoveOrderColumn().
bool nutools::dbi::Table::RemoveRow | ( | int | i | ) |
note, this will only delete a row from memory, it will not delete an existing row in a dB!
Definition at line 392 of file Table.cpp.
References fNullList, and fRow.
Referenced by ClearRows().
void nutools::dbi::Table::RemoveValidityRange | ( | std::string & | cname | ) |
Definition at line 2451 of file Table.cpp.
References fValidityEnd, fValidityStart, and Name().
Referenced by RemoveValidityRange(), and SetValidityRange().
|
inline |
Definition at line 256 of file Table.h.
References CloseConnection(), fValidityChanged, GetConnection(), PrintColumns(), and RemoveValidityRange().
|
private |
Definition at line 467 of file Table.cpp.
References ClearValidity(), fConnection, fDescOrder, fDistinctCol, fExcludeCol, fHasConnection, fMaxChannel, fMinChannel, fPKeyList, fSelectLimit, fSelectOffset, and fVerbosity.
Referenced by Folder(), and Table().
bool nutools::dbi::Table::ResetConnectionInfo | ( | ) |
Referenced by GetConnectionTimeout().
|
inline |
|
inline |
Definition at line 215 of file Table.h.
References fSchema.
Referenced by GetCurrSeqVal(), LoadConditionsTable(), LoadFromDB(), LoadNonConditionsTable(), PrintPMUsed(), PrintVMUsed(), Tag(), Write(), and WriteToDB().
|
inline |
Definition at line 312 of file Table.h.
References fMaxChannel, fMinChannel, GetColsFromDB(), PrintPMUsed(), and PrintVMUsed().
|
inline |
void nutools::dbi::Table::SetDataSource | ( | std::string | ds | ) |
Definition at line 537 of file Table.cpp.
References nutools::dbi::kDAQ, nutools::dbi::kDCS, nutools::dbi::kOffline, and nutools::dbi::kUnknownSource.
Referenced by nutools::dbi::DBIService::CreateTable(), and DataTypeMask().
void nutools::dbi::Table::SetDataSource | ( | int | ids | ) |
Definition at line 549 of file Table.cpp.
References fDataSource, nutools::dbi::kNDataSources, and nutools::dbi::kUnknownSource.
|
inline |
|
inline |
|
inline |
void nutools::dbi::Table::SetDBInfo | ( | std::string | name, |
std::string | host, | ||
std::string | port, | ||
std::string | user | ||
) |
Definition at line 557 of file Table.cpp.
References SetDBHost(), SetDBName(), SetDBPort(), and SetUser().
Referenced by SetDBPort().
void nutools::dbi::Table::SetDBInfo | ( | const char * | name, |
const char * | host, | ||
const char * | port, | ||
const char * | user | ||
) |
Definition at line 567 of file Table.cpp.
References SetDBHost(), SetDBName(), SetDBPort(), and SetUser().
|
inline |
|
inline |
|
inline |
|
inline |
bool nutools::dbi::Table::SetDetector | ( | std::string | det | ) |
Definition at line 500 of file Table.cpp.
References fDetector, fSchema, fTableType, and nutools::dbi::kHardwareTable.
Referenced by nutools::dbi::DBIService::CreateTable(), main(), and SetValiditySQL().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool nutools::dbi::Table::SetPasswordFile | ( | const char * | fname = 0 | ) |
fname should be the name of the file
Definition at line 859 of file Table.cpp.
References fin, and fPassword.
Referenced by GetConnection(), and SetDBPort().
|
inline |
Definition at line 303 of file Table.h.
References fQEURL.
Referenced by nutools::dbi::DBIService::CreateTable().
void nutools::dbi::Table::SetRecordTime | ( | double | t | ) |
Definition at line 450 of file Table.cpp.
References fHasRecordTime, and fRecordTime.
Referenced by VldChannels().
bool nutools::dbi::Table::SetRole | ( | std::string | role | ) |
bool nutools::dbi::Table::SetRole | ( | const char * | role | ) |
|
inline |
|
inline |
|
inline |
void nutools::dbi::Table::SetTableName | ( | std::string | tname | ) |
Definition at line 524 of file Table.cpp.
References fTableName.
Referenced by nutools::dbi::DBIService::CreateTable(), DataTypeMask(), main(), and Table().
void nutools::dbi::Table::SetTableName | ( | const char * | tname | ) |
bool nutools::dbi::Table::SetTableType | ( | int | t | ) |
Definition at line 458 of file Table.cpp.
References fTableType, and nutools::dbi::kNTableType.
Referenced by nutools::dbi::DBIService::CreateTable(), DataTypeMask(), and main().
|
inline |
|
inline |
Definition at line 306 of file Table.h.
References f, and fTimeParsing.
Referenced by nutools::dbi::DBIService::CreateTable().
|
inline |
Definition at line 305 of file Table.h.
References f, and fTimeQueries.
Referenced by nutools::dbi::DBIService::CreateTable().
void nutools::dbi::Table::SetTolerance | ( | std::string & | cname, |
float | t | ||
) |
|
inline |
Definition at line 79 of file Table.h.
References fUser.
Referenced by nutools::dbi::DBIService::CreateTable(), SetDBInfo(), and Table().
|
inline |
|
inline |
Definition at line 218 of file Table.h.
References util::end(), fValidityChanged, fValidityEnd, fValidityStart, GetCol(), nutools::dbi::ColumnDef::Name(), Name(), and nutools::dbi::ColumnDef::Type().
Referenced by SetValidityRange().
|
inline |
Definition at line 251 of file Table.h.
References RemoveValidityRange(), and SetValidityRange().
|
inline |
Definition at line 209 of file Table.h.
References fValidityChanged, fValiditySQL, GetDetector(), and SetDetector().
|
inline |
Definition at line 100 of file Table.h.
References fVerbosity.
Referenced by nutools::dbi::DBIService::CreateTable(), and main().
|
inline |
Definition at line 302 of file Table.h.
References fWSURL.
Referenced by nutools::dbi::DBIService::CreateTable().
|
inline |
bool nutools::dbi::Table::Tag | ( | std::string | tn = "" , |
bool | override = false |
||
) |
|
inline |
|
inline |
float nutools::dbi::Table::Tolerance | ( | std::string & | cname | ) |
|
inline |
|
inline |
Definition at line 288 of file Table.h.
References fChannelVec, GetVldRow(), GetVldRows(), and SetRecordTime().
bool nutools::dbi::Table::Write | ( | bool | commit = true | ) |
Definition at line 2356 of file Table.cpp.
References fDataTypeMask, fTimeQueries, fVerbosity, fWSURL, GetPassword(), nutools::dbi::kDataOnly, nutools::dbi::kMCOnly, MakeConditionsCSVString(), Name(), nutools::dbi::Util::RunningOnGrid(), and Schema().
Referenced by GetTag(), and main().
bool nutools::dbi::Table::WriteToCSV | ( | std::string | fname, |
bool | appendToFile = false , |
||
bool | writeColNames = false |
||
) |
Definition at line 2412 of file Table.cpp.
References CheckForNulls(), fCol, fRow, fTableType, nutools::dbi::kConditionsTable, and MakeConditionsCSVString().
Referenced by LoadFromCSV(), main(), and WriteToCSV().
|
inline |
Definition at line 151 of file Table.h.
References AddDistinctColumn(), ClearValidity(), col, and WriteToCSV().
bool nutools::dbi::Table::WriteToDB | ( | bool | commit = true | ) |
use commit=false if just testing
Definition at line 2075 of file Table.cpp.
References addInsertTime, addInsertUser, addUpdateTime, addUpdateUser, CacheDBCommand(), CheckForNulls(), CloseConnection(), nutools::dbi::Row::Col(), e, ExistsInDB(), fCol, fConnection, fHasConnection, fIgnoreDB, fPKeyList, fRow, fSchema, fTimeQueries, fUser, fVerbosity, GetColNameToIndexMap(), GetConnection(), GetConnectionInfo(), nutools::dbi::Util::GetCurrentTimeAsString(), GetCurrSeqVal(), nutools::dbi::Column::Modified(), Name(), nutools::dbi::Row::NModified(), r, Schema(), nutools::dbi::Row::Set(), and nutools::dbi::Row::Update().
Referenced by LoadFromCSV().
|
friend |
Definition at line 414 of file Table.h.
Referenced by GetConnectionTimeout().
|
private |
Definition at line 341 of file Table.h.
Referenced by AddCol(), GetColsFromDB(), Table(), and WriteToDB().
|
private |
Definition at line 342 of file Table.h.
Referenced by AddCol(), GetColsFromDB(), Table(), and WriteToDB().
|
private |
Definition at line 343 of file Table.h.
Referenced by AddCol(), GetColsFromDB(), Table(), and WriteToDB().
|
private |
Definition at line 344 of file Table.h.
Referenced by AddCol(), GetColsFromDB(), Table(), and WriteToDB().
|
private |
Definition at line 398 of file Table.h.
Referenced by FillChanRowMap(), and VldChannels().
|
private |
Definition at line 399 of file Table.h.
Referenced by ClearChanRowMap(), FillChanRowMap(), GetVldRow(), GetVldRows(), NVldChannels(), and NVldRows().
|
private |
Definition at line 387 of file Table.h.
Referenced by AddCol(), AddDistinctColumn(), AddOrderColumn(), AddRow(), CheckForNulls(), GetCol(), GetColIndex(), GetColName(), GetColNames(), GetColNameToIndexMap(), GetColsFromDB(), GetDataFromWebService(), LoadFromCSV(), LoadFromDB(), NCol(), NewRow(), RemoveDistinctColumn(), RemoveOrderColumn(), SetTolerance(), Table(), Tolerance(), WriteToCSV(), and WriteToDB().
|
private |
Definition at line 401 of file Table.h.
Referenced by CloseConnection(), ExecuteSQL(), ExistsInDB(), GetColsFromDB(), GetConnection(), GetCurrSeqVal(), LoadFromDB(), PrintPQErrorMsg(), Reset(), Table(), and WriteToDB().
|
private |
Definition at line 361 of file Table.h.
Referenced by GetConnection(), GetConnectionTimeout(), GetDataFromWebService(), Load(), SetConnectionTimeout(), and Table().
|
private |
Definition at line 364 of file Table.h.
Referenced by DataSource(), SetDataSource(), and Table().
|
private |
Definition at line 363 of file Table.h.
Referenced by DataTypeMask(), LoadConditionsTable(), SetDataTypeMask(), Table(), and Write().
|
private |
Definition at line 376 of file Table.h.
Referenced by CacheDBCommand(), and Table().
|
private |
Definition at line 372 of file Table.h.
Referenced by DBHost(), GetConnection(), GetConnectionInfo(), SetDBHost(), and Table().
|
private |
Definition at line 373 of file Table.h.
Referenced by DBName(), GetConnection(), GetConnectionInfo(), SetDBName(), and Table().
|
private |
Definition at line 371 of file Table.h.
Referenced by DBPort(), GetConnection(), GetConnectionInfo(), SetDBPort(), and Table().
|
private |
Definition at line 347 of file Table.h.
Referenced by LoadFromDB(), LoadNonConditionsTable(), Reset(), SetOrderAsc(), and SetOrderDesc().
|
private |
Definition at line 379 of file Table.h.
Referenced by GetDetector(), SetDetector(), and Table().
|
private |
Definition at line 354 of file Table.h.
Referenced by DisableCache(), EnableCache(), LoadConditionsTable(), and LoadNonConditionsTable().
|
private |
Definition at line 393 of file Table.h.
Referenced by AddDistinctColumn(), Clear(), LoadFromDB(), RemoveDistinctColumn(), and Reset().
|
private |
Definition at line 396 of file Table.h.
Referenced by AddExcludeCol(), ClearExcludedCols(), LoadConditionsTable(), LoadNonConditionsTable(), and Reset().
|
private |
Definition at line 350 of file Table.h.
Referenced by ExistsInDB(), GetColsFromDB(), and Table().
|
private |
Definition at line 353 of file Table.h.
Referenced by DisableFlushCache(), EnableFlushCache(), LoadConditionsTable(), and LoadNonConditionsTable().
|
private |
Definition at line 380 of file Table.h.
Referenced by Folder(), SetFolder(), and Table().
|
private |
Definition at line 351 of file Table.h.
Referenced by CloseConnection(), ExecuteSQL(), ExistsInDB(), GetColsFromDB(), GetConnection(), GetCurrSeqVal(), LoadFromDB(), Reset(), Table(), WriteToDB(), and ~Table().
|
private |
Definition at line 352 of file Table.h.
Referenced by ClearRecordTime(), LoadConditionsTable(), and SetRecordTime().
|
private |
Definition at line 348 of file Table.h.
Referenced by ExecuteSQL(), ExistsInDB(), GetConnection(), GetCurrSeqVal(), LoadFromDB(), Table(), and WriteToDB().
|
private |
Definition at line 345 of file Table.h.
Referenced by GetConnectionInfo(), SetIgnoreEnvVar(), and Table().
|
private |
Definition at line 366 of file Table.h.
Referenced by LoadConditionsTable(), Reset(), SetChannelRange(), SetMaxChannel(), and Table().
|
private |
Definition at line 405 of file Table.h.
Referenced by GetMaxTSVld(), LoadConditionsTable(), LoadUnstructuredConditionsTable(), and SetMaxTSVld().
|
private |
Definition at line 365 of file Table.h.
Referenced by LoadConditionsTable(), Reset(), SetChannelRange(), SetMinChannel(), and Table().
|
private |
Definition at line 406 of file Table.h.
Referenced by GetMinTSVld(), LoadConditionsTable(), LoadUnstructuredConditionsTable(), and SetMinTSVld().
|
private |
Definition at line 395 of file Table.h.
Referenced by AddRow(), CheckForNulls(), Clear(), ClearRows(), and RemoveRow().
|
private |
Definition at line 394 of file Table.h.
Referenced by AddOrderColumn(), Clear(), LoadFromDB(), LoadNonConditionsTable(), and RemoveOrderColumn().
|
private |
Definition at line 377 of file Table.h.
Referenced by ClearPassword(), DisablePasswordAccess(), GetConnection(), and SetPasswordFile().
|
private |
Definition at line 392 of file Table.h.
Referenced by GetNPKeyCol(), GetPKeyCol(), Reset(), and WriteToDB().
|
private |
Definition at line 385 of file Table.h.
Referenced by LoadNonConditionsTable(), SetQEURL(), and Table().
|
private |
Definition at line 407 of file Table.h.
Referenced by LoadConditionsTable(), and SetRecordTime().
|
private |
Definition at line 370 of file Table.h.
Referenced by ResetRole(), Role(), and SetRole().
|
private |
Definition at line 388 of file Table.h.
Referenced by AddEmptyRows(), AddRow(), Clear(), ClearRows(), GetDataFromWebService(), GetRow(), LoadFromCSV(), LoadFromDB(), NRow(), nutools::dbi::operator<<(), RemoveRow(), WriteToCSV(), and WriteToDB().
|
private |
Definition at line 374 of file Table.h.
Referenced by ExistsInDB(), GetColsFromDB(), LoadFromDB(), Schema(), SetDetector(), SetSchema(), Table(), and WriteToDB().
|
private |
Definition at line 359 of file Table.h.
Referenced by LoadFromDB(), LoadNonConditionsTable(), Reset(), and SetSelectLimit().
|
private |
Definition at line 360 of file Table.h.
Referenced by LoadFromDB(), Reset(), and SetSelectOffset().
|
private |
Definition at line 368 of file Table.h.
Referenced by GetColsFromDB(), Name(), SetTableName(), and Table().
|
private |
Definition at line 362 of file Table.h.
Referenced by ExistsInDB(), GetColsFromDB(), Load(), LoadFromCSV(), SetDetector(), SetTableType(), Table(), TableType(), and WriteToCSV().
|
private |
|
private |
Definition at line 349 of file Table.h.
Referenced by ExistsInDB(), and Table().
|
private |
Definition at line 356 of file Table.h.
Referenced by GetDataFromWebService(), LoadFromDB(), SetTimeParsing(), Table(), and TimeParsing().
|
private |
Definition at line 355 of file Table.h.
Referenced by ExecuteSQL(), GetDataFromWebService(), LoadFromDB(), SetTimeQueries(), Table(), TimeQueries(), Write(), and WriteToDB().
|
private |
Definition at line 384 of file Table.h.
Referenced by LoadUnstructuredConditionsTable(), and Table().
|
private |
Definition at line 369 of file Table.h.
Referenced by GetConnection(), GetConnectionInfo(), ResetRole(), SetUser(), Table(), User(), and WriteToDB().
|
private |
Definition at line 346 of file Table.h.
Referenced by Clear(), ClearRows(), ClearValidity(), LoadFromDB(), RemoveValidityRange(), SetValidityRange(), and SetValiditySQL().
|
private |
Definition at line 391 of file Table.h.
Referenced by Clear(), ClearValidity(), LoadFromDB(), LoadNonConditionsTable(), RemoveValidityRange(), and SetValidityRange().
|
private |
Definition at line 378 of file Table.h.
Referenced by Clear(), ClearValidity(), GetValiditySQL(), LoadConditionsTable(), LoadFromDB(), LoadNonConditionsTable(), and SetValiditySQL().
|
private |
Definition at line 390 of file Table.h.
Referenced by Clear(), ClearValidity(), LoadFromDB(), LoadNonConditionsTable(), RemoveValidityRange(), and SetValidityRange().
|
private |
Definition at line 357 of file Table.h.
Referenced by CheckForNulls(), CloseConnection(), ExecuteSQL(), ExistsInDB(), GetColsFromDB(), GetConnection(), GetCurrSeqVal(), GetDataFromWebService(), LoadFromDB(), Reset(), SetVerbosity(), Table(), Write(), and WriteToDB().
|
private |
Definition at line 383 of file Table.h.
Referenced by LoadConditionsTable(), SetWSURL(), Table(), Tag(), and Write().