#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 () |
Issue * | clone () const |
const Issue * | cause () 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_type * | get_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 | |
Protected Attributes | |
Issue * | m_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 |
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.
Definition at line 40 of file Issue.h.
Issue::Issue | ( | const Context & | context, | |
severity_t | s | |||
) | [protected] |
Constructor for subclasses.
Reimplemented in eformat::Issue.
Definition at line 121 of file Issue.cxx.
References cause(), setup_common(), and severity().
00121 { 00122 cause(); 00123 setup_common(&context); 00124 severity(s); 00125 } // Issue
Issue::Issue | ( | ) |
Empty constructor, should only be used when deserialising issues
Definition at line 74 of file Issue.cxx.
References m_cause, and m_human_description.
00074 { 00075 m_human_description.clear() ; 00076 m_cause = 0 ; 00077 } // Issue
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.
issue | original for copy |
Definition at line 85 of file Issue.cxx.
References clone(), m_cause, m_human_description, and m_value_table.
00085 : std::exception() { 00086 m_value_table = issue.m_value_table ; 00087 m_human_description = issue.m_human_description ; 00088 if (issue.m_cause) { 00089 this->m_cause = issue.m_cause->clone(); 00090 } else { 00091 this->m_cause = 0 ; 00092 } 00093 } // Issue
Issue::Issue | ( | const string_map_type & | values | ) |
Builds an Issue out of a value table
values | table of values for the issue |
Definition at line 99 of file Issue.cxx.
References cause(), m_human_description, and set_values().
00099 { 00100 cause(); 00101 set_values(values); 00102 m_human_description.clear(); 00103 } // Issue
Issue::Issue | ( | const Context & | context, | |
severity_t | s, | |||
const std::string & | m | |||
) |
Constructor
context | the context of the Issue, e.g where in the code did the issue appear | |
s | severity_t of the Issue | |
m | message of the Issue |
Definition at line 112 of file Issue.cxx.
References cause(), finish_setup(), setup_common(), and severity().
00112 { 00113 cause(); 00114 setup_common(&context); 00115 severity(s); 00116 finish_setup(m); 00117 } // Issue
Issue::Issue | ( | const Context & | context, | |
severity_t | s, | |||
const std::exception * | cause_exception | |||
) |
Constructor - takes another exceptions as the cause for the current exception.
context | the context of the Issue, e.g where in the code did the issue appear | |
s | the severity_t of the exception | |
cause_exception | the exception that caused the current Issue |
Definition at line 133 of file Issue.cxx.
References cause(), ERS_PRE_CHECK_PTR, finish_setup(), setup_common(), and severity().
00133 { 00134 ERS_PRE_CHECK_PTR(cause_exception); 00135 cause(cause_exception); 00136 setup_common(&context); 00137 severity(s); 00138 finish_setup(cause_exception->what()); 00139 } // Issue
Issue::~Issue | ( | ) | throw () [virtual] |
void Issue::add_qualifier | ( | const std::string & | qualif | ) |
adds a qualifier to the issue
Add a qualifier to the qualifier list
qualif | the qualifier to add |
Definition at line 703 of file Issue.cxx.
References get_value(), RealDBUtil::npos, boss::pos, QUALIFIER_LIST_KEY, set_value(), and deljobs::string.
00703 { 00704 const std::string &qualif_s = get_value(QUALIFIER_LIST_KEY) ; 00705 std::string::size_type pos = qualif_s.find(qualif); 00706 if (pos!=std::string::npos) return ; // already present 00707 std::string n_qualif = qualif_s+qualif + " " ; 00708 set_value(QUALIFIER_LIST_KEY,n_qualif); 00709 } // add_qualifier
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.
c | pointer to the cause exception |
Definition at line 252 of file Issue.cxx.
References CAUSE_TEXT_KEY, genRecEmupikp::i, m_cause, and set_value().
00252 { 00253 if (c==0) { 00254 m_cause = 0 ; 00255 return ; 00256 } // No cause easy. 00257 const Issue *i = dynamic_cast<const Issue *>(c) ; 00258 if (i) { 00259 m_cause = i->clone(); 00260 } else { 00261 m_cause = 0 ; 00262 } // if 00263 set_value(CAUSE_TEXT_KEY,c->what()); 00264 } // cause
const Issue * Issue::cause | ( | ) | const throw () |
Issue * Issue::clone | ( | ) | const |
Builds a clone of the object. The object is allocated on the stack, and should be deleted by the caller
Definition at line 160 of file Issue.cxx.
References ers::IssueFactory::build(), and ers::IssueFactory::instance().
Referenced by Issue(), and ers::FIFOStream::send().
00160 { 00161 return IssueFactory::instance()->build(this) ; 00162 } // clone
int Issue::exit_value | ( | ) | const throw () [virtual] |
value to pass to exit
Definition at line 693 of file Issue.cxx.
References EXIT_VALUE_KEY, get_int_value(), transience(), and v.
00693 { 00694 int v = 1 ; 00695 if (transience()==1) v = EX_TEMPFAIL ; 00696 return get_int_value(EXIT_VALUE_KEY,v); 00697 } // exit_value
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.
message | human readable message |
Definition at line 568 of file Issue.cxx.
Referenced by eformat::BadVersionIssue::BadVersionIssue(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ExampleIssue::ExampleIssue(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), Issue(), eformat::Issue::Issue(), ers::IssueFactoryIssue::IssueFactoryIssue(), ers::LogIssue::LogIssue(), eformat::NoSuchChildIssue::NoSuchChildIssue(), eformat::NotAlignedIssue::NotAlignedIssue(), eformat::OutOfBoundsIssue::OutOfBoundsIssue(), 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().
00568 { 00569 // set_value(CPP_CLASS_KEY,class_name); 00570 set_value(CLASS_KEY, get_class_name()) ; 00571 set_value(MESSAGE_KEY,msg); 00572 } // finish_setup
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::DefaultIssue, ers::EntityNotFoundIssue, ers::InvalidReferenceIssue, ers::IssueFactoryIssue, ers::LogIssue, ers::NotImplemented, ers::ParseIssue, ers::Precondition, ers::RangeIssue, and ExampleIssue.
Definition at line 587 of file Issue.cxx.
References ISSUE_CLASS_NAME, m_class_name, and ers::Core::umangle_gcc_class_name().
Referenced by ers::IssueFactory::build().
00587 { 00588 if (m_class_name.empty()) { 00589 const Issue *p = this ; 00590 m_class_name = ers::Core::umangle_gcc_class_name((typeid(*p)).name()).c_str(); 00591 if (m_class_name.empty()) { 00592 m_class_name=ISSUE_CLASS_NAME ; 00593 } // fall back 00594 } 00595 return m_class_name.c_str() ; 00596 } // get_class_name
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
key | the key to search for | |
def | the value to return if key is not found - the default value for this parameter is NaN. |
def
Definition at line 344 of file Issue.cxx.
References get_value(), deljobs::string, and v.
00344 { 00345 std::string v = get_value(key) ; 00346 if (! v.empty()) { // not empty 00347 std::istringstream in(v) ; 00348 double n ; 00349 in >> n ; 00350 return n ; 00351 // return atoi(v.c_str()); 00352 } else { // empty 00353 return def ; 00354 } // empty 00355 } // get_double_value
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
key | the key to search for | |
def | the value to return if key is not found |
def
Definition at line 305 of file Issue.cxx.
References key, deljobs::string, and v.
Referenced by eformat::SizeCheckIssue::actual(), eformat::TooBigCountIssue::count(), eformat::WrongMarkerIssue::current(), eformat::BadVersionIssue::current(), exit_value(), eformat::WrongMarkerIssue::expected(), eformat::SizeCheckIssue::informed(), eformat::TooBigCountIssue::max_count(), eformat::OutOfBoundsIssue::pos(), ExampleIssue::procrastination_level(), eformat::NoSuchChildIssue::requested(), eformat::WrongSizeIssue::size(), eformat::OutOfBoundsIssue::size(), eformat::NotAlignedIssue::size(), eformat::UnboundSourceIdentifierIssue::source_id(), eformat::BadVersionIssue::supported(), and eformat::NoSuchChildIssue::total().
00305 { 00306 std::string v = get_value(key) ; 00307 if (! v.empty()) { // not empty 00308 std::istringstream in(v) ; 00309 int n ; 00310 in >> n ; 00311 return n ; 00312 // return atoi(v.c_str()); 00313 } else { // empty 00314 return def ; 00315 } // empty 00316 } // get_int_value
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
key | the key to search for | |
def | the value to return if key is not found |
def
Definition at line 325 of file Issue.cxx.
References key, deljobs::string, and v.
00325 { 00326 std::string v = get_value(key) ; 00327 if (! v.empty()) { // not empty 00328 std::istringstream in(v) ; 00329 long n ; 00330 in >> n ; 00331 return n ; 00332 // return atoi(v.c_str()); 00333 } else { // empty 00334 return def ; 00335 } // empty 00336 } // get_long_value
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 294 of file Issue.cxx.
References ers::Core::empty_string, and key.
00294 { 00295 return get_value(key,Core::empty_string) ; 00296 } // get_value
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
key | the key to lookup |
Definition at line 283 of file Issue.cxx.
References key, and boss::pos.
Referenced by add_qualifier(), eformat::NotAlignedIssue::base(), get_double_value(), ers::FilterStream::is_accept(), message(), eformat::UnboundSourceIdentifierIssue::my_context(), qualifiers(), responsibility(), ers::HumanStream::send(), ers::DefaultStream::send(), severity(), severity_message(), and transience().
00283 { 00284 string_map_type::const_iterator pos = m_value_table.find(key); 00285 if (pos!=m_value_table.end()) { 00286 return pos->second ; 00287 } // if 00288 return def ; 00289 } // get_value
const string_map_type * Issue::get_value_table | ( | ) | const |
extract value table
Returns a read-only pointer to the value table
Definition at line 274 of file Issue.cxx.
References m_value_table.
Referenced by ers::IssueFactory::build(), ers::HumanStream::send(), and ers::DefaultStream::send().
00274 { 00275 return &m_value_table ; 00276 } // get_value_table
const std::string & Issue::human_description | ( | ) | const throw () |
Human description message.
Definition at line 672 of file Issue.cxx.
References m_human_description, and ers::HumanStream::to_string().
Referenced by operator std::string(), and what().
00672 { 00673 if (m_human_description.empty()) { 00674 m_human_description = HumanStream::to_string(this) ; 00675 } 00676 return m_human_description ; 00677 } // human_description
void Issue::insert | ( | const Context * | context | ) | throw () [protected] |
Inserts the context.
Inserts the context of the issue into the issue
context | pointer to context object |
Definition at line 481 of file Issue.cxx.
References ers::Context::debug_level(), genRecEmupikp::i, and boss::pos.
00481 { 00482 if (context) { 00483 set_value(SOURCE_POSITION_KEY,context->position()) ; 00484 set_value(SOURCE_PACKAGE_KEY,context->package_name()); 00485 set_value(COMPILER_KEY,context->compiler()) ; 00486 set_value(COMPILATION_TIME_KEY,context->compilation()) ; 00487 set_value(COMPILATION_TARGET_KEY,context->host_type()) ; 00488 int lvl = ers::Context::debug_level(); 00489 if (lvl>=0) { 00490 set_value(COMPILATION_DEBUG_LVL_KEY,lvl); 00491 } // if 00492 int frame_number = context->stack_frames(); 00493 for(int i=0;i<frame_number;i++) { 00494 char key_buffer[256] ; 00495 snprintf(key_buffer,sizeof(key_buffer),"SOURCE-STACK-%03x",i); 00496 set_value(key_buffer,context->stack_frame(i)); 00497 } // for 00498 std::vector<std::string> qualifs = context->qualifiers() ; 00499 std::vector<std::string>::const_iterator pos ; 00500 for(pos=qualifs.begin();pos!=qualifs.end();pos++) { 00501 add_qualifier(*pos) ; 00502 } // for 00503 } // if context 00504 } // insert
void Issue::insert_time | ( | ) | throw () [protected] |
Inserts current time.
Inserts the current time into the issue
Definition at line 509 of file Issue.cxx.
References BUFFER_SIZE, set_value(), and TIME_KEY.
00509 { 00510 time_t now ; 00511 time(&now); 00512 char time_buffer[BUFFER_SIZE] ; 00513 ctime_r(&now,time_buffer) ; 00514 char *cr = strchr(time_buffer,'\n'); 00515 if (cr) { 00516 *cr = '\0' ; 00517 } // carriage return 00518 set_value(TIME_KEY,time_buffer); 00519 } // insert_time
bool Issue::is_error | ( | ) |
is the issue an error (or fatal).
Is the issue either an error or a fatal error
true
if the issue is either an error or a fatal Definition at line 619 of file Issue.cxx.
References ers::error, ers::fatal, s, and severity().
Referenced by ers::StreamFactory::dispatch().
00619 { 00620 severity_t s = severity(); 00621 return (s==ers::error || s== ers::fatal) ; 00622 } // is_error
const std::string & Issue::message | ( | ) | const throw () |
Message.
Definition at line 689 of file Issue.cxx.
References get_value(), and MESSAGE_KEY.
Referenced by ers::InvalidReferenceIssue::check_reference().
00689 { 00690 return get_value(MESSAGE_KEY) ; 00691 } // message
Issue::operator std::string | ( | ) | const |
Converts the issue into a string.
Definition at line 165 of file Issue.cxx.
References human_description(), s, and deljobs::string.
00165 { 00166 std::string s = human_description(); 00167 return s ; 00168 } // std::string()
Equality operator.
Comparison operator
other | issue to compare to |
true
if this
and other
are equal Definition at line 186 of file Issue.cxx.
References false, EvtCyclic3::other(), and true.
00186 { 00187 if (m_value_table != other.m_value_table) return false ; 00188 if (m_cause == other.m_cause) return true ; 00189 return (*m_cause) == *(other.m_cause) ; 00190 } // operator==
const std::string & Issue::operator[] | ( | const std::string & | key | ) | const throw () |
std::vector< std::string > Issue::qualifiers | ( | ) | const |
return array of qualifiers
Gets the list of qualifiers
Definition at line 715 of file Issue.cxx.
References get_value(), QUALIFIER_LIST_KEY, deljobs::string, and ers::Core::tokenize().
00715 { 00716 const std::string &qualif_s = get_value(QUALIFIER_LIST_KEY) ; 00717 return ers::Core::tokenize(qualif_s,", \t"); 00718 } // qualifiers
responsibility_t Issue::responsibility | ( | ) | const throw () |
get the responsability level of the issue
Gets the responsibility type of the Issue
Definition at line 637 of file Issue.cxx.
References get_value(), ers::Core::parse_responsibility(), RESPONSIBILITY_KEY, and deljobs::string.
Referenced by ers::InvalidReferenceIssue::InvalidReferenceIssue(), and ers::Assertion::setup().
00637 { 00638 std::string value = this->get_value(RESPONSIBILITY_KEY); 00639 return ers::Core::parse_responsibility(value); 00640 } // responsability
void Issue::responsibility | ( | responsibility_t | r | ) |
set the responsability of the issue
Sets the responsbility of the Issue
r | the responsibility type |
Definition at line 646 of file Issue.cxx.
References RESPONSIBILITY_KEY, set_value(), and ers::Core::to_string().
00646 { 00647 set_value(RESPONSIBILITY_KEY,ers::Core::to_string(r)) ; 00648 } // responsability
void Issue::set_value | ( | const std::string & | key, | |
const void * | ptr | |||
) | throw () |
Sets a pointer in the value table
key | the key to use for insertion | |
ptr | a pointer |
Definition at line 457 of file Issue.cxx.
00457 { 00458 std::ostringstream stream ; 00459 stream.setf(std::ios::hex,std::ios::basefield); 00460 stream << (unsigned long) ptr ; 00461 m_value_table[key] = stream.str(); 00462 } // set_value
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
key | the key to use for insertion | |
value | c-string, null pointer is ignored. |
Definition at line 444 of file Issue.cxx.
References deljobs::string.
00444 { 00445 if (value) { 00446 std::string value_str = std::string(value) ; 00447 set_value(key,value_str); 00448 } // if 00449 } // set_value
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
key | the key to use for insertion | |
value | the value to insert |
Definition at line 433 of file Issue.cxx.
00433 { 00434 if (! value.empty()) { 00435 m_value_table[key] = value ; 00436 } 00437 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
double | value | |||
) | throw () |
Sets a value (double float).
Set a numerical value in the value table
key | the key to use for insertion | |
value | the value to insert |
Definition at line 422 of file Issue.cxx.
00422 { 00423 std::ostringstream stream ; 00424 stream << value ; 00425 m_value_table[key] = stream.str(); 00426 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
int64_t | value | |||
) | throw () |
Definition at line 413 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00413 { 00414 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00415 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
int32_t | value | |||
) | throw () |
Definition at line 407 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00407 { 00408 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00409 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
int16_t | value | |||
) | throw () |
Definition at line 401 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00401 { 00402 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00403 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
int8_t | value | |||
) | throw () |
Definition at line 395 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00395 { 00396 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00397 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
uint64_t | value | |||
) | throw () |
Definition at line 389 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00389 { 00390 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00391 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
uint32_t | value | |||
) | throw () |
Definition at line 383 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00383 { 00384 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00385 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
uint16_t | value | |||
) | throw () |
Definition at line 377 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
00377 { 00378 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00379 } // set_value
void Issue::set_value | ( | const std::string & | key, | |
uint8_t | value | |||
) | throw () |
Sets a value 8 bit unsigned.
Set a numerical value in the value table
key | the key to use for insertion | |
value | the value to insert |
Definition at line 371 of file Issue.cxx.
References ISSUE_VALUE_SET_SCALAR.
Referenced by add_qualifier(), eformat::BadVersionIssue::BadVersionIssue(), cause(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ExampleIssue::ExampleIssue(), insert_time(), eformat::NoSuchChildIssue::NoSuchChildIssue(), eformat::NotAlignedIssue::NotAlignedIssue(), ers::ParseIssue::offending_line_number(), eformat::OutOfBoundsIssue::OutOfBoundsIssue(), ers::InvalidReferenceIssue::pointer(), ers::RangeIssue::RangeIssue(), responsibility(), ers::RangeIssue::set_range(), ers::Assertion::setup(), severity(), eformat::SizeCheckIssue::SizeCheckIssue(), eformat::TooBigCountIssue::TooBigCountIssue(), transience(), eformat::UnboundSourceIdentifierIssue::UnboundSourceIdentifierIssue(), eformat::WrongMarkerIssue::WrongMarkerIssue(), and eformat::WrongSizeIssue::WrongSizeIssue().
00371 { 00372 ISSUE_VALUE_SET_SCALAR(m_value_table,key,value); 00373 } // set_value
void Issue::set_values | ( | const string_map_type & | values | ) | throw () [protected] |
sets the value table
Sets the value table
values | the value table to load |
Definition at line 362 of file Issue.cxx.
Referenced by Issue().
00362 { 00363 m_value_table = values ; 00364 } // load_values
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
context | context where the exception occured, this should be the ERS_HERE macro. |
Definition at line 535 of file Issue.cxx.
Referenced by Issue().
00535 { 00536 const int errno_copy = errno ; // We need to save errno, because it might be changed 00537 insert(context); 00538 insert_time(); 00539 errno = errno_copy ; // we restaure errno 00540 } // setup_common
void Issue::severity | ( | severity_t | s | ) |
sets the severity_t of the issue
Set the severity_t of the Issue
s | the severity_t level |
Definition at line 611 of file Issue.cxx.
References set_value(), SEVERITY_KEY, and ers::Core::to_string().
00611 { 00612 set_value(SEVERITY_KEY,ers::Core::to_string(s)); 00613 } // severity
severity_t Issue::severity | ( | ) | const throw () |
severity_t of the issue
Gets the severity_t of the Issue
Definition at line 602 of file Issue.cxx.
References get_value(), ers::Core::parse_severity(), SEVERITY_KEY, and deljobs::string.
Referenced by ers::StreamFactory::debug(), ers::StreamFactory::dispatch(), ers::StreamFactory::error(), ers::StreamFactory::fatal(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), is_error(), Issue(), ers::DefaultStream::send(), and ers::StreamFactory::warning().
00602 { 00603 std::string value = get_value(SEVERITY_KEY); 00604 return ers::Core::parse_severity(value); 00605 } // severity
std::string Issue::severity_message | ( | ) | const |
message associated with the severity_t of the issue
Definition at line 628 of file Issue.cxx.
References get_value(), and SEVERITY_KEY.
00628 { 00629 return get_value(SEVERITY_KEY); 00630 } // severity_message
int Issue::transience | ( | ) | const throw () |
is the issue transient
Definition at line 662 of file Issue.cxx.
References get_value(), ers::Core::parse_boolean(), deljobs::string, and TRANSIENCE_KEY.
Referenced by exit_value(), and ers::Assertion::setup().
00662 { 00663 std::string value = this->get_value(TRANSIENCE_KEY); 00664 return ers::Core::parse_boolean(value.c_str()); 00665 } // transience
void Issue::transience | ( | bool | tr | ) |
sets if the issue is transient
Sets the transience of the issue
tr | true if the issue is transient, false if not |
Definition at line 655 of file Issue.cxx.
References set_value(), ers::Core::to_string(), and TRANSIENCE_KEY.
00655 { 00656 set_value(TRANSIENCE_KEY,ers::Core::to_string(tr)) ; 00657 } // transience
int Issue::values_number | ( | ) | const |
How many key / values.
Definition at line 469 of file Issue.cxx.
References m_value_table.
00469 { 00470 return m_value_table.size(); 00471 } // values_number
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
Definition at line 684 of file Issue.cxx.
References human_description(), and deljobs::string.
Referenced by EFEventLoopMgr::executeEvent(), main(), MixerAlg::nextEvent(), and RawDataInputSvc::nextEvent().
00684 { 00685 std::string desr = human_description() ; 00686 return desr.c_str(); 00687 } // what();
friend class IssueFactory [friend] |
const char *const Issue::CAUSE_PSEUDO_KEY = "CAUSE" [static] |
const char *const Issue::CAUSE_TEXT_KEY = "CAUSE_TEXT" [static] |
const char *const Issue::CLASS_KEY = "ISSUE_CLASS" [static] |
const char *const Issue::COMPILATION_DEBUG_LVL_KEY = "COMPILATION_DEBUG_LVL" [static] |
const char *const Issue::COMPILATION_TARGET_KEY = "COMPILATION_TARGET" [static] |
const char *const Issue::COMPILATION_TIME_KEY = "COMPILATION_TIME" [static] |
const char *const Issue::COMPILER_KEY = "COMPILER" [static] |
const char *const Issue::CPP_CLASS_KEY = "ISSUE_CPP_CLASS" [static] |
const char *const Issue::ERS_VERSION_KEY = "ERS_VERSION" [static] |
const char *const Issue::EXIT_VALUE_KEY = "EXIT_VALUE" [static] |
key used to store the exit value
Definition at line 69 of file Issue.h.
Referenced by exit_value(), and ers::Assertion::setup().
const char *const Issue::HOST_IP_ADDR_KEY = "HOST_IP" [static] |
const char *const Issue::HOST_NAME_KEY = "HOST_NAME" [static] |
const char *const Issue::HOST_TYPE_KEY = "HOST_TYPE" [static] |
const char *const Issue::ISSUE_CLASS_NAME = "ers::issue" [static] |
name of the class, used for serialisation
Definition at line 70 of file Issue.h.
Referenced by get_class_name().
Issue* ers::Issue::m_cause [protected] |
std::string ers::Issue::m_class_name [mutable, protected] |
class name
Definition at line 74 of file Issue.h.
Referenced by ers::DefaultIssue::DefaultIssue(), ers::DefaultIssue::get_class_name(), and get_class_name().
std::string ers::Issue::m_human_description [mutable, protected] |
Human readable description (cache).
Definition at line 75 of file Issue.h.
Referenced by human_description(), and Issue().
string_map_type ers::Issue::m_value_table [protected] |
Optional properties.
Definition at line 76 of file Issue.h.
Referenced by ers::ParseIssue::file_name(), get_value_table(), Issue(), ers::ParseIssue::offending_line(), ers::Assertion::setup(), and values_number().
const char *const Issue::MESSAGE_KEY = "MESSAGE" [static] |
key for human readable
Definition at line 54 of file Issue.h.
Referenced by message(), ers::HumanStream::send(), and ers::DefaultStream::send().
const char *const Issue::PROCESS_ID_KEY = "PROCESS_ID" [static] |
const char *const Issue::PROCESS_PWD_KEY = "PROCESS_PWD" [static] |
const char *const Issue::PROGRAM_NAME_KEY = "PROGRAM_NAME" [static] |
const char *const Issue::QUALIFIER_LIST_KEY = "QUALIFIERS" [static] |
key used to store the qualifier list
Ê
Definition at line 68 of file Issue.h.
Referenced by add_qualifier(), ers::FilterStream::is_accept(), and qualifiers().
const char *const Issue::RESPONSIBILITY_KEY = "RESPONSIBILITY" [static] |
key for the responsibility of the issue (text)
Definition at line 58 of file Issue.h.
Referenced by responsibility().
const char *const Issue::SEVERITY_KEY = "SEVERITY" [static] |
key for the severity_t of the issue
Definition at line 59 of file Issue.h.
Referenced by ers::HumanStream::send(), ers::DefaultStream::send(), severity(), and severity_message().
const char *const Issue::SOURCE_PACKAGE_KEY = "SOURCE_PACKAGE" [static] |
const char *const Issue::SOURCE_POSITION_KEY = "SOURCE_POSITION" [static] |
key for position in the source code
Definition at line 60 of file Issue.h.
Referenced by ers::DefaultStream::send().
const char *const Issue::TIME_KEY = "TIME" [static] |
key for the time of the issue (text)
Definition at line 62 of file Issue.h.
Referenced by insert_time(), and ers::DefaultStream::send().
const char *const Issue::TRANSIENCE_KEY = "TRANSIENCE" [static] |
key for the transience of the issue (text)
Definition at line 63 of file Issue.h.
Referenced by transience().
const char *const Issue::USER_ID_KEY = "USER_ID" [static] |
const char *const Issue::USER_NAME_KEY = "USER_NAME" [static] |