38 lines
822 B
C++
38 lines
822 B
C++
#ifndef DATASTORAGECLIENT_H
|
|
#define DATASTORAGECLIENT_H
|
|
|
|
#include "Timespan.h"
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
|
|
namespace MySQL {
|
|
|
|
class MySQLClient;
|
|
|
|
} // namespace MySQL
|
|
|
|
namespace DataStorage {
|
|
|
|
class DataStorageClientImpl;
|
|
|
|
class DataStorageClient
|
|
{
|
|
public:
|
|
DataStorageClient(const std::shared_ptr<MySQL::MySQLClient>& pMySQLClient, const std::string& table);
|
|
~DataStorageClient();
|
|
|
|
public:
|
|
void LogValue(int deviceId, const std::string& dataName, int timestamp, int value);
|
|
void LogValue(int deviceId, const std::string& dataName, int timestamp, double value);
|
|
void LogValue(int deviceId, const std::string& dataName, int timestamp, const std::string& value);
|
|
|
|
private:
|
|
std::shared_ptr<MySQL::MySQLClient> m_pMySQLClient;
|
|
std::string m_table;
|
|
};
|
|
|
|
} // namespace DataStorage
|
|
|
|
#endif // DATASTORAGECLIENT_H
|