Ethereum  PoC-8
The C++ Implementation of Ethereum
VMFactory.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 "VMFace.h"
20 
21 #include <boost/program_options/options_description.hpp>
22 
23 namespace dev
24 {
25 namespace eth
26 {
27 enum class VMKind
28 {
30  Legacy,
31  DLL
32 };
33 
35 std::vector<std::pair<std::string, std::string>>& evmcOptions() noexcept;
36 
41 boost::program_options::options_description vmProgramOptions(
42  unsigned _lineLength = boost::program_options::options_description::m_default_line_length);
43 
44 using VMPtr = std::unique_ptr<VMFace, void (*)(VMFace*)>;
45 
46 class VMFactory
47 {
48 public:
49  VMFactory() = delete;
50  ~VMFactory() = delete;
51 
53  static VMPtr create();
54 
56  static VMPtr create(VMKind _kind);
57 };
58 } // namespace eth
59 } // namespace dev
VMFace.h
dev::eth::VMPtr
std::unique_ptr< VMFace, void(*)(VMFace *)> VMPtr
Definition: VMFactory.h:44
boost
Definition: Log.h:251
dev::eth::VMFace
EVM Virtual Machine interface.
Definition: VMFace.h:64
dev::eth::VMKind::Interpreter
@ Interpreter
dev::eth::VMKind::DLL
@ DLL
dev::eth::VMFactory
Definition: VMFactory.h:47
dev::eth::VMKind::Legacy
@ Legacy
dev::eth::evmcOptions
std::vector< std::pair< std::string, std::string > > & evmcOptions() noexcept
Returns the EVMC options parsed from command line.
Definition: VMFactory.cpp:136
dev::eth::VMFactory::~VMFactory
~VMFactory()=delete
std
Definition: FixedHash.h:393
dev::eth::VMKind
VMKind
Definition: VMFactory.h:28
dev
Definition: Address.cpp:21
dev::eth::VMFactory::VMFactory
VMFactory()=delete
dev::eth::vmProgramOptions
po::options_description vmProgramOptions(unsigned _lineLength)
Definition: VMFactory.cpp:141