memgraph/include/query_engine/i_code_cpu.hpp

31 lines
662 B
C++
Raw Normal View History

#pragma once
#include "query_engine/query_stripped.hpp"
2016-08-30 12:34:08 +08:00
#ifdef BARRIER
#include "barrier/barrier.hpp"
2016-08-31 06:23:12 +08:00
#include "io/network/socket.hpp"
2016-08-30 12:34:08 +08:00
#else
2016-08-31 06:23:12 +08:00
#include "communication/communication.hpp"
#include "database/db.hpp"
#include "database/db_accessor.hpp"
2016-08-30 12:34:08 +08:00
#endif
template <typename Stream>
class ICodeCPU
{
public:
2016-08-30 12:34:08 +08:00
#ifdef BARRIER
2016-08-29 21:51:31 +08:00
virtual bool run(barrier::Db &db, code_args_t &args, Stream &stream) = 0;
2016-08-30 12:34:08 +08:00
#else
virtual bool run(Db &db, code_args_t &args, Stream &stream) = 0;
#endif
virtual ~ICodeCPU() {}
};
template <typename Stream>
using produce_t = ICodeCPU<Stream> *(*)();
template <typename Stream>
using destruct_t = void (*)(ICodeCPU<Stream> *);