Fabcoin Core  0.16.2
P2P Digital Currency
VMFace.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #pragma once
18 
19 #include <memory>
20 #include <libdevcore/Exceptions.h>
21 #include "ExtVMFace.h"
22 
23 namespace dev
24 {
25 namespace eth
26 {
27 
28 struct VMException: virtual Exception {};
29 #define ETH_SIMPLE_EXCEPTION_VM(X) struct X: virtual VMException { const char* what() const noexcept override { return #X; } }
36 
37 
39 class VMFace
40 {
41 public:
42  VMFace() = default;
43  virtual ~VMFace() = default;
44  VMFace(VMFace const&) = delete;
45  VMFace& operator=(VMFace const&) = delete;
46 
48  virtual owning_bytes_ref exec(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp) = 0;
49 };
50 
51 }
52 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
Ran out of stack executing code of the transaction.
ETH_SIMPLE_EXCEPTION_VM(BadInstruction)
Ran out of gas executing code of the transaction.
Base class for all exceptions.
Definition: Exceptions.h:39
std::function< void(uint64_t, uint64_t, Instruction, bigint, bigint, bigint, VM *, ExtVMFace const *)> OnOpFunc
Definition: ExtVMFace.h:193
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Definition: Common.h:125
EVM Virtual Machine interface.
Definition: VMFace.h:39
Interface and null implementation of the class for specifying VM externalities.
Definition: ExtVMFace.h:265
Reference to a slice of buffer that also owns the buffer.
Definition: ExtVMFace.h:56