LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
nutools::dbi::DBIService Class Reference

Simple service to provide a RunHistory configured to the right run. More...

#include "DBIService.h"

Inheritance diagram for nutools::dbi::DBIService:
evdb::Reconfigurable

Public Member Functions

 DBIService (const fhicl::ParameterSet &pset)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
TableCreateTable (std::string tableName="", std::string schemaName="", int tableType=nutools::dbi::kConditionsTable, int dataSource=nutools::dbi::kOffline)
 
void do_reconfigure (fhicl::ParameterSet const &pset)
 

Protected Attributes

int fVerbosity
 
bool fTimeQueries
 
bool fTimeParsing
 
std::string fWebServiceURL
 
std::string fQueryEngineURL
 
std::string fDBUser
 

Detailed Description

Simple service to provide a RunHistory configured to the right run.

Definition at line 25 of file DBIService.h.

Constructor & Destructor Documentation

nutools::dbi::DBIService::DBIService ( const fhicl::ParameterSet pset)

Definition at line 18 of file DBI.cc.

References reconfigure().

18  : evdb::Reconfigurable{pset}
19  {
20  reconfigure(pset);
21  }
void reconfigure(const fhicl::ParameterSet &pset)
Definition: DBI.cc:24

Member Function Documentation

Table * nutools::dbi::DBIService::CreateTable ( std::string  tableName = "",
std::string  schemaName = "",
int  tableType = nutools::dbi::kConditionsTable,
int  dataSource = nutools::dbi::kOffline 
)

Definition at line 36 of file DBI.cc.

References fDBUser, fQueryEngineURL, fTimeParsing, fTimeQueries, fVerbosity, fWebServiceURL, nutools::dbi::kConditionsTable, nutools::dbi::kNDataSources, nutools::dbi::kNTableType, nutools::dbi::kOffline, nutools::dbi::Table::SetDataSource(), nutools::dbi::Table::SetDetector(), nutools::dbi::Table::SetQEURL(), nutools::dbi::Table::SetTableName(), nutools::dbi::Table::SetTableType(), nutools::dbi::Table::SetTimeParsing(), nutools::dbi::Table::SetTimeQueries(), nutools::dbi::Table::SetUser(), nutools::dbi::Table::SetVerbosity(), and nutools::dbi::Table::SetWSURL().

39  {
40  if (tableName.empty()) return 0;
41 
42  Table* t = new nutools::dbi::Table();
43  t->SetTableName(tableName);
44  t->SetDetector(schemaName);
45  if (tableType < 0 || tableType >= nutools::dbi::kNTableType)
46  t->SetTableType(nutools::dbi::kConditionsTable);
47  if (dataSource < 0 || dataSource >= nutools::dbi::kNDataSources)
48  t->SetDataSource(nutools::dbi::kOffline);
49 
50  t->SetVerbosity(fVerbosity);
51  t->SetTimeQueries(fTimeQueries);
52  t->SetTimeParsing(fTimeParsing);
53  if (!fWebServiceURL.empty())
54  t->SetWSURL(fWebServiceURL);
55  if (!fQueryEngineURL.empty())
56  t->SetQEURL(fQueryEngineURL);
57 
58  if (!fDBUser.empty())
59  t->SetUser(fDBUser);
60 
61  return t;
62  }
std::string fQueryEngineURL
Definition: DBIService.h:44
std::string fWebServiceURL
Definition: DBIService.h:43
std::string tableName
map< int, array< map< int, double >, 2 >> Table
Definition: plot.C:18
void evdb::Reconfigurable::do_reconfigure ( fhicl::ParameterSet const &  pset)
inlineinherited

Definition at line 16 of file Reconfigurable.h.

References evdb::Reconfigurable::reconfigure(), and evdb::Reconfigurable::~Reconfigurable().

16 { reconfigure(pset); }
virtual void reconfigure(fhicl::ParameterSet const &)=0
void nutools::dbi::DBIService::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 24 of file DBI.cc.

References fDBUser, fQueryEngineURL, fTimeParsing, fTimeQueries, fVerbosity, fWebServiceURL, and fhicl::ParameterSet::get().

Referenced by DBIService().

25  {
26  fVerbosity = pset.get< int >("Verbosity",0);
27  fTimeQueries = pset.get< bool >("TimeQueries", false);
28  fTimeParsing = pset.get< bool >("TimeParsing", false);
29 
30  fWebServiceURL = pset.get< std::string >("WebServiceURL");
31  fQueryEngineURL = pset.get< std::string >("QueryEngineURL");
32  fDBUser = pset.get< std::string >("DBUser");
33  }
T get(std::string const &key) const
Definition: ParameterSet.h:314
std::string fQueryEngineURL
Definition: DBIService.h:44
std::string fWebServiceURL
Definition: DBIService.h:43

Member Data Documentation

std::string nutools::dbi::DBIService::fDBUser
protected

Definition at line 45 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().

std::string nutools::dbi::DBIService::fQueryEngineURL
protected

Definition at line 44 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().

bool nutools::dbi::DBIService::fTimeParsing
protected

Definition at line 41 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().

bool nutools::dbi::DBIService::fTimeQueries
protected

Definition at line 40 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().

int nutools::dbi::DBIService::fVerbosity
protected

Definition at line 39 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().

std::string nutools::dbi::DBIService::fWebServiceURL
protected

Definition at line 43 of file DBIService.h.

Referenced by CreateTable(), and reconfigure().


The documentation for this class was generated from the following files: