2016-02-07 03:48:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
#include "query_engine/query_stripped.hpp"
|
2016-02-07 03:48:40 +08:00
|
|
|
|
2016-08-30 12:34:08 +08:00
|
|
|
#ifdef BARRIER
|
2016-08-29 08:01:42 +08:00
|
|
|
#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"
|
2016-06-06 17:29:52 +08:00
|
|
|
#include "database/db.hpp"
|
2016-08-20 01:40:04 +08:00
|
|
|
#include "database/db_accessor.hpp"
|
2016-08-30 12:34:08 +08:00
|
|
|
#endif
|
2016-02-07 03:48:40 +08:00
|
|
|
|
2016-08-29 01:50:54 +08:00
|
|
|
template <typename Stream>
|
2016-02-07 03:48:40 +08:00
|
|
|
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
|
2016-02-07 03:48:40 +08:00
|
|
|
virtual ~ICodeCPU() {}
|
|
|
|
};
|
|
|
|
|
2016-08-29 01:50:54 +08:00
|
|
|
template <typename Stream>
|
|
|
|
using produce_t = ICodeCPU<Stream> *(*)();
|
|
|
|
|
|
|
|
template <typename Stream>
|
|
|
|
using destruct_t = void (*)(ICodeCPU<Stream> *);
|