2016-02-08 05:56:52 +08:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "query_engine/i_code_cpu.hpp"
|
2016-02-22 05:21:15 +08:00
|
|
|
#include "storage/model/properties/all.hpp"
|
2016-02-08 05:56:52 +08:00
|
|
|
|
2016-02-11 06:34:49 +08:00
|
|
|
// TODO generate with the template engine
|
|
|
|
// #include "storage/model/properties/jsonwriter.hpp"
|
|
|
|
|
2016-02-08 05:56:52 +08:00
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
|
2016-02-11 06:34:49 +08:00
|
|
|
// query: {{query}}
|
|
|
|
|
2016-02-08 05:56:52 +08:00
|
|
|
class {{class_name}} : public ICodeCPU
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2016-02-22 05:21:15 +08:00
|
|
|
QueryResult::sptr run(Db& db, code_args_t& args) override
|
2016-02-08 05:56:52 +08:00
|
|
|
{
|
2016-02-11 06:34:49 +08:00
|
|
|
{{code}} }
|
2016-02-08 05:56:52 +08:00
|
|
|
|
|
|
|
~{{class_name}}() {}
|
|
|
|
};
|
|
|
|
|
2016-02-11 06:34:49 +08:00
|
|
|
|
2016-02-08 05:56:52 +08:00
|
|
|
extern "C" ICodeCPU* produce()
|
|
|
|
{
|
|
|
|
return new {{class_name}}();
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void destruct(ICodeCPU* p)
|
|
|
|
{
|
|
|
|
delete p;
|
|
|
|
}
|