memgraph/query_engine/template/template_code_cpu.cpp

36 lines
568 B
C++
Raw Normal View History

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