1 #ifndef _rdet_MonitoringSQLManager_h_
2 #define _rdet_MonitoringSQLManager_h_
8 #include <det/VManager.h>
9 #include <utl/ErrorLogger.h>
10 #include <utl/config.h>
11 #include <utl/ResponseMap.h>
12 #include <utl/LeapSeconds.h>
13 #include <boost/lexical_cast.hpp>
15 #ifdef AUGER_SQLITE_ENABLED
16 # include <det/VSQLManager_SQLite.h>
18 # include <det/VSQLManager_MySQL.h>
42 void Init(
const std::string& configLink);
70 if (componentProperty !=
"monitoring")
73 if (componentName ==
"temperature") {
74 if (componentIndex.find(
"site") == componentIndex.end()) {
75 WARNING(
"no site specified in componentIndex");
80 if (componentIndex.find(
"timeToAverage") != componentIndex.end())
81 timeToAverage = boost::lexical_cast<double>(componentIndex.find(
"timeToAverage")->second);
83 if (componentIndex.find(
"precision") != componentIndex.end())
84 precision = boost::lexical_cast<double>(componentIndex.find(
"precision")->second);
85 unsigned int numberOfQueriesToBuffer = 5000;
86 if (componentIndex.find(
"numberOfQueriesToBuffer") != componentIndex.end())
87 precision = boost::lexical_cast<int>(componentIndex.find(
"numberOfQueriesToBuffer")->second);
89 returnData =
GetTemperature(componentIndex.find(
"site")->second, timeToAverage,
97 double GetTemperature(
const std::string& site,
const double timeToAverage,
98 const unsigned int numberOfQueriesToBuffer,
const double precision)
const;
101 const unsigned int numberOfQueriesToBuffer)
const;
bool BufferTemperature(const std::string &site, const double timeToAverage, const unsigned int numberOfQueriesToBuffer) const
double GetTemperature(const std::string &site, const double timeToAverage, const unsigned int numberOfQueriesToBuffer, const double precision) const
virtual ~MonitoringSQLManager()
Status const
Fetch first item from first row and optionally free query result.
VMANAGER_GETDATA_HANDLE_DENIED std::map< std::string, std::vector< std::pair< unsigned long, double > > > fTemperatureBuffer
#define VMANAGER_GETDATA_CALL(_GetData_, _T_...)
Interface for detector managers that use MySQL.
static const double precision
Status InternalGetData(T &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
#define VMANAGER_GETDATA_HANDLE_DENIED
#define WARNING(message)
Macro for logging warning messages.
std::map< std::string, std::string > IndexMap
std::map< std::string, std::pair< unsigned long, unsigned long > > fTemperatureBufferInterval
Manager to access monitoring data.
#define VMANAGER_GETDATA_NOTFOUND(_T_...)
Status
Specifies success or (eventually) various possible failure modes.
void Init(const std::string &configLink)
Manager Initialization. configLink is the CentralConfig hook for the configuration file...