BOSS 7.0.9
BESIII Offline Software System
|
Source context for Issue. More...
#include <Context.h>
Public Member Functions | |
Context (const std::string &filename, int line_number, const std::string &function_name, const std::string &compiler_name, const std::string &compiler_version, const std::string &compilation_time, const std::string &compilation_date, const std::string &package) | |
const std::string & | file () const throw () |
int | line () const throw () |
const std::string & | function () const throw () |
const std::string & | position () const |
const std::string & | compiler () const |
const std::string & | compilation () const |
const std::string & | package_name () const throw () |
int | stack_frames () const throw () |
const std::string & | stack_frame (int i) const |
std::vector< std::string > | qualifiers () const throw () |
Static Public Member Functions | |
static const Context * | empty () |
static std::string & | host_type () |
type of target host | |
static int | debug_level () |
static void | add_qualifier (const std::string &qualif) |
Static Protected Member Functions | |
static void | build_host_type () |
Protected Attributes | |
std::string | m_file_name |
int | m_line_number |
std::string | m_function_name |
std::string | m_compiler_name |
std::string | m_compiler_version |
std::string | m_compilation_date |
std::string | m_compilation_time |
std::string | m_package_name |
std::string | m_compiler |
std::string | m_position |
std::string | m_compilation |
std::vector< std::string > | m_stack_frames |
Static Protected Attributes | |
static Context * | empty_instance = 0 |
static std::string | s_host_type |
static std::vector< std::string > | default_qualifiers |
Source context for Issue.
This class encapsulates Context information for an issue. The context of an issue is the location in the code the issue was constructed. The context acts as an encapsulator for compilator generted information like:
The current context can be obtained using the macro ERS_HERE
An empty context can be obtained using the macro ERS_EMPTY
ers::Context::Context | ( | const std::string & | filename, |
int | line_number, | ||
const std::string & | function_name, | ||
const std::string & | compiler_name, | ||
const std::string & | compiler_version, | ||
const std::string & | compilation_time, | ||
const std::string & | compilation_date, | ||
const std::string & | package_name | ||
) |
Constructor - defines an Issue context. This constructor should generally not be called directly, instead use the macro ERS_HERE
.
filename | name of the source code file |
line_number | line_number in the source code |
function_name | name of the function - either pretty printed or not |
compiler_name | name of the compiler |
compiler_version | version of the compiler |
compilation_time | time of the compilation |
compilation_date | date of the compilation |
Definition at line 71 of file Context.cxx.
|
static |
Definition at line 56 of file Context.cxx.
Referenced by main().
|
staticprotected |
stack frames
Definition at line 189 of file Context.cxx.
const std::string & ers::Context::compilation | ( | ) | const |
Pretty printed compilation time description
Definition at line 168 of file Context.cxx.
const std::string & ers::Context::compiler | ( | ) | const |
Pretty printed compiler name
Definition at line 151 of file Context.cxx.
|
static |
Gives the current debug level
Definition at line 48 of file Context.cxx.
Referenced by ers::Issue::insert().
|
static |
Returns the empty instance
Definition at line 27 of file Context.cxx.
Referenced by empty().
const std::string & ers::Context::file | ( | ) | const | |
throw | ( | |||
) |
The source code file name
Definition at line 98 of file Context.cxx.
const std::string & ers::Context::function | ( | ) | const | |
throw | ( | |||
) |
Name of the function containing the context
Definition at line 114 of file Context.cxx.
Referenced by ers::NotImplemented::NotImplemented().
|
static |
type of target host
Tries to gues the host name
Definition at line 39 of file Context.cxx.
int ers::Context::line | ( | ) | const | |
throw | ( | |||
) |
The line number in the source code
Definition at line 106 of file Context.cxx.
const std::string & ers::Context::package_name | ( | ) | const | |
throw | ( | |||
) |
Definition at line 185 of file Context.cxx.
const std::string & ers::Context::position | ( | ) | const |
Pretty printed code position format: file_name:line_number (function_name)
Definition at line 124 of file Context.cxx.
std::vector< std::string > ers::Context::qualifiers | ( | ) | const | |
throw | ( | |||
) |
Returns the set of qualifiers associated with context At the moment, this includes the default qualifiers plus the package
Definition at line 232 of file Context.cxx.
const std::string & ers::Context::stack_frame | ( | int | i | ) | const |
Definition at line 223 of file Context.cxx.
int ers::Context::stack_frames | ( | ) | const | |
throw | ( | |||
) |
Definition at line 219 of file Context.cxx.
|
staticprotected |
|
staticprotected |
|
mutableprotected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
staticprotected |