BOSS
7.1.1
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>
15
#include "
eformat/NotAlignedIssue.h
"
16
17
/**
18
* Strings to identify keys in ERS
19
*/
20
static
const
char
* BASE_ADDRESS_KEY =
"Base address"
;
21
static
const
char
* SIZE_KEY =
"Total block size"
;
22
23
eformat::NotAlignedIssue::NotAlignedIssue
(
const
ers::Context
& context,
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
35
const
void
*
eformat::NotAlignedIssue::base
()
const
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
44
size_t
eformat::NotAlignedIssue::size
()
const
45
{
46
return
get_int_value(SIZE_KEY);
47
}
x
Double_t x[10]
Definition
DataBase/tau_mode.c:57
NotAlignedIssue.h
Describes the exception where some chunk of memory is not 32-bit aligned.
eformat::Issue
Definition
eformat/eformat-00-01-00/eformat/Issue.h:23
eformat::NotAlignedIssue::NotAlignedIssue
NotAlignedIssue(const ers::Context &context, ers::severity_t severity, const void *base, size_t size)
Definition
NotAlignedIssue.cxx:23
eformat::NotAlignedIssue::base
const void * base() const
Definition
NotAlignedIssue.cxx:35
eformat::NotAlignedIssue::size
size_t size() const
Definition
NotAlignedIssue.cxx:44
ers::Context
Source context for Issue.
Definition
Context.h:42
ers::Issue::set_value
void set_value(const std::string &key, uint8_t value)
Sets a value 8 bit unsigned.
Definition
ers/ers-00-00-03/src/Issue.cxx:371
ers::Issue::finish_setup
void finish_setup(const std::string &message)
Finishes the setup of the Issue.
Definition
ers/ers-00-00-03/src/Issue.cxx:568
eformat
Definition
BadVersionIssue.h:20
ers::severity_t
enum ers::_severity_t severity_t
7.1.1
Event
eformat
eformat-00-01-00
src
NotAlignedIssue.cxx
Generated by
1.12.0