#include <TooBigCountIssue.h>
Inheritance diagram for eformat::TooBigCountIssue:
Public Member Functions | |
TooBigCountIssue (const ers::Context &context, ers::severity_t severity, size_t count, size_t maxcount) | |
virtual | ~TooBigCountIssue () throw () |
size_t | count () const |
size_t | max_count () const |
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. | |
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. | |
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. |
Definition at line 26 of file TooBigCountIssue.h.
eformat::TooBigCountIssue::TooBigCountIssue | ( | const ers::Context & | context, | |
ers::severity_t | severity, | |||
size_t | count, | |||
size_t | maxcount | |||
) |
Builds a new size-check exception
context | The Error Reporting System context to be used to identify the spot where this issue was created | |
severity | The severity of this issue | |
count | The number of blocks I was asked to deal with | |
maxcount | The maximum number of blocks I can deal with |
Definition at line 21 of file TooBigCountIssue.cxx.
References CURRENT_COUNT_KEY, ers::Issue::finish_setup(), MAX_COUNT_KEY, and ers::Issue::set_value().
00024 : eformat::Issue(context,severity) 00025 { 00026 set_value(CURRENT_COUNT_KEY, count); 00027 set_value(MAX_COUNT_KEY, maxcount); 00028 finish_setup("Overloaded paged-memory container"); 00029 }
virtual eformat::TooBigCountIssue::~TooBigCountIssue | ( | ) | throw () [inline, virtual] |
void Issue::add_qualifier | ( | const std::string & | qualif | ) | [inherited] |
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 ers::Issue::get_value(), RealDBUtil::npos, boss::pos, ers::Issue::QUALIFIER_LIST_KEY, ers::Issue::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 |
) | [inherited] |
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 ers::Issue::CAUSE_TEXT_KEY, genRecEmupikp::i, ers::Issue::m_cause, and ers::Issue::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 () [inherited] |
return the cause Issue of this Issue
Definition at line 240 of file Issue.cxx.
References ers::Issue::m_cause.
Referenced by ers::Issue::Issue().
00240 { 00241 return m_cause ; 00242 } // cause
Issue * Issue::clone | ( | ) | const [inherited] |
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 ers::Issue::Issue(), and ers::FIFOStream::send().
00160 { 00161 return IssueFactory::instance()->build(this) ; 00162 } // clone
size_t eformat::TooBigCountIssue::count | ( | ) | const |
The number of blocks I have to deal with
Definition at line 31 of file TooBigCountIssue.cxx.
References CURRENT_COUNT_KEY, and ers::Issue::get_int_value().
00032 { 00033 return get_int_value(CURRENT_COUNT_KEY); 00034 }
int Issue::exit_value | ( | ) | const throw () [virtual, inherited] |
value to pass to exit
Definition at line 693 of file Issue.cxx.
References ers::Issue::EXIT_VALUE_KEY, ers::Issue::get_int_value(), ers::Issue::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, inherited] |
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(), ers::Issue::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(), 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, inherited] |
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 ers::Issue::ISSUE_CLASS_NAME, ers::Issue::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 () [inherited] |
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 ers::Issue::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 () [inherited] |
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(), count(), eformat::WrongMarkerIssue::current(), eformat::BadVersionIssue::current(), ers::Issue::exit_value(), eformat::WrongMarkerIssue::expected(), eformat::SizeCheckIssue::informed(), 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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 ers::Issue::add_qualifier(), eformat::NotAlignedIssue::base(), ers::Issue::get_double_value(), ers::FilterStream::is_accept(), ers::Issue::message(), eformat::UnboundSourceIdentifierIssue::my_context(), ers::Issue::qualifiers(), ers::Issue::responsibility(), ers::HumanStream::send(), ers::DefaultStream::send(), ers::Issue::severity(), ers::Issue::severity_message(), and ers::Issue::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 [inherited] |
extract value table
Returns a read-only pointer to the value table
Definition at line 274 of file Issue.cxx.
References ers::Issue::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 () [inherited] |
Human description message.
Definition at line 672 of file Issue.cxx.
References ers::Issue::m_human_description, and ers::HumanStream::to_string().
Referenced by ers::Issue::operator std::string(), and ers::Issue::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, inherited] |
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, inherited] |
Inserts current time.
Inserts the current time into the issue
Definition at line 509 of file Issue.cxx.
References BUFFER_SIZE, ers::Issue::set_value(), and ers::Issue::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 | ( | ) | [inherited] |
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 ers::Issue::severity().
Referenced by ers::StreamFactory::dispatch().
00619 { 00620 severity_t s = severity(); 00621 return (s==ers::error || s== ers::fatal) ; 00622 } // is_error
size_t eformat::TooBigCountIssue::max_count | ( | ) | const |
The maximum number of blocks I can deal with
Definition at line 36 of file TooBigCountIssue.cxx.
References ers::Issue::get_int_value(), and MAX_COUNT_KEY.
00037 { 00038 return get_int_value(MAX_COUNT_KEY); 00039 }
const std::string & Issue::message | ( | ) | const throw () [inherited] |
Message.
Definition at line 689 of file Issue.cxx.
References ers::Issue::get_value(), and ers::Issue::MESSAGE_KEY.
Referenced by ers::InvalidReferenceIssue::check_reference().
00689 { 00690 return get_value(MESSAGE_KEY) ; 00691 } // message
Issue::operator std::string | ( | ) | const [inherited] |
Converts the issue into a string.
Definition at line 165 of file Issue.cxx.
References ers::Issue::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 () [inherited] |
std::vector< std::string > Issue::qualifiers | ( | ) | const [inherited] |
return array of qualifiers
Gets the list of qualifiers
Definition at line 715 of file Issue.cxx.
References ers::Issue::get_value(), ers::Issue::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 () [inherited] |
get the responsability level of the issue
Gets the responsibility type of the Issue
Definition at line 637 of file Issue.cxx.
References ers::Issue::get_value(), ers::Core::parse_responsibility(), ers::Issue::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 | ) | [inherited] |
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 ers::Issue::RESPONSIBILITY_KEY, ers::Issue::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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 () [inherited] |
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 ers::Issue::add_qualifier(), eformat::BadVersionIssue::BadVersionIssue(), ers::Issue::cause(), ers::EntityNotFoundIssue::EntityNotFoundIssue(), ExampleIssue::ExampleIssue(), ers::Issue::insert_time(), eformat::NoSuchChildIssue::NoSuchChildIssue(), eformat::NotAlignedIssue::NotAlignedIssue(), ers::ParseIssue::offending_line_number(), eformat::OutOfBoundsIssue::OutOfBoundsIssue(), ers::InvalidReferenceIssue::pointer(), ers::RangeIssue::RangeIssue(), ers::Issue::responsibility(), ers::RangeIssue::set_range(), ers::Assertion::setup(), ers::Issue::severity(), eformat::SizeCheckIssue::SizeCheckIssue(), TooBigCountIssue(), ers::Issue::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, inherited] |
sets the value table
Sets the value table
values | the value table to load |
Definition at line 362 of file Issue.cxx.
Referenced by ers::Issue::Issue().
00362 { 00363 m_value_table = values ; 00364 } // load_values
void Issue::setup_common | ( | const Context * | context | ) | throw () [protected, inherited] |
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 ers::Issue::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 | ) | [inherited] |
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 ers::Issue::set_value(), ers::Issue::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 () [inherited] |
severity_t of the issue
Gets the severity_t of the Issue
Definition at line 602 of file Issue.cxx.
References ers::Issue::get_value(), ers::Core::parse_severity(), ers::Issue::SEVERITY_KEY, and deljobs::string.
Referenced by ers::StreamFactory::debug(), ers::StreamFactory::dispatch(), ers::StreamFactory::error(), ers::StreamFactory::fatal(), ers::InvalidReferenceIssue::InvalidReferenceIssue(), ers::Issue::is_error(), ers::Issue::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 [inherited] |
message associated with the severity_t of the issue
Definition at line 628 of file Issue.cxx.
References ers::Issue::get_value(), and ers::Issue::SEVERITY_KEY.
00628 { 00629 return get_value(SEVERITY_KEY); 00630 } // severity_message
int Issue::transience | ( | ) | const throw () [inherited] |
is the issue transient
Definition at line 662 of file Issue.cxx.
References ers::Issue::get_value(), ers::Core::parse_boolean(), deljobs::string, and ers::Issue::TRANSIENCE_KEY.
Referenced by ers::Issue::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 | ) | [inherited] |
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 ers::Issue::set_value(), ers::Core::to_string(), and ers::Issue::TRANSIENCE_KEY.
00655 { 00656 set_value(TRANSIENCE_KEY,ers::Core::to_string(tr)) ; 00657 } // transience
int Issue::values_number | ( | ) | const [inherited] |
How many key / values.
Definition at line 469 of file Issue.cxx.
References ers::Issue::m_value_table.
00469 { 00470 return m_value_table.size(); 00471 } // values_number
const char * Issue::what | ( | ) | const throw () [inherited] |
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 ers::Issue::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();
const char *const Issue::CAUSE_PSEUDO_KEY = "CAUSE" [static, inherited] |
const char *const Issue::CAUSE_TEXT_KEY = "CAUSE_TEXT" [static, inherited] |
key used to store the cause issue's message
Definition at line 67 of file Issue.h.
Referenced by ers::Issue::cause().
const char *const Issue::CLASS_KEY = "ISSUE_CLASS" [static, inherited] |
const char *const Issue::COMPILATION_DEBUG_LVL_KEY = "COMPILATION_DEBUG_LVL" [static, inherited] |
const char *const Issue::COMPILATION_TARGET_KEY = "COMPILATION_TARGET" [static, inherited] |
const char *const Issue::COMPILATION_TIME_KEY = "COMPILATION_TIME" [static, inherited] |
const char *const Issue::COMPILER_KEY = "COMPILER" [static, inherited] |
const char *const Issue::CPP_CLASS_KEY = "ISSUE_CPP_CLASS" [static, inherited] |
const char *const Issue::ERS_VERSION_KEY = "ERS_VERSION" [static, inherited] |
const char *const Issue::EXIT_VALUE_KEY = "EXIT_VALUE" [static, inherited] |
key used to store the exit value
Definition at line 69 of file Issue.h.
Referenced by ers::Issue::exit_value(), and ers::Assertion::setup().
const char *const Issue::HOST_IP_ADDR_KEY = "HOST_IP" [static, inherited] |
const char *const Issue::HOST_NAME_KEY = "HOST_NAME" [static, inherited] |
const char *const Issue::HOST_TYPE_KEY = "HOST_TYPE" [static, inherited] |
const char *const Issue::ISSUE_CLASS_NAME = "ers::issue" [static, inherited] |
name of the class, used for serialisation
Definition at line 70 of file Issue.h.
Referenced by ers::Issue::get_class_name().
Issue* ers::Issue::m_cause [protected, inherited] |
Issue that caused the current issue.
Definition at line 73 of file Issue.h.
Referenced by ers::Issue::cause(), ers::Issue::Issue(), and ers::Issue::~Issue().
std::string ers::Issue::m_class_name [mutable, protected, inherited] |
class name
Definition at line 74 of file Issue.h.
Referenced by ers::DefaultIssue::DefaultIssue(), ers::DefaultIssue::get_class_name(), and ers::Issue::get_class_name().
std::string ers::Issue::m_human_description [mutable, protected, inherited] |
Human readable description (cache).
Definition at line 75 of file Issue.h.
Referenced by ers::Issue::human_description(), and ers::Issue::Issue().
string_map_type ers::Issue::m_value_table [protected, inherited] |
Optional properties.
Definition at line 76 of file Issue.h.
Referenced by ers::ParseIssue::file_name(), ers::Issue::get_value_table(), ers::Issue::Issue(), ers::ParseIssue::offending_line(), ers::Assertion::setup(), and ers::Issue::values_number().
const char *const Issue::MESSAGE_KEY = "MESSAGE" [static, inherited] |
key for human readable
Definition at line 54 of file Issue.h.
Referenced by ers::Issue::message(), ers::HumanStream::send(), and ers::DefaultStream::send().
const char *const Issue::PROCESS_ID_KEY = "PROCESS_ID" [static, inherited] |
const char *const Issue::PROCESS_PWD_KEY = "PROCESS_PWD" [static, inherited] |
const char *const Issue::PROGRAM_NAME_KEY = "PROGRAM_NAME" [static, inherited] |
const char *const Issue::QUALIFIER_LIST_KEY = "QUALIFIERS" [static, inherited] |
key used to store the qualifier list
Ê
Definition at line 68 of file Issue.h.
Referenced by ers::Issue::add_qualifier(), ers::FilterStream::is_accept(), and ers::Issue::qualifiers().
const char *const Issue::RESPONSIBILITY_KEY = "RESPONSIBILITY" [static, inherited] |
key for the responsibility of the issue (text)
Definition at line 58 of file Issue.h.
Referenced by ers::Issue::responsibility().
const char *const Issue::SEVERITY_KEY = "SEVERITY" [static, inherited] |
key for the severity_t of the issue
Definition at line 59 of file Issue.h.
Referenced by ers::HumanStream::send(), ers::DefaultStream::send(), ers::Issue::severity(), and ers::Issue::severity_message().
const char *const Issue::SOURCE_PACKAGE_KEY = "SOURCE_PACKAGE" [static, inherited] |
const char *const Issue::SOURCE_POSITION_KEY = "SOURCE_POSITION" [static, inherited] |
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, inherited] |
key for the time of the issue (text)
Definition at line 62 of file Issue.h.
Referenced by ers::Issue::insert_time(), and ers::DefaultStream::send().
const char *const Issue::TRANSIENCE_KEY = "TRANSIENCE" [static, inherited] |
key for the transience of the issue (text)
Definition at line 63 of file Issue.h.
Referenced by ers::Issue::transience().
const char *const Issue::USER_ID_KEY = "USER_ID" [static, inherited] |
const char *const Issue::USER_NAME_KEY = "USER_NAME" [static, inherited] |