| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef DATAINTERFACE_DATAIMPORTER_H
- #define DATAINTERFACE_DATAIMPORTER_H
- #include <string>
- #include <vector>
- namespace MySQL {
- class MySQLClient;
- } // namespace MySQL
- namespace SQLite {
- class SQLiteClient;
- } // namespace SQLite
- namespace DataStorageInterface {
- namespace DataInterface {
- class DataImporter
- {
- public:
- DataImporter(MySQL::MySQLClient* pMySQLClient, SQLite::SQLiteClient* pSQLiteClient);
- void ImportData();
- private:
- std::vector<std::string> GetTables();
- std::vector<int> GetDevices(const std::string& table);
- void ImportData(const std::string& table, int device);
- int GetMaximumMySQLPacketSize();
- int StringStreamSize(std::stringstream& ss);
- void InitializeInsertQuery(std::stringstream& query);
- void ExecuteInsertQuery(std::stringstream& query);
- int GetMaximumTimestamp(const std::string& table, int device);
- private:
- MySQL::MySQLClient* m_pMySQLClient;
- SQLite::SQLiteClient* m_pSQLiteClient;
- };
- } // namespace DataInterface
- } // namespace DataStorageInterface
- #endif // DATAINTERFACE_DATAIMPORTER_H
|