Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user