10#include "ers/RangeIssue.h"
25 int64_t
max,
const char* entity_name ) {
26 if ( ( value >
max ) || ( value <
min ) )
31 int64_t max_index,
const char* entity_name ) {
35 std::ostringstream reference_stream;
37 if ( entity_name ) { reference_stream <<
"(name=" << entity_name <<
')'; }
49 int64_t index, int64_t max_index,
const char* entity_name )
51 set_range( *
this, index, min_index, max_index, entity_name );
52 std::ostringstream message_stream;
53 message_stream <<
"invalid index: ";
54 if ( entity_name ) { message_stream << entity_name <<
'='; }
55 message_stream << index <<
" is not in range " << min_index <<
'-' << max_index;
Source context for Issue.
static const char *const REFERENCE_VALUE_KEY
static const char *const REFERENCE_TYPE_KEY
InvalidReferenceIssue(const Context &context, severity_t s)
bool register_issue(const std::string &name, CreateIssueCallback creator)
register an issue factory
static IssueFactory * instance()
method to access singleton
void set_value(const std::string &key, uint8_t value)
Sets a value 8 bit unsigned.
void finish_setup(const std::string &message)
Finishes the setup of the Issue.
static const char *const INDEX_REFERENCE_TYPE
static const char *const RANGE_MAX_KEY
static const char *const RANGE_MIN_KEY
static void set_range(ers::Issue &issue, int64_t index, int64_t min_index, int64_t max_index, const char *entity_name=0)
static const char *const CLASS_NAME
virtual const char * get_class_name() const
Get key for class (used for serialisation).
static void check_range(const ers::Context &c, int64_t min, int64_t value, int64_t max, const char *entity_name=0)
enum ers::_severity_t severity_t