CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
OutOfBoundsIssue.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/OutOfBoundsIssue.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 Out of bounds exception when trying to read beyond existing buffers.
11 */
12
13#ifndef EFORMAT_OUTOFBOUNDSISSUE_H
14#define EFORMAT_OUTOFBOUNDSISSUE_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 out-of-bounds issue
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 size The current buffer size
36 * @param pos The requested position
37 */
39 size_t size, size_t pos);
40
41 /**
42 * Destructor virtualisation
43 */
44 virtual ~OutOfBoundsIssue() throw() {}
45
46 /**
47 * Access the size of the initial buffer, in bytes
48 */
49 size_t size (void) const;
50
51 /**
52 * Access the requested position to access
53 */
54 size_t pos (void) const;
55
56 };
57
58}
59
60/**
61 * Simplifies the use of this Issue
62 *
63 * @param size The current buffer size
64 * @param pos The requested position
65 */
66#define EFORMAT_OUT_OF_BOUNDS(size, pos) \
67 eformat::OutOfBoundsIssue(ERS_HERE, ers::error, size, pos)
68
69#endif /* EFORMAT_OUTOFBOUNDSISSUE_H */
OutOfBoundsIssue(const ers::Context &context, ers::severity_t severity, size_t size, size_t pos)
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