CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
SizeCheckIssue.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/SizeCheckIssue.h
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 * @brief When size checks do not match, this exception must be thrown.
11 */
12
13#ifndef EFORMAT_SIZECHECKEX_H
14#define EFORMAT_SIZECHECKEX_H
15
16#include "eformat/Issue.h"
17#include <stdint.h>
18
19namespace eformat {
20
21 /**
22 * This exception is supposed to be thrown when the user is looking for a
23 * region of memory not covered inside the buffer area.
24 */
26
27 public: //interface
28
29 /**
30 * Builds a new size-check 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 actual The correct value for the fragment size added up
36 * @param informed The informed value for the fragment size
37 */
39 uint32_t actual, uint32_t informed);
40
41
42 /**
43 * Destructor virtualisation
44 */
45 virtual ~SizeCheckIssue() throw() {}
46
47 /**
48 * Access the actual value of the current fragment
49 */
50 uint32_t actual () const;
51
52 /**
53 * Access the informed (by the header) value of the current fragment
54 */
55 uint32_t informed (void) const;
56
57 };
58
59}
60
61/**
62 * Simplifies the use of this Issue
63 *
64 * @param actual The actual value for the fragment size added up
65 * @param informed The informed value for the fragment size
66 */
67#define EFORMAT_SIZE_CHECK(actual, informed) \
68 eformat::SizeCheckIssue(ERS_HERE, ers::error, actual, informed)
69
70#endif /* EFORMAT_SIZECHECKEX_H */
SizeCheckIssue(const ers::Context &context, ers::severity_t severity, uint32_t actual, uint32_t informed)
uint32_t informed(void) const
Source context for Issue.
Definition Context.h:42
severity_t severity() const
severity_t of the issue
Defines the base eformat Issue.
enum ers::_severity_t severity_t