DataStorageClient.h 822 B

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