24#define BUFFER_SIZE 256
26#define ISSUE_VALUE_SET_SCALAR(table,key,value) { std::ostringstream stream ; stream << value ; table[key] = stream.str(); }
135 cause(cause_exception);
165Issue::operator std::string()
const {
166 std::string
s = human_description();
177 Issue target(source);
187 if (m_value_table != other.m_value_table)
return false ;
188 if (m_cause == other.m_cause)
return true ;
189 return (*m_cause) == *(other.m_cause) ;
199 return get_value(
key,
"");
257 const Issue *i =
dynamic_cast<const Issue *
>(c) ;
284 string_map_type::const_iterator pos = m_value_table.find(
key);
285 if (pos!=m_value_table.end()) {
306 std::string
v = get_value(
key) ;
308 std::istringstream in(
v) ;
326 std::string
v = get_value(
key) ;
328 std::istringstream in(
v) ;
347 std::istringstream in(
v) ;
363 m_value_table = values ;
423 std::ostringstream stream ;
425 m_value_table[
key] = stream.str();
434 if (! value.empty()) {
435 m_value_table[
key] = value ;
446 std::string value_str = std::string(value) ;
447 set_value(
key,value_str);
458 std::ostringstream stream ;
459 stream.setf(std::ios::hex,std::ios::basefield);
460 stream << (
unsigned long) ptr ;
461 m_value_table[
key] = stream.str();
483 set_value(SOURCE_POSITION_KEY,context->position()) ;
484 set_value(SOURCE_PACKAGE_KEY,context->package_name());
485 set_value(COMPILER_KEY,context->compiler()) ;
486 set_value(COMPILATION_TIME_KEY,context->compilation()) ;
487 set_value(COMPILATION_TARGET_KEY,context->host_type()) ;
490 set_value(COMPILATION_DEBUG_LVL_KEY,lvl);
492 int frame_number = context->stack_frames();
493 for(
int i=0;i<frame_number;i++) {
494 char key_buffer[256] ;
495 snprintf(key_buffer,
sizeof(key_buffer),
"SOURCE-STACK-%03x",i);
496 set_value(key_buffer,context->stack_frame(i));
498 std::vector<std::string> qualifs = context->qualifiers() ;
499 std::vector<std::string>::const_iterator pos ;
500 for(pos=qualifs.begin();pos!=qualifs.end();pos++) {
501 add_qualifier(*pos) ;
513 ctime_r(&now,time_buffer) ;
514 char *cr = strchr(time_buffer,
'\n');
536 const int errno_copy = errno ;
570 set_value(CLASS_KEY, get_class_name()) ;
571 set_value(MESSAGE_KEY,msg);
589 const Issue *p = this ;
705 std::string::size_type pos = qualif_s.find(qualif);
706 if (pos!=std::string::npos) return ;
707 std::string n_qualif = qualif_s+qualif +
" " ;
#define ERS_PRE_CHECK_PTR(p)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Source context for Issue.
static int parse_boolean(const char *s)
string to boolean
static std::string umangle_gcc_class_name(const char *name)
unmangles gcc RTTI names
static responsibility_t parse_responsibility(const char *s)
string to responsibility
static std::vector< std::string > tokenize(const std::string &text, const std::string &separators)
static const std::string empty_string
static const char * to_string(severity_t s)
severity_t to string
static severity_t parse_severity(const char *s)
string to severity_t
bool register_issue(const std::string &name, CreateIssueCallback creator)
register an issue factory
static IssueFactory * instance()
method to access singleton
Issue * build(const std::string &name) const
build an empty issue out of a name
static const char *const HOST_TYPE_KEY
key for host type (architecture / os)
responsibility_t responsibility() const
get the responsability level of the issue
void set_values(const string_map_type &values)
sets the value table
int values_number() const
How many key / values.
static const char *const USER_NAME_KEY
key for the user-name of the owner of the process
static const char *const PROGRAM_NAME_KEY
key for the name of the program
static const char *const ERS_VERSION_KEY
key for ERS version
std::string m_class_name
class name
static const char *const CPP_CLASS_KEY
key for c++ class (might be mangled)
const std::string & get_value(const std::string &key, const std::string &def) const
Reads the property list.
static const char *const COMPILATION_TARGET_KEY
key for compilation target
std::string severity_message() const
message associated with the severity_t of the issue
long get_long_value(const std::string &key, long def=0) const
Get a value of the table as a long integer.
const std::string & operator[](const std::string &key) const
static const char *const MESSAGE_KEY
key for human readable
void set_value(const std::string &key, uint8_t value)
Sets a value 8 bit unsigned.
static const char *const USER_ID_KEY
key for the user-id of the owner of the process
static const char *const SEVERITY_KEY
key for the severity_t of the issue
void insert_time()
Inserts current time.
std::string m_human_description
Human readable description (cache)
static const char *const EXIT_VALUE_KEY
key used to store the exit value
static const char *const COMPILATION_TIME_KEY
key for compilation time
severity_t severity() const
severity_t of the issue
bool is_error()
is the issue an error (or fatal).
std::vector< std::string > qualifiers() const
return array of qualifiers
const std::string & message() const
Message.
int get_int_value(const std::string &key, int def=0) const
Get a value of the table as an integer.
void finish_setup(const std::string &message)
Finishes the setup of the Issue.
static const char *const RESPONSIBILITY_KEY
key for the responsibility of the issue (text)
static const char *const TRANSIENCE_KEY
key for the transience of the issue (text)
static const char *const TIME_KEY
key for the time of the issue (text)
const std::string & human_description() const
Human description message.
static const char *const COMPILATION_DEBUG_LVL_KEY
static const char *const CAUSE_TEXT_KEY
key used to store the cause issue's message
static const char *const SOURCE_POSITION_KEY
key for position in the source code
Issue * m_cause
Issue that caused the current issue.
const Issue * cause() const
return the cause Issue of this Issue
static const char *const PROCESS_PWD_KEY
key for the process working directory
static const char *const CAUSE_PSEUDO_KEY
key used when serializing the cause issue, this key is not used in the value table
const char * what() const
Human description message.
static const char *const COMPILER_KEY
key for compilator type
static const char *const HOST_NAME_KEY
key for hostname
static const char *const QUALIFIER_LIST_KEY
key used to store the qualifier list
const string_map_type * get_value_table() const
extract value table
static const char *const CLASS_KEY
key for class information
void add_qualifier(const std::string &qualif)
adds a qualifier to the issue
static const char *const SOURCE_PACKAGE_KEY
package name associated with source code
int transience() const
is the issue transient
string_map_type m_value_table
Optional properties.
virtual const char * get_class_name() const
Get key for class (used for serialisation)
static const char *const HOST_IP_ADDR_KEY
key for host ip address
void insert(const Context *context)
Inserts the context.
static const char *const ISSUE_CLASS_NAME
name of the class, used for serialisation
Issue operator=(const Issue &issue)
Affectation operator.
virtual int exit_value() const
value to pass to exit
double get_double_value(const std::string key, double def) const
Get a value of the table as double.
void setup_common(const Context *context)
Sets up the common fields.
static const char *const PROCESS_ID_KEY
key for the process id (number)
bool operator==(const Issue &other) const
Equality operator.
#define ISSUE_VALUE_SET_SCALAR(table, key, value)
ers header and documentation file
enum ers::_responsibility_t responsibility_t
std::ostream & operator<<(std::ostream &, const Issue &)
std::map< std::string, std::string > string_map_type
enum ers::_severity_t severity_t