Browse Source

Add virtual destructor for ExtVMFace, make the class non-copyable.

cl-refactor
Paweł Bylica 10 years ago
parent
commit
ead77c8a4b
  1. 11
      libevm/ExtVMFace.h

11
libevm/ExtVMFace.h

@ -21,7 +21,7 @@
#pragma once #pragma once
#include <list> #include <set>
#include <functional> #include <functional>
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libevmface/Instruction.h> #include <libevmface/Instruction.h>
@ -45,17 +45,22 @@ struct Post
using OnOpFunc = std::function<void(uint64_t /*steps*/, Instruction /*instr*/, bigint /*newMemSize*/, bigint /*gasCost*/, void/*VM*/*, void/*ExtVM*/ const*)>; using OnOpFunc = std::function<void(uint64_t /*steps*/, Instruction /*instr*/, bigint /*newMemSize*/, bigint /*gasCost*/, void/*VM*/*, void/*ExtVM*/ const*)>;
/** /**
* @brief A null implementation of the class for specifying VM externalities. * @brief Interface and null implementation of the class for specifying VM externalities.
*/ */
class ExtVMFace class ExtVMFace
{ {
public: public:
/// Null constructor. /// Null constructor.
ExtVMFace() {} ExtVMFace() = default;
/// Full constructor. /// Full constructor.
ExtVMFace(Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytesConstRef _code, BlockInfo const& _previousBlock, BlockInfo const& _currentBlock, unsigned _depth); ExtVMFace(Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytesConstRef _code, BlockInfo const& _previousBlock, BlockInfo const& _currentBlock, unsigned _depth);
virtual ~ExtVMFace() = default;
ExtVMFace(ExtVMFace const&) = delete;
void operator=(ExtVMFace) = delete;
/// Get the code at the given location in code ROM. /// Get the code at the given location in code ROM.
virtual byte getCode(u256 _n) const { return _n < code.size() ? code[(unsigned)_n] : 0; } virtual byte getCode(u256 _n) const { return _n < code.size() ? code[(unsigned)_n] : 0; }

Loading…
Cancel
Save