BOSS 7.0.1
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 () |
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 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 () |
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
Definition at line 42 of file Event/ers/ers-00-00-03/ers/Context.h.
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.
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 | ||
) |
|
static |
Definition at line 56 of file Context.cxx.
Referenced by main().
|
static |
|
staticprotected |
stack frames
Definition at line 189 of file Context.cxx.
|
staticprotected |
stack frames
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::compilation | ( | ) | const |
const std::string & ers::Context::compiler | ( | ) | const |
Pretty printed compiler name
Definition at line 151 of file Context.cxx.
const std::string & ers::Context::compiler | ( | ) | const |
|
static |
Gives the current debug level
Definition at line 48 of file Context.cxx.
Referenced by ers::Issue::insert().
|
static |
|
static |
Returns the empty instance
Definition at line 27 of file Context.cxx.
Referenced by empty().
|
static |
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::file | ( | ) | const | |
throw | ( | |||
) |
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().
const std::string & ers::Context::function | ( | ) | const | |
throw | ( | |||
) |
|
static |
type of target host
Tries to gues the host name
Definition at line 39 of file Context.cxx.
|
static |
type of target host
int ers::Context::line | ( | ) | const | |
throw | ( | |||
) |
The line number in the source code
Definition at line 106 of file Context.cxx.
int ers::Context::line | ( | ) | const | |
throw | ( | |||
) |
const std::string & ers::Context::package_name | ( | ) | const | |
throw | ( | |||
) |
Definition at line 185 of file Context.cxx.
const std::string & ers::Context::package_name | ( | ) | const | |
throw | ( | |||
) |
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.
const std::string & ers::Context::position | ( | ) | const |
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.
std::vector< std::string > ers::Context::qualifiers | ( | ) | const | |
throw | ( | |||
) |
const std::string & ers::Context::stack_frame | ( | int | i | ) | const |
Definition at line 223 of file Context.cxx.
const std::string & ers::Context::stack_frame | ( | int | i | ) | const |
int ers::Context::stack_frames | ( | ) | const | |
throw | ( | |||
) |
Definition at line 219 of file Context.cxx.
int ers::Context::stack_frames | ( | ) | const | |
throw | ( | |||
) |
|
staticprotected |
vector of default qualifiers
Definition at line 46 of file Event/ers/ers-00-00-03/ers/Context.h.
|
staticprotected |
Definition at line 44 of file Event/ers/ers-00-00-03/ers/Context.h.
Referenced by empty().
|
mutableprotected |
compilation (cache)
Definition at line 57 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
compilation date
Definition at line 52 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
compilation time
Definition at line 53 of file Event/ers/ers-00-00-03/ers/Context.h.
|
mutableprotected |
compilation string (cache)
Definition at line 55 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
compiler name
Definition at line 50 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
compiler version
Definition at line 51 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
source file-name
Definition at line 47 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
source function name (can be pretty printed or not)
Definition at line 49 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
source line-number
Definition at line 48 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
Definition at line 54 of file Event/ers/ers-00-00-03/ers/Context.h.
|
mutableprotected |
code position (cache)
Definition at line 56 of file Event/ers/ers-00-00-03/ers/Context.h.
|
protected |
Definition at line 58 of file Event/ers/ers-00-00-03/ers/Context.h.
|
staticprotected |
host_type
Definition at line 45 of file Event/ers/ers-00-00-03/ers/Context.h.