DataStorageClient.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef DATASTORAGECLIENT_H
  2. #define DATASTORAGECLIENT_H
  3. #include <memory>
  4. #include <string>
  5. namespace MySQL {
  6. class MySQLClient;
  7. } // namespace MySQL
  8. namespace DataStorage {
  9. class DataStorageClientImpl;
  10. class DataStorageClient
  11. {
  12. public:
  13. DataStorageClient(const std::shared_ptr<MySQL::MySQLClient>& pMySQLClient, const std::string& table);
  14. ~DataStorageClient();
  15. public:
  16. void LogValue(int deviceId, const std::string& dataName, int timestamp, int value);
  17. void LogValue(int deviceId, const std::string& dataName, int timestamp, double value);
  18. void LogValue(int deviceId, const std::string& dataName, int timestamp, const std::string& value);
  19. void LogValueTimed(int deviceId, const std::string& dataName, int value);
  20. void LogValueTimed(int deviceId, const std::string& dataName, double value);
  21. void LogValueTimed(int deviceId, const std::string& dataName, const std::string& value);
  22. public:
  23. void MetronomeCallback();
  24. private:
  25. std::unique_ptr<DataStorageClientImpl> m_pDataStorageClientImpl;
  26. };
  27. } // namespace DataStorage
  28. #endif // DATASTORAGECLIENT_H