00001 //Dear emacs, this is -*- c++ -*- 00002 00013 #include "eformat/OutOfBoundsIssue.h" 00014 00018 static const char* BUFFER_SIZE_KEY = "Size in bytes of the buffer"; 00019 static const char* REQUESTED_BYTE_KEY = "Requested byte to access"; 00020 00021 eformat::OutOfBoundsIssue::OutOfBoundsIssue(const ers::Context& context, 00022 ers::severity_t severity, 00023 size_t size, size_t pos) 00024 : eformat::Issue(context,severity) 00025 { 00026 set_value(BUFFER_SIZE_KEY, size); 00027 set_value(REQUESTED_BYTE_KEY, pos); 00028 finish_setup("Requested buffer position is out of bounds"); 00029 } 00030 00031 size_t eformat::OutOfBoundsIssue::size () const 00032 { 00033 return get_int_value(BUFFER_SIZE_KEY); 00034 } 00035 00036 size_t eformat::OutOfBoundsIssue::pos () const 00037 { 00038 return get_int_value(REQUESTED_BYTE_KEY); 00039 } 00040 00041 00042 00043