2016-02-07 03:48:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-02-08 05:56:52 +08:00
|
|
|
#include <string>
|
|
|
|
|
2016-02-07 03:48:40 +08:00
|
|
|
#include "database/db.hpp"
|
|
|
|
|
|
|
|
class ICodeCPU
|
|
|
|
{
|
|
|
|
public:
|
2016-02-08 05:56:52 +08:00
|
|
|
virtual std::string query() const = 0;
|
2016-02-07 03:48:40 +08:00
|
|
|
virtual void run(Db& db) const = 0;
|
|
|
|
virtual ~ICodeCPU() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ICodeCPU* (*produce_t)();
|
|
|
|
typedef void (*destruct_t)(ICodeCPU*);
|