BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/eformat/include/eformat/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: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 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
19
namespace
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
*/
25
class
OutOfBoundsIssue
:
public
eformat::Issue
{
26
27
public
:
// interface
28
/**
29
* Builds a new out-of-bounds issue
30
*
31
* @param context The Error Reporting System context to be used to identify
32
* the spot where this issue was created
33
* @param severity The severity of this issue
34
* @param size The current buffer size
35
* @param pos The requested position
36
*/
37
OutOfBoundsIssue
(
const
ers::Context
& context,
ers::severity_t
severity
,
size_t
size
,
38
size_t
pos
);
39
40
/**
41
* Destructor virtualisation
42
*/
43
virtual
~OutOfBoundsIssue
() throw() {}
44
45
/**
46
* Access the size of the initial buffer, in bytes
47
*/
48
size_t
size
(
void
)
const
;
49
50
/**
51
* Access the requested position to access
52
*/
53
size_t
pos
(
void
)
const
;
54
};
55
56
}
// namespace eformat
57
58
/**
59
* Simplifies the use of this Issue
60
*
61
* @param size The current buffer size
62
* @param pos The requested position
63
*/
64
#define EFORMAT_OUT_OF_BOUNDS( size, pos ) \
65
eformat::OutOfBoundsIssue( ERS_HERE, ers::error, size, pos )
66
67
#endif
/* EFORMAT_OUTOFBOUNDSISSUE_H */
eformat::Issue
Definition
Event/eformat/include/eformat/Issue.h:23
eformat::OutOfBoundsIssue::size
size_t size(void) const
Definition
OutOfBoundsIssue.cxx:30
eformat::OutOfBoundsIssue::OutOfBoundsIssue
OutOfBoundsIssue(const ers::Context &context, ers::severity_t severity, size_t size, size_t pos)
Definition
OutOfBoundsIssue.cxx:21
eformat::OutOfBoundsIssue::pos
size_t pos(void) const
Definition
OutOfBoundsIssue.cxx:32
eformat::OutOfBoundsIssue::~OutOfBoundsIssue
virtual ~OutOfBoundsIssue()
Definition
Event/eformat/include/eformat/OutOfBoundsIssue.h:43
ers::Context
Source context for Issue.
Definition
Event/ers/include/ers/Context.h:41
ers::Issue::severity
severity_t severity() const
severity_t of the issue
Definition
ers/src/Issue.cxx:584
eformat
Definition
Event/eformat/include/eformat/BadVersionIssue.h:20
ers::severity_t
enum ers::_severity_t severity_t
8.0.0
BOSS_Source
Event
eformat
include
eformat
OutOfBoundsIssue.h
Generated by
1.16.1