ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations | Functions
Misc.h File Reference

general configuration and logging More...

#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <mutex>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <typeinfo>
#include <vector>
#include "etiss/config.h"
#include "etiss/jit/types.h"
#include "etiss/ClassDefs.h"
Include dependency graph for Misc.h:

Go to the source code of this file.

Classes

class  etiss::ToString
 Marker interface for toString() support. More...
 
class  etiss::SourceCodeLocation
 simple class that store source location information. More...
 
class  etiss::Configuration
 simple class to hold configuration options More...
 
class  etiss::ConfigAnnouncer
 simple class to add a configuration option to the list of known options More...
 

Namespaces

namespace  etiss
 forwards: include/jit/*
 

Macros

#define ETISS_TOSTRING2(X)   #X
 
#define ETISS_TOSTRING(X)   ETISS_TOSTRING2(X)
 
#define etiss_log(LEVEL, MSG)
 
#define etiss_del_copy(CLASS)
 
#define etiss_del_move(CLASS)
 
#define etiss_del_como(CLASS)   etiss_del_copy(CLASS) etiss_del_move(CLASS)
 
#define ETISS_TEMPLATE_EXPRESSION_IS_VALID(STRUCT, EXPRESSION)
 
#define ETISS_SRCLOC   etiss::SourceCodeLocation(__FILE__, __LINE__)
 
#define ETISS_VARVAL(VAR)   (std::string(ETISS_TOSTRING(VAR)) + "={" + toLogString(VAR) + "}")
 

Enumerations

enum  etiss::Verbosity {
  etiss::SILENT = 0 , etiss::FATALERROR = 1 , etiss::ERROR = 2 , etiss::WARNING = 3 ,
  etiss::INFO = 4 , etiss::VERBOSE = 5
}
 Enumeration type for the log levels. More...
 
enum  etiss::endian_t : uint32_t { etiss::_LITTLE_ENDIAN_ = ETISS_LITTLE_ENDIAN , etiss::_BIG_ENDIAN_ = ETISS_BIG_ENDIAN , etiss::_UNKNOWN_ENDIAN_ = ETISS_UNKNOWN_ENDIAN }
 Enumeration type for the endianness. More...
 

Functions

template<typename T >
std::enable_if< std::is_base_of< etiss::ToString, T >::value, std::ostream & >::type etiss::operator<< (std::ostream &os, const T &val)
 Implementation of the write to stream operator for objects, that implement the etiss::ToString interface.
 
Verbosityetiss::verbosity ()
 Get log level reference.
 
booletiss::log_to_stderr ()
 
template<typename T >
std::string etiss::toString (const T &val)
 conversion of type T to std::string.
 
std::list< std::string > etiss::split (const std::string &str, std::function< size_t(const std::string &, size_t, size_t &)> findsplit)
 
std::list< std::string > etiss::split (const std::string &str, char splitchar)
 
std::list< std::string > etiss::split (const std::string &str, const std::string &splitstring)
 
template<typename T , typename T2 , typename... O>
std::string etiss::toString (const T &val, const T2 &val2, const O &...others)
 conversion of type T to std::string.
 
std::string etiss::toString (const Verbosity &val)
 prints string representation of verbosity level
 
void etiss::log (Verbosity level, std::string msg)
 write log message at the given level.
 
void etiss::logC (Verbosity level, std::function< std::string(void)> msgGen)
 write log message at the given level.
 
template<typename T >
std::string etiss::toLogString (const T &t)
 Format the string representation of a value for the log output.
 
template<typename T1 , typename T2 , typename... O>
std::string etiss::toLogString (const T1 &t1, const T2 &t2, const O &...os)
 Format a list of arguments for the log output.
 
template<typename T , typename... O>
void etiss::log (Verbosity level, std::string msg, const T &t, const O &...args)
 additional objects will be converted to a string with toString and are added to the message
 
std::vector< std::string > etiss::parseCommands (const std::string &cmdline)
 
Configurationetiss::cfg (const std::string &cfgName)
 Get reference of the global ETISS configuration object.
 
Configurationetiss::cfg ()
 
std::string etiss::installDir ()
 Get ETISS installation directory.
 
std::string etiss::jitFiles ()
 Get ETISS JIT files path.
 
std::vector< std::string > etiss::jitExtHeaders ()
 Get ETISS JIT external headers.
 
std::vector< std::string > etiss::jitExtLibraries ()
 Get ETISS JIT external libraries.
 
std::vector< std::string > etiss::jitExtHeaderPaths ()
 Get ETISS JIT external path.
 
std::vector< std::string > etiss::jitExtLibPaths ()
 Get ETISS JIT external path.
 
template<>
std::string etiss::Configuration::get< std::string > (const std::string &key, std::string default_, bool *default_used)
 
endian_t etiss::getEndianness ()
 evaluates the endianness of the current build as a constexpr.
 

Detailed Description

general configuration and logging

Definition in file Misc.h.

Macro Definition Documentation

◆ etiss_del_como

#define etiss_del_como (   CLASS)    etiss_del_copy(CLASS) etiss_del_move(CLASS)

Definition at line 52 of file Misc.h.

◆ etiss_del_copy

#define etiss_del_copy (   CLASS)
Value:
CLASS(const CLASS &) = delete; \
CLASS &operator=(const CLASS &) = delete;

Definition at line 45 of file Misc.h.

◆ etiss_del_move

#define etiss_del_move (   CLASS)
Value:
CLASS &operator=(CLASS &&) = delete; \
CLASS(CLASS &&) = delete;

Definition at line 48 of file Misc.h.

◆ etiss_log

#define etiss_log (   LEVEL,
  MSG 
)
Value:
etiss::log(etiss::LEVEL, \
std::string("On line " ETISS_TOSTRING(__LINE__) " in file " ETISS_TOSTRING(__FILE__) ": ") + (MSG));
#define ETISS_TOSTRING(X)
Definition Misc.h:39
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition Misc.cpp:94

Definition at line 41 of file Misc.h.

◆ ETISS_SRCLOC

#define ETISS_SRCLOC   etiss::SourceCodeLocation(__FILE__, __LINE__)

Definition at line 202 of file Misc.h.

◆ ETISS_TEMPLATE_EXPRESSION_IS_VALID

#define ETISS_TEMPLATE_EXPRESSION_IS_VALID (   STRUCT,
  EXPRESSION 
)
Value:
template <typename> \
struct STRUCT##Void \
{ \
typedef void type; \
}; \
template <typename T, typename Sfinae = void> \
struct STRUCT : std::false_type \
{ \
}; \
template <typename T> \
struct STRUCT<T, typename STRUCT##Void<decltype(EXPRESSION)>::type> : std::true_type \
{ \
};

Definition at line 56 of file Misc.h.

◆ ETISS_TOSTRING

#define ETISS_TOSTRING (   X)    ETISS_TOSTRING2(X)

Definition at line 39 of file Misc.h.

◆ ETISS_TOSTRING2

#define ETISS_TOSTRING2 (   X)    #X

Definition at line 38 of file Misc.h.

◆ ETISS_VARVAL

#define ETISS_VARVAL (   VAR)    (std::string(ETISS_TOSTRING(VAR)) + "={" + toLogString(VAR) + "}")

Definition at line 203 of file Misc.h.