BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ers::Issue Class Reference

Root Issue class. More...

#include <Issue.h>

Inheritance diagram for ers::Issue:

Public Member Functions

 Issue ()
 Issue (const Issue &issue)
 Issue (const string_map_type &values)
 Issue (const Context &context, severity_t s, const std::string &message)
 Issue (const Context &context, severity_t s, const std::exception *cause)
virtual ~Issue () throw ()
Issueclone () const
const Issuecause () const throw ()
 return the cause Issue of this Issue
void cause (const std::exception *cause=0)
 Initialises the cause field.
 operator std::string () const
 Converts the issue into a string.
Issue operator= (const Issue &issue)
 Affectation operator.
bool operator== (const Issue &other) const throw ()
 Equality operator.
const std::string & operator[] (const std::string &key) const throw ()
const std::string & get_value (const std::string &key, const std::string &def) const throw ()
 Reads the property list.
const std::string & get_value (const std::string &key) const throw ()
int get_int_value (const std::string &key, int def=0) const throw ()
 Get a value of the table as an integer.
long get_long_value (const std::string &key, long def=0) const throw ()
 Get a value of the table as a long integer.
double get_double_value (const std::string key, double def) const throw ()
 Get a value of the table as double.
void set_value (const std::string &key, uint8_t value) throw ()
 Sets a value 8 bit unsigned.
void set_value (const std::string &key, uint16_t value) throw ()
void set_value (const std::string &key, uint32_t value) throw ()
void set_value (const std::string &key, uint64_t value) throw ()
void set_value (const std::string &key, int8_t value) throw ()
void set_value (const std::string &key, int16_t value) throw ()
void set_value (const std::string &key, int32_t value) throw ()
void set_value (const std::string &key, int64_t value) throw ()
void set_value (const std::string &key, double value) throw ()
 Sets a value (double float).
void set_value (const std::string &key, const std::string &value) throw ()
 Sets a value (string).
void set_value (const std::string &key, const char *value) throw ()
 Sets a value (c-string).
void set_value (const std::string &key, const void *ptr) throw ()
int values_number () const
 How many key / values.
virtual const char * get_class_name () const throw ()
 Get key for class (used for serialisation).
const string_map_typeget_value_table () const
 extract value table
severity_t severity () const throw ()
 severity_t of the issue
void severity (severity_t s)
 sets the severity_t of the issue
bool is_error ()
 is the issue an error (or fatal).
std::string severity_message () const
 message associated with the severity_t of the issue
void responsibility (responsibility_t r)
 set the responsability of the issue
responsibility_t responsibility () const throw ()
 get the responsability level of the issue
void transience (bool tr)
 sets if the issue is transient
int transience () const throw ()
 is the issue transient
const std::string & human_description () const throw ()
 Human description message.
const char * what () const throw ()
 Human description message.
const std::string & message () const throw ()
 Message.
virtual int exit_value () const throw ()
 value to pass to exit
void add_qualifier (const std::string &qualif)
 adds a qualifier to the issue
std::vector< std::string > qualifiers () const
 return array of qualifiers
 Issue ()
 Issue (const Issue &issue)
 Issue (const string_map_type &values)
 Issue (const Context &context, severity_t s, const std::string &message)
 Issue (const Context &context, severity_t s, const std::exception *cause)
virtual ~Issue () throw ()
Issueclone () const
const Issuecause () const throw ()
 return the cause Issue of this Issue
void cause (const std::exception *cause=0)
 Initialises the cause field.
 operator std::string () const
 Converts the issue into a string.
Issue operator= (const Issue &issue)
 Affectation operator.
bool operator== (const Issue &other) const throw ()
 Equality operator.
const std::string & operator[] (const std::string &key) const throw ()
const std::string & get_value (const std::string &key, const std::string &def) const throw ()
 Reads the property list.
const std::string & get_value (const std::string &key) const throw ()
int get_int_value (const std::string &key, int def=0) const throw ()
 Get a value of the table as an integer.
long get_long_value (const std::string &key, long def=0) const throw ()
 Get a value of the table as a long integer.
double get_double_value (const std::string key, double def) const throw ()
 Get a value of the table as double.
void set_value (const std::string &key, uint8_t value) throw ()
 Sets a value 8 bit unsigned.
void set_value (const std::string &key, uint16_t value) throw ()
void set_value (const std::string &key, uint32_t value) throw ()
void set_value (const std::string &key, uint64_t value) throw ()
void set_value (const std::string &key, int8_t value) throw ()
void set_value (const std::string &key, int16_t value) throw ()
void set_value (const std::string &key, int32_t value) throw ()
void set_value (const std::string &key, int64_t value) throw ()
void set_value (const std::string &key, double value) throw ()
 Sets a value (double float).
void set_value (const std::string &key, const std::string &value) throw ()
 Sets a value (string).
void set_value (const std::string &key, const char *value) throw ()
 Sets a value (c-string).
void set_value (const std::string &key, const void *ptr) throw ()
int values_number () const
 How many key / values.
virtual const char * get_class_name () const throw ()
 Get key for class (used for serialisation).
const string_map_typeget_value_table () const
 extract value table
severity_t severity () const throw ()
 severity_t of the issue
void severity (severity_t s)
 sets the severity_t of the issue
bool is_error ()
 is the issue an error (or fatal).
std::string severity_message () const
 message associated with the severity_t of the issue
void responsibility (responsibility_t r)
 set the responsability of the issue
responsibility_t responsibility () const throw ()
 get the responsability level of the issue
void transience (bool tr)
 sets if the issue is transient
int transience () const throw ()
 is the issue transient
const std::string & human_description () const throw ()
 Human description message.
const char * what () const throw ()
 Human description message.
const std::string & message () const throw ()
 Message.
virtual int exit_value () const throw ()
 value to pass to exit
void add_qualifier (const std::string &qualif)
 adds a qualifier to the issue
std::vector< std::string > qualifiers () const
 return array of qualifiers
 Issue ()
 Issue (const Issue &issue)
 Issue (const string_map_type &values)
 Issue (const Context &context, severity_t s, const std::string &message)
 Issue (const Context &context, severity_t s, const std::exception *cause)
virtual ~Issue () throw ()
Issueclone () const
const Issuecause () const throw ()
 return the cause Issue of this Issue
void cause (const std::exception *cause=0)
 Initialises the cause field.
 operator std::string () const
 Converts the issue into a string.
Issue operator= (const Issue &issue)
 Affectation operator.
bool operator== (const Issue &other) const throw ()
 Equality operator.
const std::string & operator[] (const std::string &key) const throw ()
const std::string & get_value (const std::string &key, const std::string &def) const throw ()
 Reads the property list.
const std::string & get_value (const std::string &key) const throw ()
int get_int_value (const std::string &key, int def=0) const throw ()
 Get a value of the table as an integer.
long get_long_value (const std::string &key, long def=0) const throw ()
 Get a value of the table as a long integer.
double get_double_value (const std::string key, double def) const throw ()
 Get a value of the table as double.
void set_value (const std::string &key, uint8_t value) throw ()
 Sets a value 8 bit unsigned.
void set_value (const std::string &key, uint16_t value) throw ()
void set_value (const std::string &key, uint32_t value) throw ()
void set_value (const std::string &key, uint64_t value) throw ()
void set_value (const std::string &key, int8_t value) throw ()
void set_value (const std::string &key, int16_t value) throw ()
void set_value (const std::string &key, int32_t value) throw ()
void set_value (const std::string &key, int64_t value) throw ()
void set_value (const std::string &key, double value) throw ()
 Sets a value (double float).
void set_value (const std::string &key, const std::string &value) throw ()
 Sets a value (string).
void set_value (const std::string &key, const char *value) throw ()
 Sets a value (c-string).
void set_value (const std::string &key, const void *ptr) throw ()
int values_number () const
 How many key / values.
virtual const char * get_class_name () const throw ()
 Get key for class (used for serialisation).
const string_map_typeget_value_table () const
 extract value table
severity_t severity () const throw ()
 severity_t of the issue
void severity (severity_t s)
 sets the severity_t of the issue
bool is_error ()
 is the issue an error (or fatal).
std::string severity_message () const
 message associated with the severity_t of the issue
void responsibility (responsibility_t r)
 set the responsability of the issue
responsibility_t responsibility () const throw ()
 get the responsability level of the issue
void transience (bool tr)
 sets if the issue is transient
int transience () const throw ()
 is the issue transient
const std::string & human_description () const throw ()
 Human description message.
const char * what () const throw ()
 Human description message.
const std::string & message () const throw ()
 Message.
virtual int exit_value () const throw ()
 value to pass to exit
void add_qualifier (const std::string &qualif)
 adds a qualifier to the issue
std::vector< std::string > qualifiers () const
 return array of qualifiers

Static Public Attributes

static const char *const CLASS_KEY = "ISSUE_CLASS"
 key for class information
static const char *const COMPILATION_TIME_KEY = "COMPILATION_TIME"
 key for compilation time
static const char *const COMPILATION_TARGET_KEY = "COMPILATION_TARGET"
 key for compilation target
static const char *const COMPILER_KEY = "COMPILER"
 key for compilator type
static const char *const COMPILATION_DEBUG_LVL_KEY = "COMPILATION_DEBUG_LVL"
static const char *const CPP_CLASS_KEY = "ISSUE_CPP_CLASS"
 key for c++ class (might be mangled)
static const char *const ERS_VERSION_KEY = "ERS_VERSION"
 key for ERS version
static const char *const HOST_NAME_KEY = "HOST_NAME"
 key for hostname
static const char *const HOST_TYPE_KEY = "HOST_TYPE"
 key for host type (architecture / os)
static const char *const HOST_IP_ADDR_KEY = "HOST_IP"
 key for host ip address
static const char *const MESSAGE_KEY = "MESSAGE"
 key for human readable
static const char *const PROCESS_ID_KEY = "PROCESS_ID"
 key for the process id (number)
static const char *const PROCESS_PWD_KEY = "PROCESS_PWD"
 key for the process working directory
static const char *const PROGRAM_NAME_KEY = "PROGRAM_NAME"
 key for the name of the program
static const char *const RESPONSIBILITY_KEY = "RESPONSIBILITY"
 key for the responsibility of the issue (text)
static const char *const SEVERITY_KEY = "SEVERITY"
 key for the severity_t of the issue
static const char *const SOURCE_POSITION_KEY = "SOURCE_POSITION"
 key for position in the source code
static const char *const SOURCE_PACKAGE_KEY = "SOURCE_PACKAGE"
 package name associated with source code
static const char *const TIME_KEY = "TIME"
 key for the time of the issue (text)
static const char *const TRANSIENCE_KEY = "TRANSIENCE"
 key for the transience of the issue (text)
static const char *const USER_ID_KEY = "USER_ID"
 key for the user-id of the owner of the process
static const char *const USER_NAME_KEY = "USER_NAME"
 key for the user-name of the owner of the process
static const char *const CAUSE_PSEUDO_KEY = "CAUSE"
 key used when serializing the cause issue, this key is not used in the value table
static const char *const CAUSE_TEXT_KEY = "CAUSE_TEXT"
 key used to store the cause issue's message
static const char *const QUALIFIER_LIST_KEY = "QUALIFIERS"
 key used to store the qualifier list
static const char *const EXIT_VALUE_KEY = "EXIT_VALUE"
 key used to store the exit value
static const char *const ISSUE_CLASS_NAME = "ers::issue"
 name of the class, used for serialisation

Protected Member Functions

void insert (const Context *context) throw ()
 Inserts the context.
void insert_time () throw ()
 Inserts current time.
void setup_common (const Context *context) throw ()
 Sets up the common fields.
void finish_setup (const std::string &message) throw ()
 Finishes the setup of the Issue.
 Issue (const Context &context, severity_t s)
 Constructor for subclasses.
void set_values (const string_map_type &values) throw ()
 sets the value table
void insert (const Context *context) throw ()
 Inserts the context.
void insert_time () throw ()
 Inserts current time.
void setup_common (const Context *context) throw ()
 Sets up the common fields.
void finish_setup (const std::string &message) throw ()
 Finishes the setup of the Issue.
 Issue (const Context &context, severity_t s)
 Constructor for subclasses.
void set_values (const string_map_type &values) throw ()
 sets the value table
void insert (const Context *context) throw ()
 Inserts the context.
void insert_time () throw ()
 Inserts current time.
void setup_common (const Context *context) throw ()
 Sets up the common fields.
void finish_setup (const std::string &message) throw ()
 Finishes the setup of the Issue.
 Issue (const Context &context, severity_t s)
 Constructor for subclasses.
void set_values (const string_map_type &values) throw ()
 sets the value table

Protected Attributes

Issuem_cause
 Issue that caused the current issue.
std::string m_class_name
 class name
std::string m_human_description
 Human readable description (cache).
string_map_type m_value_table
 Optional properties.

Friends

class Stream
class IssueFactory

Detailed Description

Root Issue class.

This class is the root Issue object. The class does not contain any fields with information, instead everything is stored in a hashmap as key - value paris (both strings). The object contains utility methods to allow the manipulation of those key / values and code to insert common values into it, like time, compilation information, host information etc. For an example of how to build an actual subclass of issue look at the source of ExampleIssue.

Author
Matthias Wiesmann
Version
1.1
Note
Issue chaining is handled by copying the cause issue on the stack and keeping a pointer to it. When the object is destroyed, it destroys the pointed issue. This means we can only chain issues that correctly implement the factory methods required by the IssueFactory class
See also
ers::IssueFactory
ExampleIssue

Definition at line 37 of file Event/ers/include/ers/Issue.h.

Constructor & Destructor Documentation

◆ Issue() [1/18]

Issue::Issue ( const Context & context,
severity_t s )
protected

Constructor for subclasses.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 122 of file ers/src/Issue.cxx.

122 {
123 cause();
124 setup_common( &context );
125 severity( s );
126} // Issue
XmlRpcServer s
severity_t severity() const
severity_t of the issue
const Issue * cause() const
return the cause Issue of this Issue
void setup_common(const Context *context)
Sets up the common fields.

Referenced by ers::Assertion::Assertion(), ers::Assertion::Assertion(), ers::Assertion::Assertion(), cause(), cause(), clone(), ers::DefaultIssue::DefaultIssue(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ExampleIssue::ExampleIssue(), ExampleIssue::ExampleIssue(), ExampleIssue::ExampleIssue(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), Issue(), Issue(), Issue(), Issue(), Issue(), Issue(), ers::IssueFactoryIssue::IssueFactoryIssue(), ers::IssueFactoryIssue::IssueFactoryIssue(), ers::IssueFactoryIssue::IssueFactoryIssue(), ers::LogIssue::LogIssue(), ers::LogIssue::LogIssue(), ers::LogIssue::LogIssue(), operator=(), operator==(), ers::ParseIssue::ParseIssue(), ers::ParseIssue::ParseIssue(), ers::ParseIssue::ParseIssue(), ers::ParseIssue::ParseIssue(), qualifiers(), and ~Issue().

◆ Issue() [2/18]

Issue::Issue ( )

Empty constructor, should only be used when deserialising issues

Definition at line 79 of file ers/src/Issue.cxx.

79 {
80 m_human_description.clear();
81 m_cause = 0;
82} // Issue
std::string m_human_description
Human readable description (cache).
Issue * m_cause
Issue that caused the current issue.

◆ Issue() [3/18]

Issue::Issue ( const Issue & issue)

Copy constructor The m_human_description and the m_value_table fields are simply copied The The issue in the m_cause pointer if present is cloned.

Parameters
issueoriginal for copy

Definition at line 90 of file ers/src/Issue.cxx.

90 : std::exception() {
93 if ( issue.m_cause ) { this->m_cause = issue.m_cause->clone(); }
94 else { this->m_cause = 0; }
95} // Issue
Issue * clone() const
string_map_type m_value_table
Optional properties.

◆ Issue() [4/18]

Issue::Issue ( const string_map_type & values)

Builds an Issue out of a value table

Parameters
valuestable of values for the issue

Definition at line 101 of file ers/src/Issue.cxx.

101 {
102 cause();
103 set_values( values );
104 m_human_description.clear();
105} // Issue
void set_values(const string_map_type &values)
sets the value table

◆ Issue() [5/18]

Issue::Issue ( const Context & context,
severity_t s,
const std::string & m )

Constructor

Parameters
contextthe context of the Issue, e.g where in the code did the issue appear
sseverity_t of the Issue
mmessage of the Issue

Definition at line 113 of file ers/src/Issue.cxx.

113 {
114 cause();
115 setup_common( &context );
116 severity( s );
117 finish_setup( m );
118} // Issue
void finish_setup(const std::string &message)
Finishes the setup of the Issue.

◆ Issue() [6/18]

Issue::Issue ( const Context & context,
severity_t s,
const std::exception * cause_exception )

Constructor - takes another exceptions as the cause for the current exception.

Parameters
contextthe context of the Issue, e.g where in the code did the issue appear
sthe severity_t of the exception
cause_exceptionthe exception that caused the current Issue

Definition at line 134 of file ers/src/Issue.cxx.

134 {
135 ERS_PRE_CHECK_PTR( cause_exception );
136 cause( cause_exception );
137 setup_common( &context );
138 severity( s );
139 finish_setup( cause_exception->what() );
140} // Issue

◆ ~Issue() [1/3]

Issue::~Issue ( )
throw ( )
virtual

Destructor. If the m_cause pointer is not null, the pointed Issue is deleted

Reimplemented in eformat::Issue, eformat::Issue, and eformat::Issue.

Definition at line 146 of file ers/src/Issue.cxx.

146 {
147 if ( m_cause ) delete m_cause;
148 m_cause = 0;
149} // ~Issue

◆ Issue() [7/18]

ers::Issue::Issue ( const Context & context,
severity_t s )
protected

Constructor for subclasses.

◆ Issue() [8/18]

ers::Issue::Issue ( )

◆ Issue() [9/18]

ers::Issue::Issue ( const Issue & issue)

◆ Issue() [10/18]

ers::Issue::Issue ( const string_map_type & values)

◆ Issue() [11/18]

ers::Issue::Issue ( const Context & context,
severity_t s,
const std::string & message )

◆ Issue() [12/18]

ers::Issue::Issue ( const Context & context,
severity_t s,
const std::exception * cause )

◆ ~Issue() [2/3]

virtual ers::Issue::~Issue ( )
throw ( )
virtual

Reimplemented in eformat::Issue, eformat::Issue, and eformat::Issue.

◆ Issue() [13/18]

ers::Issue::Issue ( const Context & context,
severity_t s )
protected

Constructor for subclasses.

◆ Issue() [14/18]

ers::Issue::Issue ( )

◆ Issue() [15/18]

ers::Issue::Issue ( const Issue & issue)

◆ Issue() [16/18]

ers::Issue::Issue ( const string_map_type & values)

◆ Issue() [17/18]

ers::Issue::Issue ( const Context & context,
severity_t s,
const std::string & message )

◆ Issue() [18/18]

ers::Issue::Issue ( const Context & context,
severity_t s,
const std::exception * cause )

◆ ~Issue() [3/3]

virtual ers::Issue::~Issue ( )
throw ( )
virtual

Reimplemented in eformat::Issue, eformat::Issue, and eformat::Issue.

Member Function Documentation

◆ add_qualifier() [1/3]

void Issue::add_qualifier ( const std::string & qualif)

adds a qualifier to the issue

Add a qualifier to the qualifier list

Parameters
qualifthe qualifier to add

Definition at line 680 of file ers/src/Issue.cxx.

680 {
681 const std::string& qualif_s = get_value( QUALIFIER_LIST_KEY );
682 std::string::size_type pos = qualif_s.find( qualif );
683 if ( pos != std::string::npos ) return; // already present
684 std::string n_qualif = qualif_s + qualif + " ";
685 set_value( QUALIFIER_LIST_KEY, n_qualif );
686} // add_qualifier
const std::string & get_value(const std::string &key, const std::string &def) const
Reads the property list.
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

Referenced by add_qualifier(), and insert().

◆ add_qualifier() [2/3]

void ers::Issue::add_qualifier ( const std::string & qualif)

adds a qualifier to the issue

◆ add_qualifier() [3/3]

void ers::Issue::add_qualifier ( const std::string & qualif)

adds a qualifier to the issue

◆ cause() [1/6]

const Issue * Issue::cause ( ) const
throw ( )

return the cause Issue of this Issue

Returns
the cause of the issue, if there is one, a null pointer otherwise

Definition at line 232 of file ers/src/Issue.cxx.

232{ return m_cause; } // cause

Referenced by cause(), cause(), Issue(), Issue(), Issue(), and Issue().

◆ cause() [2/6]

const Issue * ers::Issue::cause ( ) const
throw ( )

return the cause Issue of this Issue

◆ cause() [3/6]

const Issue * ers::Issue::cause ( ) const
throw ( )

return the cause Issue of this Issue

◆ cause() [4/6]

void Issue::cause ( const std::exception * c = 0)

Initialises the cause field.

Sets the cause of the issue If the cause is an Issue, it is cloned and stored in the m_cause pointer. In all cases, the description of the cause is stored in the value table using the CAUSE_TEXT_KEY key. If the cause pointer is null, the m_cause field is simply cleared.

Parameters
cpointer to the cause exception

Definition at line 242 of file ers/src/Issue.cxx.

242 {
243 if ( c == 0 )
244 {
245 m_cause = 0;
246 return;
247 } // No cause easy.
248 const Issue* i = dynamic_cast<const Issue*>( c );
249 if ( i ) { m_cause = i->clone(); }
250 else { m_cause = 0; } // if
251 set_value( CAUSE_TEXT_KEY, c->what() );
252} // cause
static const char *const CAUSE_TEXT_KEY
key used to store the cause issue's message
Issue(const Context &context, severity_t s)
Constructor for subclasses.

◆ cause() [5/6]

void ers::Issue::cause ( const std::exception * cause = 0)

Initialises the cause field.

◆ cause() [6/6]

void ers::Issue::cause ( const std::exception * cause = 0)

Initialises the cause field.

◆ clone() [1/3]

Issue * Issue::clone ( ) const

Builds a clone of the object. The object is allocated on the stack, and should be deleted by the caller

Returns
a new object that is a copy of the current object

Definition at line 159 of file ers/src/Issue.cxx.

159{ return IssueFactory::instance()->build( this ); } // clone
static IssueFactory * instance()
method to access singleton
Issue * build(const std::string &name) const
build an empty issue out of a name

Referenced by cause(), clone(), and ers::FIFOStream::send().

◆ clone() [2/3]

Issue * ers::Issue::clone ( ) const

◆ clone() [3/3]

Issue * ers::Issue::clone ( ) const

◆ exit_value() [1/3]

int Issue::exit_value ( ) const
throw ( )
virtual

value to pass to exit

Definition at line 670 of file ers/src/Issue.cxx.

670 {
671 int v = 1;
672 if ( transience() == 1 ) v = EX_TEMPFAIL;
673 return get_int_value( EXIT_VALUE_KEY, v );
674} // exit_value
**********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
Definition KarLud.h:35
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 EXIT_VALUE_KEY
key used to store the exit value
int transience() const
is the issue transient

Referenced by exit_value().

◆ exit_value() [2/3]

virtual int ers::Issue::exit_value ( ) const
throw ( )
virtual

value to pass to exit

◆ exit_value() [3/3]

virtual int ers::Issue::exit_value ( ) const
throw ( )
virtual

value to pass to exit

◆ finish_setup() [1/3]

void Issue::finish_setup ( const std::string & msg)
throw ( )
protected

Finishes the setup of the Issue.

Finishes the setting up of the information fields. In particular, in fills in the human message and the class type fields (those fields are not available until the end of the object construction.

Note
this method should be called by the sub-class constructor, so that RTTI information is setup and correct.
Parameters
messagehuman readable message
Note
All method used within this method should throw no exceptions to avoid circular problems.

Definition at line 553 of file ers/src/Issue.cxx.

553 {
554 // set_value(CPP_CLASS_KEY,class_name);
556 set_value( MESSAGE_KEY, msg );
557} // finish_setup
static const char *const MESSAGE_KEY
key for human readable
static const char *const CLASS_KEY
key for class information
virtual const char * get_class_name() const
Get key for class (used for serialisation).

Referenced by eformat::BadVersionIssue::BadVersionIssue(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ExampleIssue::ExampleIssue(), finish_setup(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), eformat::Issue::Issue(), Issue(), Issue(), ers::IssueFactoryIssue::IssueFactoryIssue(), ers::LogIssue::LogIssue(), eformat::NoSuchChildIssue::NoSuchChildIssue(), eformat::NotAlignedIssue::NotAlignedIssue(), eformat::OutOfBoundsIssue::OutOfBoundsIssue(), ers::ParseIssue::ParseIssue(), ers::ParseIssue::ParseIssue(), ers::RangeIssue::RangeIssue(), ers::Assertion::setup(), eformat::SizeCheckIssue::SizeCheckIssue(), eformat::TooBigCountIssue::TooBigCountIssue(), eformat::UnboundSourceIdentifierIssue::UnboundSourceIdentifierIssue(), eformat::WrongMarkerIssue::WrongMarkerIssue(), and eformat::WrongSizeIssue::WrongSizeIssue().

◆ finish_setup() [2/3]

void ers::Issue::finish_setup ( const std::string & message)
throw ( )
protected

Finishes the setup of the Issue.

◆ finish_setup() [3/3]

void ers::Issue::finish_setup ( const std::string & message)
throw ( )
protected

Finishes the setup of the Issue.

◆ get_class_name() [1/3]

const char * Issue::get_class_name ( ) const
throw ( )
virtual

Get key for class (used for serialisation).

Returns the key used to describe this particular class when serializing This method tries to build a meaningfull class name out of C++ RTTI. This depends on the compiler providing information in a format similar to gcc. For more safety. If the gcc unmangling fails the default (ers::Issue) is used.

Reimplemented in ers::Assertion, ers::Assertion, ers::Assertion, ers::DefaultIssue, ers::DefaultIssue, ers::DefaultIssue, ers::EntityNotFoundIssue, ers::EntityNotFoundIssue, ers::EntityNotFoundIssue, ers::InvalidReferenceIssue, ers::InvalidReferenceIssue, ers::InvalidReferenceIssue, ers::IssueFactoryIssue, ers::IssueFactoryIssue, ers::IssueFactoryIssue, ers::LogIssue, ers::LogIssue, ers::LogIssue, ers::NotImplemented, ers::NotImplemented, ers::NotImplemented, ers::ParseIssue, ers::ParseIssue, ers::ParseIssue, ers::Precondition, ers::Precondition, ers::Precondition, ers::RangeIssue, ers::RangeIssue, ers::RangeIssue, and ExampleIssue.

Definition at line 570 of file ers/src/Issue.cxx.

570 {
571 if ( m_class_name.empty() )
572 {
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; } // fall back
576 }
577 return m_class_name.c_str();
578} // get_class_name
static std::string umangle_gcc_class_name(const char *name)
unmangles gcc RTTI names
Definition Core.cxx:139
std::string m_class_name
class name
static const char *const ISSUE_CLASS_NAME
name of the class, used for serialisation

Referenced by ers::IssueFactory::build(), finish_setup(), and get_class_name().

◆ get_class_name() [2/3]

◆ get_class_name() [3/3]

◆ get_double_value() [1/3]

double Issue::get_double_value ( const std::string key,
double def = nan( "" ) ) const
throw ( )

Get a value of the table as double.

Get a property of an issue as an double

Parameters
keythe key to search for
defthe value to return if key is not found - the default value for this parameter is NaN.
Returns
value of key or def

Definition at line 334 of file ers/src/Issue.cxx.

334 {
335 std::string v = get_value( key );
336 if ( !v.empty() )
337 { // not empty
338 std::istringstream in( v );
339 double n;
340 in >> n;
341 return n;
342 // return atoi(v.c_str());
343 }
344 else
345 { // empty
346 return def;
347 } // empty
348} // get_double_value
const Int_t n
*************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
Definition Taupair.h:42

Referenced by get_double_value().

◆ get_double_value() [2/3]

double ers::Issue::get_double_value ( const std::string key,
double def ) const
throw ( )

Get a value of the table as double.

◆ get_double_value() [3/3]

double ers::Issue::get_double_value ( const std::string key,
double def ) const
throw ( )

Get a value of the table as double.

◆ get_int_value() [1/3]

int Issue::get_int_value ( const std::string & key,
int def = 0 ) const
throw ( )

Get a value of the table as an integer.

Get a property of an issue as an integer

Parameters
keythe key to search for
defthe value to return if key is not found
Returns
value of key or def

Definition at line 290 of file ers/src/Issue.cxx.

290 {
291 std::string v = get_value( key );
292 if ( !v.empty() )
293 { // not empty
294 std::istringstream in( v );
295 int n;
296 in >> n;
297 return n;
298 // return atoi(v.c_str());
299 }
300 else
301 { // empty
302 return def;
303 } // empty
304} // get_int_value

Referenced by eformat::SizeCheckIssue::actual(), eformat::TooBigCountIssue::count(), eformat::BadVersionIssue::current(), eformat::WrongMarkerIssue::current(), exit_value(), eformat::WrongMarkerIssue::expected(), get_int_value(), eformat::SizeCheckIssue::informed(), eformat::TooBigCountIssue::max_count(), eformat::OutOfBoundsIssue::pos(), ExampleIssue::procrastination_level(), eformat::NoSuchChildIssue::requested(), eformat::NotAlignedIssue::size(), eformat::OutOfBoundsIssue::size(), eformat::WrongSizeIssue::size(), eformat::UnboundSourceIdentifierIssue::source_id(), eformat::BadVersionIssue::supported(), and eformat::NoSuchChildIssue::total().

◆ get_int_value() [2/3]

int ers::Issue::get_int_value ( const std::string & key,
int def = 0 ) const
throw ( )

Get a value of the table as an integer.

◆ get_int_value() [3/3]

int ers::Issue::get_int_value ( const std::string & key,
int def = 0 ) const
throw ( )

Get a value of the table as an integer.

◆ get_long_value() [1/3]

long Issue::get_long_value ( const std::string & key,
long def = 0 ) const
throw ( )

Get a value of the table as a long integer.

Get a property of an issue as an long

Parameters
keythe key to search for
defthe value to return if key is not found
Returns
value of key or def

Definition at line 312 of file ers/src/Issue.cxx.

312 {
313 std::string v = get_value( key );
314 if ( !v.empty() )
315 { // not empty
316 std::istringstream in( v );
317 long n;
318 in >> n;
319 return n;
320 // return atoi(v.c_str());
321 }
322 else
323 { // empty
324 return def;
325 } // empty
326} // get_long_value

Referenced by get_long_value().

◆ get_long_value() [2/3]

long ers::Issue::get_long_value ( const std::string & key,
long def = 0 ) const
throw ( )

Get a value of the table as a long integer.

◆ get_long_value() [3/3]

long ers::Issue::get_long_value ( const std::string & key,
long def = 0 ) const
throw ( )

Get a value of the table as a long integer.

◆ get_value() [1/6]

const std::string & Issue::get_value ( const std::string & key) const
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 280 of file ers/src/Issue.cxx.

280 {
282} // get_value
static const std::string empty_string

◆ get_value() [2/6]

const std::string & ers::Issue::get_value ( const std::string & key) const
throw ( )

◆ get_value() [3/6]

const std::string & ers::Issue::get_value ( const std::string & key) const
throw ( )

◆ get_value() [4/6]

const std::string & Issue::get_value ( const std::string & key,
const std::string & def ) const
throw ( )

Reads the property list.

General method for querying properties of the Issue

Parameters
keythe key to lookup
Returns
the string value for the key and empty string if the key is not found

Definition at line 270 of file ers/src/Issue.cxx.

271 {
272 string_map_type::const_iterator pos = m_value_table.find( key );
273 if ( pos != m_value_table.end() ) { return pos->second; } // if
274 return def;
275} // get_value

Referenced by add_qualifier(), eformat::NotAlignedIssue::base(), get_double_value(), get_int_value(), get_long_value(), get_value(), get_value(), ers::FilterStream::is_accept(), message(), eformat::UnboundSourceIdentifierIssue::my_context(), operator[](), qualifiers(), responsibility(), ers::DefaultStream::send(), ers::HumanStream::send(), severity(), severity_message(), and transience().

◆ get_value() [5/6]

const std::string & ers::Issue::get_value ( const std::string & key,
const std::string & def ) const
throw ( )

Reads the property list.

◆ get_value() [6/6]

const std::string & ers::Issue::get_value ( const std::string & key,
const std::string & def ) const
throw ( )

Reads the property list.

◆ get_value_table() [1/3]

const string_map_type * Issue::get_value_table ( ) const

extract value table

Returns a read-only pointer to the value table

Returns
read only pointer to the table

Definition at line 261 of file ers/src/Issue.cxx.

261 {
262 return &m_value_table;
263} // get_value_table

Referenced by ers::IssueFactory::build(), get_value_table(), ers::DefaultStream::send(), and ers::HumanStream::send().

◆ get_value_table() [2/3]

const string_map_type * ers::Issue::get_value_table ( ) const

extract value table

◆ get_value_table() [3/3]

const string_map_type * ers::Issue::get_value_table ( ) const

extract value table

◆ human_description() [1/3]

const std::string & Issue::human_description ( ) const
throw ( )

Human description message.

Returns
human description of the Issue

Definition at line 651 of file ers/src/Issue.cxx.

651 {
653 return m_human_description;
654} // human_description
std::string to_string()

Referenced by human_description(), operator std::string(), ers::operator<<(), and what().

◆ human_description() [2/3]

const std::string & ers::Issue::human_description ( ) const
throw ( )

Human description message.

◆ human_description() [3/3]

const std::string & ers::Issue::human_description ( ) const
throw ( )

Human description message.

◆ insert() [1/3]

void Issue::insert ( const Context * context)
throw ( )
protected

Inserts the context.

Inserts the context of the issue into the issue

Parameters
contextpointer to context object

Definition at line 469 of file ers/src/Issue.cxx.

469 {
470 if ( context )
471 {
474 set_value( COMPILER_KEY, context->compiler() );
477 int lvl = ers::Context::debug_level();
478 if ( lvl >= 0 ) { set_value( COMPILATION_DEBUG_LVL_KEY, lvl ); } // if
479 int frame_number = context->stack_frames();
480 for ( int i = 0; i < frame_number; i++ )
481 {
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 ) );
485 } // for
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++ )
489 { add_qualifier( *pos ); } // for
490 } // if context
491} // insert
const std::string & package_name() const
Definition Context.cxx:180
const std::string & stack_frame(int i) const
Definition Context.cxx:219
std::vector< std::string > qualifiers() const
Definition Context.cxx:228
static int debug_level()
Definition Context.cxx:50
const std::string & compiler() const
Definition Context.cxx:146
const std::string & compilation() const
Definition Context.cxx:164
const std::string & position() const
Definition Context.cxx:124
static std::string & host_type()
type of target host
Definition Context.cxx:41
int stack_frames() const
Definition Context.cxx:215
static const char *const COMPILATION_TARGET_KEY
key for compilation target
static const char *const SOURCE_PACKAGE_KEY
package name associated with source code
static const char *const COMPILER_KEY
key for compilator type
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 COMPILATION_TIME_KEY
key for compilation time

Referenced by setup_common().

◆ insert() [2/3]

void ers::Issue::insert ( const Context * context)
throw ( )
protected

Inserts the context.

◆ insert() [3/3]

void ers::Issue::insert ( const Context * context)
throw ( )
protected

Inserts the context.

◆ insert_time() [1/3]

void Issue::insert_time ( )
throw ( )
protected

Inserts current time.

Inserts the current time into the issue

Definition at line 496 of file ers/src/Issue.cxx.

496 {
497 time_t now;
498 time( &now );
499 char time_buffer[BUFFER_SIZE];
500 ctime_r( &now, time_buffer );
501 char* cr = strchr( time_buffer, '\n' );
502 if ( cr ) { *cr = '\0'; } // carriage return
503 set_value( TIME_KEY, time_buffer );
504} // insert_time
Double_t time
static const char *const TIME_KEY
key for the time of the issue (text)
#define BUFFER_SIZE

Referenced by setup_common().

◆ insert_time() [2/3]

void ers::Issue::insert_time ( )
throw ( )
protected

Inserts current time.

◆ insert_time() [3/3]

void ers::Issue::insert_time ( )
throw ( )
protected

Inserts current time.

◆ is_error() [1/3]

bool Issue::is_error ( )

is the issue an error (or fatal).

Is the issue either an error or a fatal error

Returns
true if the issue is either an error or a fatal

Definition at line 601 of file ers/src/Issue.cxx.

601 {
603 return ( s == ers::error || s == ers::fatal );
604} // is_error
enum ers::_severity_t severity_t

Referenced by ers::StreamFactory::dispatch(), and is_error().

◆ is_error() [2/3]

bool ers::Issue::is_error ( )

is the issue an error (or fatal).

◆ is_error() [3/3]

bool ers::Issue::is_error ( )

is the issue an error (or fatal).

◆ message() [1/3]

◆ message() [2/3]

const std::string & ers::Issue::message ( ) const
throw ( )

Message.

◆ message() [3/3]

const std::string & ers::Issue::message ( ) const
throw ( )

Message.

◆ operator std::string() [1/3]

Issue::operator std::string ( ) const

Converts the issue into a string.

Definition at line 161 of file ers/src/Issue.cxx.

161 {
162 std::string s = human_description();
163 return s;
164} // std::string()
const std::string & human_description() const
Human description message.

◆ operator std::string() [2/3]

ers::Issue::operator std::string ( ) const

Converts the issue into a string.

◆ operator std::string() [3/3]

ers::Issue::operator std::string ( ) const

Converts the issue into a string.

◆ operator=() [1/3]

Issue Issue::operator= ( const Issue & source)

Affectation operator.

Copy operator

Parameters
sourcethe original issue
Returns
the copy issue
Note
The m_cause member, if non null, is cloned

Definition at line 172 of file ers/src/Issue.cxx.

172 {
173 Issue target( source );
174 return target;
175} // operator=

◆ operator=() [2/3]

Issue ers::Issue::operator= ( const Issue & issue)

Affectation operator.

◆ operator=() [3/3]

Issue ers::Issue::operator= ( const Issue & issue)

Affectation operator.

◆ operator==() [1/3]

bool Issue::operator== ( const Issue & other) const
throw ( )

Equality operator.

Comparison operator

Parameters
otherissue to compare to
Returns
true if this and other are equal

Definition at line 182 of file ers/src/Issue.cxx.

182 {
183 if ( m_value_table != other.m_value_table ) return false;
184 if ( m_cause == other.m_cause ) return true;
185 return ( *m_cause ) == *( other.m_cause );
186} // operator==
Index other(Index i, Index j)

◆ operator==() [2/3]

bool ers::Issue::operator== ( const Issue & other) const
throw ( )

Equality operator.

◆ operator==() [3/3]

bool ers::Issue::operator== ( const Issue & other) const
throw ( )

Equality operator.

◆ operator[]() [1/3]

const std::string & Issue::operator[] ( const std::string & key) const
throw ( )

Array access operator

Parameters
keythe resolve
Returns
string containing value
See also
get_value(const std::string &)

Definition at line 194 of file ers/src/Issue.cxx.

194 {
195 return get_value( key, "" );
196} // operator[]

◆ operator[]() [2/3]

const std::string & ers::Issue::operator[] ( const std::string & key) const
throw ( )

◆ operator[]() [3/3]

const std::string & ers::Issue::operator[] ( const std::string & key) const
throw ( )

◆ qualifiers() [1/3]

std::vector< std::string > Issue::qualifiers ( ) const

return array of qualifiers

Gets the list of qualifiers

Returns
list of qualifiers

Definition at line 692 of file ers/src/Issue.cxx.

692 {
693 const std::string& qualif_s = get_value( QUALIFIER_LIST_KEY );
694 return ers::Core::tokenize( qualif_s, ", \t" );
695} // qualifiers
static std::vector< std::string > tokenize(const std::string &text, const std::string &separators)
Definition Core.cxx:157

Referenced by qualifiers().

◆ qualifiers() [2/3]

std::vector< std::string > ers::Issue::qualifiers ( ) const

return array of qualifiers

◆ qualifiers() [3/3]

std::vector< std::string > ers::Issue::qualifiers ( ) const

return array of qualifiers

◆ responsibility() [1/6]

responsibility_t Issue::responsibility ( ) const
throw ( )

get the responsability level of the issue

Gets the responsibility type of the Issue

Returns
the responsibiliy value of the Issue

Definition at line 618 of file ers/src/Issue.cxx.

618 {
619 std::string value = this->get_value( RESPONSIBILITY_KEY );
620 return ers::Core::parse_responsibility( value );
621} // responsability
static responsibility_t parse_responsibility(const char *s)
string to responsibility
Definition Core.cxx:69
static const char *const RESPONSIBILITY_KEY
key for the responsibility of the issue (text)

Referenced by ers::InvalidReferenceIssue::InvalidReferenceIssue().

◆ responsibility() [2/6]

responsibility_t ers::Issue::responsibility ( ) const
throw ( )

get the responsability level of the issue

◆ responsibility() [3/6]

responsibility_t ers::Issue::responsibility ( ) const
throw ( )

get the responsability level of the issue

◆ responsibility() [4/6]

void Issue::responsibility ( responsibility_t r)

set the responsability of the issue

Sets the responsbility of the Issue

Parameters
rthe responsibility type

Definition at line 627 of file ers/src/Issue.cxx.

627 {
629} // responsability
static const char * to_string(severity_t s)
severity_t to string
Definition Core.cxx:25

Referenced by responsibility(), responsibility(), and ers::Assertion::setup().

◆ responsibility() [5/6]

void ers::Issue::responsibility ( responsibility_t r)

set the responsability of the issue

◆ responsibility() [6/6]

void ers::Issue::responsibility ( responsibility_t r)

set the responsability of the issue

◆ set_value() [1/36]

void Issue::set_value ( const std::string & key,
const char * value )
throw ( )

Sets a value (c-string).

Sets a string value in the value table

Parameters
keythe key to use for insertion
valuec-string, null pointer is ignored.

Definition at line 434 of file ers/src/Issue.cxx.

434 {
435 if ( value )
436 {
437 std::string value_str = std::string( value );
438 set_value( key, value_str );
439 } // if
440} // set_value

◆ set_value() [2/36]

void ers::Issue::set_value ( const std::string & key,
const char * value )
throw ( )

Sets a value (c-string).

◆ set_value() [3/36]

void ers::Issue::set_value ( const std::string & key,
const char * value )
throw ( )

Sets a value (c-string).

◆ set_value() [4/36]

void Issue::set_value ( const std::string & key,
const std::string & value )
throw ( )

Sets a value (string).

Sets a string value in the value table

Parameters
keythe key to use for insertion
valuethe value to insert

Definition at line 425 of file ers/src/Issue.cxx.

425 {
426 if ( !value.empty() ) { m_value_table[key] = value; }
427} // set_value

◆ set_value() [5/36]

void ers::Issue::set_value ( const std::string & key,
const std::string & value )
throw ( )

Sets a value (string).

◆ set_value() [6/36]

void ers::Issue::set_value ( const std::string & key,
const std::string & value )
throw ( )

Sets a value (string).

◆ set_value() [7/36]

void Issue::set_value ( const std::string & key,
const void * ptr )
throw ( )

Sets a pointer in the value table

Parameters
keythe key to use for insertion
ptra pointer
Note
the pointer is stored in hex format

Definition at line 448 of file ers/src/Issue.cxx.

448 {
449 std::ostringstream stream;
450 stream.setf( std::ios::hex, std::ios::basefield );
451 stream << (unsigned long)ptr;
452 m_value_table[key] = stream.str();
453} // set_value

◆ set_value() [8/36]

void ers::Issue::set_value ( const std::string & key,
const void * ptr )
throw ( )

◆ set_value() [9/36]

void ers::Issue::set_value ( const std::string & key,
const void * ptr )
throw ( )

◆ set_value() [10/36]

void Issue::set_value ( const std::string & key,
double value )
throw ( )

Sets a value (double float).

Set a numerical value in the value table

Parameters
keythe key to use for insertion
valuethe value to insert

Definition at line 414 of file ers/src/Issue.cxx.

414 {
415 std::ostringstream stream;
416 stream << value;
417 m_value_table[key] = stream.str();
418} // set_value

◆ set_value() [11/36]

void ers::Issue::set_value ( const std::string & key,
double value )
throw ( )

Sets a value (double float).

◆ set_value() [12/36]

void ers::Issue::set_value ( const std::string & key,
double value )
throw ( )

Sets a value (double float).

◆ set_value() [13/36]

void Issue::set_value ( const std::string & key,
int16_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 393 of file ers/src/Issue.cxx.

393 {
395} // set_value
#define ISSUE_VALUE_SET_SCALAR(table, key, value)

◆ set_value() [14/36]

void ers::Issue::set_value ( const std::string & key,
int16_t value )
throw ( )

◆ set_value() [15/36]

void ers::Issue::set_value ( const std::string & key,
int16_t value )
throw ( )

◆ set_value() [16/36]

void Issue::set_value ( const std::string & key,
int32_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 399 of file ers/src/Issue.cxx.

399 {
401} // set_value

◆ set_value() [17/36]

void ers::Issue::set_value ( const std::string & key,
int32_t value )
throw ( )

◆ set_value() [18/36]

void ers::Issue::set_value ( const std::string & key,
int32_t value )
throw ( )

◆ set_value() [19/36]

void Issue::set_value ( const std::string & key,
int64_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 405 of file ers/src/Issue.cxx.

405 {
407} // set_value

◆ set_value() [20/36]

void ers::Issue::set_value ( const std::string & key,
int64_t value )
throw ( )

◆ set_value() [21/36]

void ers::Issue::set_value ( const std::string & key,
int64_t value )
throw ( )

◆ set_value() [22/36]

void Issue::set_value ( const std::string & key,
int8_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 387 of file ers/src/Issue.cxx.

387 {
389} // set_value

◆ set_value() [23/36]

void ers::Issue::set_value ( const std::string & key,
int8_t value )
throw ( )

◆ set_value() [24/36]

void ers::Issue::set_value ( const std::string & key,
int8_t value )
throw ( )

◆ set_value() [25/36]

void Issue::set_value ( const std::string & key,
uint16_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 369 of file ers/src/Issue.cxx.

369 {
371} // set_value

◆ set_value() [26/36]

void ers::Issue::set_value ( const std::string & key,
uint16_t value )
throw ( )

◆ set_value() [27/36]

void ers::Issue::set_value ( const std::string & key,
uint16_t value )
throw ( )

◆ set_value() [28/36]

void Issue::set_value ( const std::string & key,
uint32_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 375 of file ers/src/Issue.cxx.

375 {
377} // set_value

◆ set_value() [29/36]

void ers::Issue::set_value ( const std::string & key,
uint32_t value )
throw ( )

◆ set_value() [30/36]

void ers::Issue::set_value ( const std::string & key,
uint32_t value )
throw ( )

◆ set_value() [31/36]

void Issue::set_value ( const std::string & key,
uint64_t value )
throw ( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 381 of file ers/src/Issue.cxx.

381 {
383} // set_value

◆ set_value() [32/36]

void ers::Issue::set_value ( const std::string & key,
uint64_t value )
throw ( )

◆ set_value() [33/36]

void ers::Issue::set_value ( const std::string & key,
uint64_t value )
throw ( )

◆ set_value() [34/36]

◆ set_value() [35/36]

void ers::Issue::set_value ( const std::string & key,
uint8_t value )
throw ( )

Sets a value 8 bit unsigned.

◆ set_value() [36/36]

void ers::Issue::set_value ( const std::string & key,
uint8_t value )
throw ( )

Sets a value 8 bit unsigned.

◆ set_values() [1/3]

void Issue::set_values ( const string_map_type & values)
throw ( )
protected

sets the value table

Sets the value table

Parameters
valuesthe value table to load

Definition at line 354 of file ers/src/Issue.cxx.

354 {
355 m_value_table = values;
356} // load_values

Referenced by ers::IssueFactory::build(), Issue(), and set_values().

◆ set_values() [2/3]

void ers::Issue::set_values ( const string_map_type & values)
throw ( )
protected

sets the value table

◆ set_values() [3/3]

void ers::Issue::set_values ( const string_map_type & values)
throw ( )
protected

sets the value table

◆ setup_common() [1/3]

void Issue::setup_common ( const Context * context)
throw ( )
protected

Sets up the common fields.

This method sets up common fields for all Issues. In particular, it inserts all data concerning the Issue's context, this includes

  • Source code position (file/line)
  • Compiler version
  • Compilation time and date
Parameters
contextcontext where the exception occured, this should be the ERS_HERE macro.
Note
All method used within this method should throw no exceptions to avoid circular problems.

Definition at line 521 of file ers/src/Issue.cxx.

521 {
522 const int errno_copy = errno; // We need to save errno, because it might be changed
523 insert( context );
524 insert_time();
525 errno = errno_copy; // we restaure errno
526} // setup_common
void insert_time()
Inserts current time.
void insert(const Context *context)
Inserts the context.

Referenced by Issue(), Issue(), Issue(), and setup_common().

◆ setup_common() [2/3]

void ers::Issue::setup_common ( const Context * context)
throw ( )
protected

Sets up the common fields.

◆ setup_common() [3/3]

void ers::Issue::setup_common ( const Context * context)
throw ( )
protected

Sets up the common fields.

◆ severity() [1/6]

◆ severity() [2/6]

severity_t ers::Issue::severity ( ) const
throw ( )

severity_t of the issue

◆ severity() [3/6]

severity_t ers::Issue::severity ( ) const
throw ( )

severity_t of the issue

◆ severity() [4/6]

void Issue::severity ( severity_t s)

sets the severity_t of the issue

Set the severity_t of the Issue

Parameters
sthe severity_t level

Definition at line 593 of file ers/src/Issue.cxx.

593 {
595} // severity

◆ severity() [5/6]

void ers::Issue::severity ( severity_t s)

sets the severity_t of the issue

◆ severity() [6/6]

void ers::Issue::severity ( severity_t s)

sets the severity_t of the issue

◆ severity_message() [1/3]

std::string Issue::severity_message ( ) const

message associated with the severity_t of the issue

Returns
the string representing the severity_t of the issue

Definition at line 610 of file ers/src/Issue.cxx.

610 {
611 return get_value( SEVERITY_KEY );
612} // severity_message

Referenced by severity_message().

◆ severity_message() [2/3]

std::string ers::Issue::severity_message ( ) const

message associated with the severity_t of the issue

◆ severity_message() [3/3]

std::string ers::Issue::severity_message ( ) const

message associated with the severity_t of the issue

◆ transience() [1/6]

int Issue::transience ( ) const
throw ( )

is the issue transient

Returns
the transience of the issue, 1 = true, 0 = false, -1 = unknown

Definition at line 642 of file ers/src/Issue.cxx.

642 {
643 std::string value = this->get_value( TRANSIENCE_KEY );
644 return ers::Core::parse_boolean( value.c_str() );
645} // transience
static int parse_boolean(const char *s)
string to boolean
Definition Core.cxx:93
static const char *const TRANSIENCE_KEY
key for the transience of the issue (text)

Referenced by exit_value().

◆ transience() [2/6]

int ers::Issue::transience ( ) const
throw ( )

is the issue transient

◆ transience() [3/6]

int ers::Issue::transience ( ) const
throw ( )

is the issue transient

◆ transience() [4/6]

void Issue::transience ( bool tr)

sets if the issue is transient

Sets the transience of the issue

Parameters
trtrue if the issue is transient, false if not

Definition at line 635 of file ers/src/Issue.cxx.

635 {
637} // transience
DOUBLE_PRECISION tr[3]

Referenced by ers::Assertion::setup(), transience(), and transience().

◆ transience() [5/6]

void ers::Issue::transience ( bool tr)

sets if the issue is transient

◆ transience() [6/6]

void ers::Issue::transience ( bool tr)

sets if the issue is transient

◆ values_number() [1/3]

int Issue::values_number ( ) const

How many key / values.

Returns
the number of key/value pairs in the issue

Definition at line 459 of file ers/src/Issue.cxx.

459{ return m_value_table.size(); } // values_number

Referenced by values_number().

◆ values_number() [2/3]

int ers::Issue::values_number ( ) const

How many key / values.

◆ values_number() [3/3]

int ers::Issue::values_number ( ) const

How many key / values.

◆ what() [1/3]

const char * Issue::what ( ) const
throw ( )

Human description message.

This method overides the what method of the std::exception class. As this method is declared const, it has to use a pre-calculated string

Returns
C style string of human_description

Definition at line 661 of file ers/src/Issue.cxx.

661 {
662 std::string desr = human_description();
663 return desr.c_str();
664} // what();

Referenced by EFEventLoopMgr::executeEvent(), main(), main(), and what().

◆ what() [2/3]

const char * ers::Issue::what ( ) const
throw ( )

Human description message.

◆ what() [3/3]

const char * ers::Issue::what ( ) const
throw ( )

Human description message.

◆ IssueFactory

IssueFactory
friend

Definition at line 39 of file Event/ers/include/ers/Issue.h.

Referenced by IssueFactory.

◆ Stream

Stream
friend

Definition at line 38 of file Event/ers/include/ers/Issue.h.

Referenced by qualifiers(), and Stream.

Member Data Documentation

◆ CAUSE_PSEUDO_KEY

const char *const ers::Issue::CAUSE_PSEUDO_KEY = "CAUSE"
static

key used when serializing the cause issue, this key is not used in the value table

Definition at line 72 of file Event/ers/include/ers/Issue.h.

◆ CAUSE_TEXT_KEY

const char *const ers::Issue::CAUSE_TEXT_KEY = "CAUSE_TEXT"
static

key used to store the cause issue's message

Definition at line 75 of file Event/ers/include/ers/Issue.h.

Referenced by cause().

◆ CLASS_KEY

const char *const ers::Issue::CLASS_KEY = "ISSUE_CLASS"
static

key for class information

Definition at line 42 of file Event/ers/include/ers/Issue.h.

Referenced by finish_setup().

◆ COMPILATION_DEBUG_LVL_KEY

const char *const ers::Issue::COMPILATION_DEBUG_LVL_KEY = "COMPILATION_DEBUG_LVL"
static

Definition at line 46 of file Event/ers/include/ers/Issue.h.

Referenced by insert().

◆ COMPILATION_TARGET_KEY

const char *const ers::Issue::COMPILATION_TARGET_KEY = "COMPILATION_TARGET"
static

key for compilation target

Definition at line 44 of file Event/ers/include/ers/Issue.h.

Referenced by insert().

◆ COMPILATION_TIME_KEY

const char *const ers::Issue::COMPILATION_TIME_KEY = "COMPILATION_TIME"
static

key for compilation time

Definition at line 43 of file Event/ers/include/ers/Issue.h.

Referenced by insert().

◆ COMPILER_KEY

const char *const ers::Issue::COMPILER_KEY = "COMPILER"
static

key for compilator type

Definition at line 45 of file Event/ers/include/ers/Issue.h.

Referenced by insert().

◆ CPP_CLASS_KEY

const char *const ers::Issue::CPP_CLASS_KEY = "ISSUE_CPP_CLASS"
static

key for c++ class (might be mangled)

Definition at line 47 of file Event/ers/include/ers/Issue.h.

◆ ERS_VERSION_KEY

const char *const ers::Issue::ERS_VERSION_KEY = "ERS_VERSION"
static

key for ERS version

Definition at line 48 of file Event/ers/include/ers/Issue.h.

◆ EXIT_VALUE_KEY

const char *const ers::Issue::EXIT_VALUE_KEY = "EXIT_VALUE"
static

key used to store the exit value

Definition at line 79 of file Event/ers/include/ers/Issue.h.

Referenced by exit_value(), and ers::Assertion::setup().

◆ HOST_IP_ADDR_KEY

const char *const ers::Issue::HOST_IP_ADDR_KEY = "HOST_IP"
static

key for host ip address

Definition at line 52 of file Event/ers/include/ers/Issue.h.

◆ HOST_NAME_KEY

const char *const ers::Issue::HOST_NAME_KEY = "HOST_NAME"
static

key for hostname

Definition at line 49 of file Event/ers/include/ers/Issue.h.

◆ HOST_TYPE_KEY

const char *const ers::Issue::HOST_TYPE_KEY = "HOST_TYPE"
static

key for host type (architecture / os)

Definition at line 50 of file Event/ers/include/ers/Issue.h.

◆ ISSUE_CLASS_NAME

const char *const ers::Issue::ISSUE_CLASS_NAME = "ers::issue"
static

name of the class, used for serialisation

Definition at line 80 of file Event/ers/include/ers/Issue.h.

◆ m_cause

Issue * ers::Issue::m_cause
protected

Issue that caused the current issue.

Definition at line 84 of file Event/ers/include/ers/Issue.h.

Referenced by cause(), cause(), Issue(), Issue(), operator==(), and ~Issue().

◆ m_class_name

std::string ers::Issue::m_class_name
mutableprotected

◆ m_human_description

std::string ers::Issue::m_human_description
mutableprotected

Human readable description (cache).

Definition at line 86 of file Event/ers/include/ers/Issue.h.

Referenced by human_description(), Issue(), Issue(), and Issue().

◆ m_value_table

◆ MESSAGE_KEY

const char *const ers::Issue::MESSAGE_KEY = "MESSAGE"
static

key for human readable

Definition at line 53 of file Event/ers/include/ers/Issue.h.

Referenced by finish_setup(), message(), ers::DefaultStream::send(), and ers::HumanStream::send().

◆ PROCESS_ID_KEY

const char *const ers::Issue::PROCESS_ID_KEY = "PROCESS_ID"
static

key for the process id (number)

Definition at line 54 of file Event/ers/include/ers/Issue.h.

◆ PROCESS_PWD_KEY

const char *const ers::Issue::PROCESS_PWD_KEY = "PROCESS_PWD"
static

key for the process working directory

Definition at line 55 of file Event/ers/include/ers/Issue.h.

◆ PROGRAM_NAME_KEY

const char *const ers::Issue::PROGRAM_NAME_KEY = "PROGRAM_NAME"
static

key for the name of the program

Definition at line 57 of file Event/ers/include/ers/Issue.h.

◆ QUALIFIER_LIST_KEY

const char *const ers::Issue::QUALIFIER_LIST_KEY = "QUALIFIERS"
static

key used to store the qualifier list

Ê

Definition at line 77 of file Event/ers/include/ers/Issue.h.

Referenced by add_qualifier(), ers::FilterStream::is_accept(), and qualifiers().

◆ RESPONSIBILITY_KEY

const char *const ers::Issue::RESPONSIBILITY_KEY = "RESPONSIBILITY"
static

key for the responsibility of the issue (text)

Definition at line 58 of file Event/ers/include/ers/Issue.h.

Referenced by responsibility(), and responsibility().

◆ SEVERITY_KEY

const char *const ers::Issue::SEVERITY_KEY = "SEVERITY"
static

◆ SOURCE_PACKAGE_KEY

const char *const ers::Issue::SOURCE_PACKAGE_KEY = "SOURCE_PACKAGE"
static

package name associated with source code

Definition at line 63 of file Event/ers/include/ers/Issue.h.

Referenced by insert().

◆ SOURCE_POSITION_KEY

const char *const ers::Issue::SOURCE_POSITION_KEY = "SOURCE_POSITION"
static

key for position in the source code

 

Definition at line 61 of file Event/ers/include/ers/Issue.h.

Referenced by insert(), and ers::DefaultStream::send().

◆ TIME_KEY

const char *const ers::Issue::TIME_KEY = "TIME"
static

key for the time of the issue (text)

Definition at line 65 of file Event/ers/include/ers/Issue.h.

Referenced by insert_time(), and ers::DefaultStream::send().

◆ TRANSIENCE_KEY

const char *const ers::Issue::TRANSIENCE_KEY = "TRANSIENCE"
static

key for the transience of the issue (text)

Definition at line 66 of file Event/ers/include/ers/Issue.h.

Referenced by transience(), and transience().

◆ USER_ID_KEY

const char *const ers::Issue::USER_ID_KEY = "USER_ID"
static

key for the user-id of the owner of the process

Definition at line 68 of file Event/ers/include/ers/Issue.h.

◆ USER_NAME_KEY

const char *const ers::Issue::USER_NAME_KEY = "USER_NAME"
static

key for the user-name of the owner of the process

Definition at line 70 of file Event/ers/include/ers/Issue.h.


The documentation for this class was generated from the following files: