2016-01-27 06:40:11 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-02-07 03:48:40 +08:00
|
|
|
#include "code_loader.hpp"
|
|
|
|
#include "code_executor.hpp"
|
2016-01-27 06:40:11 +08:00
|
|
|
#include "query_result.hpp"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Current arhitecture:
|
2016-02-07 03:48:40 +08:00
|
|
|
// query -> code_loader -> query_stripper -> [code_generator]
|
|
|
|
// -> [code_compiler] -> code_executor
|
2016-01-27 06:40:11 +08:00
|
|
|
//
|
|
|
|
|
|
|
|
class QueryEngine
|
|
|
|
{
|
|
|
|
public:
|
2016-02-04 09:45:12 +08:00
|
|
|
QueryEngine()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-02-07 03:48:40 +08:00
|
|
|
QueryResult* execute(const std::string& query)
|
2016-01-27 06:40:11 +08:00
|
|
|
{
|
2016-02-07 03:48:40 +08:00
|
|
|
executor.execute(loader.load_code_cpu(query));
|
2016-02-03 07:18:20 +08:00
|
|
|
|
2016-02-07 03:48:40 +08:00
|
|
|
throw std::runtime_error("implement me");
|
2016-01-27 06:40:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2016-02-07 03:48:40 +08:00
|
|
|
CodeLoader loader;
|
|
|
|
CodeExecutor executor;
|
2016-01-27 06:40:11 +08:00
|
|
|
};
|