/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/eformat/eformat-00-00-04/src/NotAlignedIssue.cxx

Go to the documentation of this file.
00001 //Dear emacs, this is -*- c++ -*-
00002 
00013 #include <sstream>
00014 #include <string>
00015 #include "eformat/NotAlignedIssue.h"
00016 
00020 static const char* BASE_ADDRESS_KEY = "Base address";
00021 static const char* SIZE_KEY = "Total block size";
00022 
00023 eformat::NotAlignedIssue::NotAlignedIssue(const ers::Context& context,
00024                                           ers::severity_t severity,
00025                                           const void* base, size_t size)
00026   : eformat::Issue(context,severity)
00027 {
00028   std::ostringstream oss;
00029   oss << base;
00030   set_value(BASE_ADDRESS_KEY, oss.str());
00031   set_value(SIZE_KEY, size);
00032   finish_setup("Misaligned data block");
00033 }
00034 
00035 const void* eformat::NotAlignedIssue::base () const
00036 {
00037   std::istringstream iss;
00038   iss.str(get_value(BASE_ADDRESS_KEY));
00039   size_t x;
00040   iss >> x;
00041   return (void*)x; //nasty cast
00042 }
00043 
00044 size_t eformat::NotAlignedIssue::size () const
00045 {
00046   return get_int_value(SIZE_KEY);
00047 }

Generated on Tue Nov 29 22:58:25 2016 for BOSS_7.0.2 by  doxygen 1.4.7