ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
Wrapper for the initialize and shutdown of the ETISS environment. More...
#include <ETISS.h>
Public Member Functions | |
void | loadIniPlugins (std::shared_ptr< etiss::CPUCore > cpu) |
loads the plugins given with the previous loaded .ini files More... | |
void | loadIniJIT (std::shared_ptr< etiss::CPUCore > cpu) |
sets the JIT given with the previous loaded .ini files More... | |
template<typename argvT , typename... lisT> | |
Initializer (int argc, argvT **argv, lisT... args_append) | |
Constructor that initializes ETISS. More... | |
Initializer (std::list< std::string > *files, int argc, const char *argv[]) | |
template<typename... listT> | |
Initializer (listT... args) | |
Constructor that initializes ETISS. More... | |
template<typename argvT , typename... lisT> | |
Initializer (std::list< std::string > *files, int argc, argvT **argv, lisT... args_append) | |
Constructor that initializes ETISS. More... | |
template<typename... listT> | |
Initializer (std::list< std::string > *files, listT... args) | |
Constructor that initializes ETISS. More... | |
~Initializer () | |
Destructor that shutdowns ETISS. More... | |
Private Member Functions | |
template<typename T , typename... lisT> | |
void | toList (std::vector< std::string > &vec, T t, lisT... args) |
Add argument list to a string vector. More... | |
void | toList (std::vector< std::string > &vec) |
Break condition for empty argument list. More... | |
void | loadIni (std::list< std::string > *files) |
creates a simpleIni object which holds the data of the given .ini file. More... | |
template<typename T , typename... lisT> | |
void | static_assertFirstParamNotArithmetic (T t, lisT... args) |
Make sure that the first variadic parameter at compiletime is no number. More... | |
void | static_assertFirstParamNotArithmetic () |
version of static_assertFirstParamNotArithmetic for the case that no parameter is given. More... | |
Wrapper for the initialize and shutdown of the ETISS environment.
At creation of an Initializer object ETISS is initialized. On destruction of an Initializer object ETISS shutdown. There should only be one instance of Initializer at any point of time.
Create an instance at the beginning of main to ensure proper initialization and cleanup.
|
inline |
Constructor that initializes ETISS.
This Constructor is useful if the arguments provided to the main function should be forwarded to etiss::initialize(). Additional arguments can simply be added at the end of the argument list. If an argument is not a string it will be converted to a string with the help of etiss::toString().
argc | The number of arguments in the C-string array. |
argv | Pointer to a C-string array. |
args_append | Additional arguments for etiss::initialize. |
Definition at line 332 of file ETISS.h.
References get_metrics::args, etiss::initialize(), static_assert, and toList().
|
inline |
Definition at line 347 of file ETISS.h.
References get_metrics::args, etiss::initialize(), and loadIni().
|
inline |
Constructor that initializes ETISS.
If an argument is not a string it will be converted to a string with the help of etiss::toString(). E.g.
args | List of arguments for etiss::initialize. |
Definition at line 372 of file ETISS.h.
References get_metrics::args, etiss::initialize(), static_assertFirstParamNotArithmetic(), and toList().
|
inline |
Constructor that initializes ETISS.
This Constructor is useful if the arguments provided to the main function should be forwarded to etiss::initialize(). Additional arguments can simply be added at the end of the argument list. If an argument is not a string it will be converted to a string with the help of etiss::toString().
argc | The number of arguments in the C-string array. |
argv | Pointer to a C-string array. |
filename | File to open an ini file. |
args_append | Additional arguments for etiss::initialize. |
Definition at line 400 of file ETISS.h.
References get_metrics::args, etiss::initialize(), loadIni(), static_assert, and toList().
|
inline |
Constructor that initializes ETISS.
If an argument is not a string it will be converted to a string with the help of etiss::toString(). E.g.
filename | File to open an ini file. |
args | List of arguments for etiss::initialize. |
Definition at line 432 of file ETISS.h.
References get_metrics::args, etiss::initialize(), loadIni(), static_assertFirstParamNotArithmetic(), and toList().
etiss::Initializer::~Initializer | ( | ) |
Destructor that shutdowns ETISS.
The destructor calls etiss::shutdown().
Definition at line 984 of file ETISS.cpp.
References po_simpleIni, and etiss::shutdown().
|
private |
creates a simpleIni object which holds the data of the given .ini file.
Definition at line 399 of file ETISS.cpp.
References etiss_loadIni(), NULL, and po_simpleIni.
Referenced by Initializer().
void etiss::Initializer::loadIniJIT | ( | std::shared_ptr< etiss::CPUCore > | cpu | ) |
sets the JIT given with the previous loaded .ini files
Needed | to add the JIT to the CPU |
Definition at line 665 of file ETISS.cpp.
References etiss::cfg(), etiss::getDefaultJIT(), etiss::getJIT(), etiss::INFO, etiss::log(), and etiss::WARNING.
Referenced by main().
void etiss::Initializer::loadIniPlugins | ( | std::shared_ptr< etiss::CPUCore > | cpu | ) |
loads the plugins given with the previous loaded .ini files
Needed | to add the plugins to the CPU |
Definition at line 556 of file ETISS.cpp.
References etiss::cfg(), etiss::getPlugin(), etiss::INFO, etiss::log(), options, pluginOptions, po_simpleIni, vm, and etiss::WARNING.
Referenced by main().
|
inlineprivate |
version of static_assertFirstParamNotArithmetic for the case that no parameter is given.
Definition at line 304 of file ETISS.h.
Referenced by Initializer().
|
inlineprivate |
Make sure that the first variadic parameter at compiletime is no number.
The original goal was: The Initializer versions that take argc and argv wanted const char as type for argv. In some projects, the Initializer constructor was called with char instead of const char. This led to problems as another construtor with completely variadic parameters was choosen instead, which failed to parse argc and argv. This function was used to make sure these versions of Initializer are not instantiated with argc as the first argument.
Definition at line 295 of file ETISS.h.
References static_assert.
|
inlineprivate |
|
inlineprivate |
Add argument list to a string vector.
Recursively converts function arguments to a string with etiss::toString() and adds them to a string vector.
vec | The string vector where the arguments should be appended. |
t | The argument that is add next. |
args | The arguments added in the next recursion. |
Definition at line 268 of file ETISS.h.
References get_metrics::args, and etiss::toString().
Referenced by Initializer().