2016-02-07 03:48:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-11 11:47:30 +08:00
|
|
|
#include "communication/communication.hpp"
|
2016-08-10 16:39:02 +08:00
|
|
|
#include "query_engine/query_stripped.hpp"
|
2016-02-07 03:48:40 +08:00
|
|
|
|
2016-08-29 08:01:42 +08:00
|
|
|
// #include "database/db.hpp"
|
|
|
|
// #include "database/db_accessor.hpp"
|
|
|
|
|
|
|
|
// BARRIER!
|
|
|
|
#include "barrier/barrier.hpp"
|
|
|
|
|
2016-08-29 01:50:54 +08:00
|
|
|
template <typename Stream>
|
2016-02-07 03:48:40 +08:00
|
|
|
class ICodeCPU
|
|
|
|
{
|
|
|
|
public:
|
2016-08-29 08:01:42 +08:00
|
|
|
virtual bool run(barrier::Db &db, code_args_t &args,
|
2016-08-29 01:50:54 +08:00
|
|
|
Stream &stream) = 0;
|
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> *);
|