CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
NotAlignedIssue.cxx
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file NotAlignedIssue.cxx
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * Implements the not-aligned exception.
11 */
12
13#include <sstream>
14#include <string>
16
17/**
18 * Strings to identify keys in ERS
19 */
20static const char* BASE_ADDRESS_KEY = "Base address";
21static const char* SIZE_KEY = "Total block size";
22
24 ers::severity_t severity,
25 const void* base, size_t size)
26 : eformat::Issue(context,severity)
27{
28 std::ostringstream oss;
29 oss << base;
30 set_value(BASE_ADDRESS_KEY, oss.str());
31 set_value(SIZE_KEY, size);
32 finish_setup("Misaligned data block");
33}
34
36{
37 std::istringstream iss;
38 iss.str(get_value(BASE_ADDRESS_KEY));
39 size_t x;
40 iss >> x;
41 return (void*)x; //nasty cast
42}
43
45{
46 return get_int_value(SIZE_KEY);
47}
Double_t x[10]
Describes the exception where some chunk of memory is not 32-bit aligned.
NotAlignedIssue(const ers::Context &context, ers::severity_t severity, const void *base, size_t size)
const void * base() const
Source context for Issue.
Definition Context.h:42
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.
enum ers::_severity_t severity_t