|
|
@@ -15,20 +15,35 @@ namespace DataStorage {
|
|
|
|
|
|
class DataStorageClientImpl;
|
|
|
|
|
|
-class DataStorageClient
|
|
|
+class IDataStorageClient
|
|
|
+{
|
|
|
+public:
|
|
|
+ virtual ~IDataStorageClient() {}
|
|
|
+
|
|
|
+public:
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, int value) = 0;
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, double value) = 0;
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, const std::string& value) = 0;
|
|
|
+
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, int value) = 0;
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, double value) = 0;
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, const std::string& value) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+class DataStorageClient : public IDataStorageClient
|
|
|
{
|
|
|
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);
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, int value);
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, double value);
|
|
|
+ virtual void LogValue(int deviceId, const std::string& dataName, int timestamp, const std::string& value);
|
|
|
|
|
|
- void LogValueTimed(int deviceId, const std::string& dataName, int value);
|
|
|
- void LogValueTimed(int deviceId, const std::string& dataName, double value);
|
|
|
- void LogValueTimed(int deviceId, const std::string& dataName, const std::string& value);
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, int value);
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, double value);
|
|
|
+ virtual void LogValueTimed(int deviceId, const std::string& dataName, const std::string& value);
|
|
|
|
|
|
public:
|
|
|
void MetronomeCallback();
|