CARMA C++
MonitorDataDatabase.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_MONITORDATADATABASE_H
2 #define CARMA_DBMS_MONITORDATADATABASE_H
3 
15 #include <map>
17 #include "carma/util/Logger.h"
18 #include "carma/util/Time.h"
19 
20 namespace carma {
21 namespace dbms {
22 
23  class DBConnection;
24  class Table;
25  class TimeRangeFilter;
26 
31 
32 public:
37 
38  virtual ~MonitorDataDatabase( );
39 
40  //carma::dbms::Table getMonitorDataTableIndexTable();
41 
53  (const carma::dbms::TimeRangeFilter& trFilter,
54  const carma::dbms::MonitorAggregateType& aggType,
55  const bool includeNullTimes=true) const;
56 
69  virtual void insertIntoMonitorIndexTable
70  (const std::string& tableName, const int& partitionID,
71  const MonitorAverageType& averageType,
72  const MonitorAggregateType& aggType,
73  const carma::util::frameType& creationFrame) const;
74 
75  /*
76  * get the base name of the specified table type
77  * @param averageType the average type for which the base name is desired
78  * @param aggType the aggreate type for which the base name is desired
79  * @return the base name of the table
80  */
81  static std::string getMonitorDataTableBaseName
82  (const MonitorAverageType& averageType,
83  const MonitorAggregateType aggType);
84 
97  (const MonitorAverageType& averageType,
98  const MonitorAggregateType& aggType, const std::string& tag,
99  std::string& tableName, std::string& columnClause,
100  std::string& pkClause);
101 
110  (const std::string& tableName, const MonitorAverageType& averageType)
111  const;
112 
120  void updateMonitorIndexTable (const int& minAge) const;
121 
127  std::string getCanonicalSystemName(const std::string& tableName) const;
128 
129 
130 private:
131  const DBConnection *dbc_;
132  log4cpp::Category& logger_;
133 
138 
139 };
140 }}
141 
142 #endif // CARMA_DBMS_MONITORDATADATABASE_H
Class to mimic a db table The Table class is meant to mimic a database table.
Definition: Table.h:34
Common time functions.
MonitorAggregateType
aggregate data type of the monitor[point,data file, table]
std::string getCanonicalSystemName(const std::string &tableName) const
get the canonical file system path to the specified monitor data table
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
carma::dbms::Table getMonitorDataIndexTableEntries(const carma::dbms::TimeRangeFilter &trFilter, const carma::dbms::MonitorAggregateType &aggType, const bool includeNullTimes=true) const
get entries in the MonitorDataIndexTable corresponding to the supplied filters
virtual void insertIntoMonitorIndexTable(const std::string &tableName, const int &partitionID, const MonitorAverageType &averageType, const MonitorAggregateType &aggType, const carma::util::frameType &creationFrame) const
insert a row into the monitor data index table The SQL statement that is executed is &quot;INSERT INTO &quot; +...
This class contains methods for accessing monitor configuration information.
relationships between the monitor and dbms systems
void updateMonitorIndexTable(const std::string &tableName, const MonitorAverageType &averageType) const
insert the max and min frame counts into the specified row in the monitor index table.
MonitorAverageType
average type of the monitor[point,data file,table]
represents an SQL query time range filter (part of a WHERE clause This class represents a (closed) ti...
static void getCreateMonitorTableStatementParts(const MonitorAverageType &averageType, const MonitorAggregateType &aggType, const std::string &tag, std::string &tableName, std::string &columnClause, std::string &pkClause)
construct portions of the statement used to create a monitor table the basic creation statement is &quot;C...
an abstract class from which database queries may be launched.
Definition: DBConnection.h:46