19#include "ers/HumanStream.h"
23#define BUFFER_SIZE 256
25#define ISSUE_VALUE_SET_SCALAR( table, key, value ) \
27 std::ostringstream stream; \
29 table[key] = stream.str(); \
93 if ( issue.
m_cause ) { this->m_cause = issue.m_cause->clone(); }
94 else { this->m_cause = 0; }
136 cause( cause_exception );
161Issue::operator std::string()
const {
173 Issue target( source );
184 if (
m_cause == other.m_cause )
return true;
185 return ( *
m_cause ) == *( other.m_cause );
248 const Issue* i =
dynamic_cast<const Issue*
>( c );
294 std::istringstream in(
v );
316 std::istringstream in(
v );
338 std::istringstream in(
v );
415 std::ostringstream stream;
437 std::string value_str = std::string( value );
449 std::ostringstream stream;
450 stream.setf( std::ios::hex, std::ios::basefield );
451 stream << (
unsigned long)ptr;
479 int frame_number = context->stack_frames();
480 for (
int i = 0; i < frame_number; i++ )
482 char key_buffer[256];
483 snprintf( key_buffer,
sizeof( key_buffer ),
"SOURCE-STACK-%03x", i );
484 set_value( key_buffer, context->stack_frame( i ) );
486 std::vector<std::string> qualifs = context->qualifiers();
487 std::vector<std::string>::const_iterator pos;
488 for ( pos = qualifs.begin(); pos != qualifs.end(); pos++ )
500 ctime_r( &now, time_buffer );
501 char* cr = strchr( time_buffer,
'\n' );
502 if ( cr ) { *cr =
'\0'; }
522 const int errno_copy = errno;
573 const Issue* p = this;
574 m_class_name = ers::Core::umangle_gcc_class_name( ( typeid( *p ) ).name() ).c_str();
575 if ( m_class_name.empty() ) { m_class_name = ISSUE_CLASS_NAME; }
577 return m_class_name.c_str();
652 if (
m_human_description.empty() ) { m_human_description = HumanStream::to_string( this ); }
682 std::string::size_type pos = qualif_s.find( qualif );
683 if ( pos != std::string::npos )
return;
684 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 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 char * to_string(severity_t s)
severity_t to string
static severity_t parse_severity(const char *s)
string to severity_t
static const std::string empty_string
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 PROCESS_PWD_KEY
key for the process working directory
responsibility_t responsibility() const
get the responsability level of the issue
void set_values(const string_map_type &values)
sets the value table
static const char *const COMPILATION_TARGET_KEY
key for compilation target
int values_number() const
How many key / values.
static const char *const ERS_VERSION_KEY
key for ERS version
static const char *const HOST_TYPE_KEY
key for host type (architecture / os)
std::string m_class_name
class name
const std::string & get_value(const std::string &key, const std::string &def) const
Reads the property list.
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 SOURCE_PACKAGE_KEY
package name associated with source code
static const char *const COMPILER_KEY
key for compilator type
void set_value(const std::string &key, uint8_t value)
Sets a value 8 bit unsigned.
static const char *const QUALIFIER_LIST_KEY
key used to store the qualifier list
static const char *const CAUSE_PSEUDO_KEY
key used when serializing the cause issue, this key is not used in the value table
void insert_time()
Inserts current time.
std::string m_human_description
Human readable description (cache).
Issue * m_cause
Issue that caused the current issue.
static const char *const CAUSE_TEXT_KEY
key used to store the cause issue's message
severity_t severity() const
severity_t of the issue
static const char *const TIME_KEY
key for the time of the issue (text)
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.
static const char *const HOST_IP_ADDR_KEY
key for host ip address
static const char *const CPP_CLASS_KEY
key for c++ class (might be mangled)
void finish_setup(const std::string &message)
Finishes the setup of the Issue.
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
const std::string & human_description() const
Human description message.
static const char *const PROGRAM_NAME_KEY
key for the name of the program
const Issue * cause() const
return the cause Issue of this Issue
static const char *const TRANSIENCE_KEY
key for the transience of the issue (text)
const char * what() const
Human description message.
Issue(const Context &context, severity_t s)
Constructor for subclasses.
static const char *const EXIT_VALUE_KEY
key used to store the exit value
const string_map_type * get_value_table() const
extract value table
static const char *const USER_NAME_KEY
key for the user-name of the owner of the process
static const char *const RESPONSIBILITY_KEY
key for the responsibility of the issue (text)
static const char *const HOST_NAME_KEY
key for hostname
void add_qualifier(const std::string &qualif)
adds a qualifier to the issue
static const char *const SOURCE_POSITION_KEY
key for position in the source code
static const char *const COMPILATION_DEBUG_LVL_KEY
static const char *const MESSAGE_KEY
key for human readable
static const char *const COMPILATION_TIME_KEY
key for compilation time
static const char *const CLASS_KEY
key for class information
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 ISSUE_CLASS_NAME
name of the class, used for serialisation
static const char *const PROCESS_ID_KEY
key for the process id (number)
void insert(const Context *context)
Inserts the context.
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.
bool operator==(const Issue &other) const
Equality operator.
#define ISSUE_VALUE_SET_SCALAR(table, key, value)
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