BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/eformat/include/eformat/NotAlignedIssue.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/NotAlignedIssue.h
5 * @author <a href="mailto:Andre.dos.Anjos@cern.ch">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Describes the exception where some chunk of memory is not 32-bit
11 * aligned.
12 */
13
14#ifndef EFORMAT_NOTALIGNEDISSUE_H
15#define EFORMAT_NOTALIGNEDISSUE_H
16
17#include "eformat/Issue.h"
18#include <cstdlib>
19
20namespace eformat {
21
22 /**
23 * Describes the out-of-bounds exception, that is thrown when the user
24 * requests a memory location out of the bounds of a buffer.
25 */
27
28 public: // interface
29 /**
30 * Builds a new not-aligned exception
31 *
32 * @param context The Error Reporting System context to be used to identify
33 * the spot where this issue was created
34 * @param severity The severity of this issue
35 * @param base The address of the page
36 * @param size The size of this page, in bytes
37 */
38 NotAlignedIssue( const ers::Context& context, ers::severity_t severity, const void* base,
39 size_t size );
40
41 /**
42 * Destructor virtualisation
43 */
44 virtual ~NotAlignedIssue() throw() {}
45
46 /**
47 * Access the address of the first page of the IO vector
48 */
49 const void* base() const;
50
51 /**
52 * The size of this block, in bytes
53 */
54 size_t size() const;
55 };
56
57} // namespace eformat
58
59/**
60 * Simplifies the use of this Issue
61 *
62 * @param req The request child
63 * @param total The total child number available
64 */
65#define EFORMAT_NOT_ALIGNED( base, size ) \
66 eformat::NotAlignedIssue( ERS_HERE, ers::error, base, size )
67
68#endif /* EFORMAT_NOTALIGNEDISSUE_H */
NotAlignedIssue(const ers::Context &context, ers::severity_t severity, const void *base, size_t size)
const void * base() const
Source context for Issue.
severity_t severity() const
severity_t of the issue
enum ers::_severity_t severity_t