BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/IRawFile/IRawFile/RawFileExceptions.h
Go to the documentation of this file.
1#ifndef BES_RAWFILE_EXCEPTIONS_H
2#define BES_RAWFILE_EXCEPTIONS_H
3
4#include <string>
5#include <stdint.h>
6
8 public:
9 virtual ~RawFileException() {}
10
11 virtual void print() const;
12};
13
14class RawExMessage : public RawFileException {
15 public :
16 RawExMessage(const char* msg) : m_msg(msg) {}
17 virtual ~RawExMessage() {}
18
19 virtual void print() const;
20
21 private :
22 std::string m_msg;
23};
24
25class InvalidRawFile : public RawFileException {
26 public:
27 InvalidRawFile(const char* filename) : m_filename(filename) {}
28 virtual ~InvalidRawFile() {}
29
30 virtual void print() const;
31
32 private:
33 std::string m_filename;
34};
35
36class BadInputStream : public RawFileException {
37 public:
38 BadInputStream(const char* block_name) : m_blockName(block_name) {}
39 virtual ~BadInputStream() {}
40
41 virtual void print() const;
42
43 private:
44 std::string m_blockName;
45};
46
47class WrongMarker : public RawFileException {
48 public:
49 WrongMarker(uint32_t expect, uint32_t value) : m_expect(expect), m_value(value) {}
50 virtual ~WrongMarker() {}
51
52 virtual void print() const;
53
54 private:
55 uint32_t m_expect;
56 uint32_t m_value;
57};
58
60 public:
61 UnexpectedRecordSize(const char* block_name, uint32_t expect, uint32_t value)
62 : m_blockName(block_name), m_expect(expect), m_value(value) {
63 }
65
66 virtual void print() const;
67
68 private:
69 std::string m_blockName;
70 uint32_t m_expect;
71 uint32_t m_value;
72};
73
74class ReachEndOfFile : public RawFileException {
75 public:
76 ReachEndOfFile(const char* fileName)
77 : m_fileName(fileName) {
78 }
79 virtual ~ReachEndOfFile() {}
80
81 virtual void print() const;
82 void print(const char* fname) const;
83
84 private:
85 std::string m_fileName;
86};
87
89 public :
90 virtual void print() const;
91};
92
93class FailedToWrite : public RawFileException {
94 public:
95 FailedToWrite(const char* block_name) : m_blockName(block_name) {
96 }
97 virtual ~FailedToWrite() {}
98
99 virtual void print() const;
100
101 private:
102 std::string m_blockName;
103};
104
105#endif
virtual void print() const
virtual void print() const
virtual void print() const
virtual void print() const
virtual void print() const
virtual void print() const
virtual void print() const
void print(const char *fname) const
UnexpectedRecordSize(const char *block_name, uint32_t expect, uint32_t value)
virtual void print() const
virtual void print() const
WrongMarker(uint32_t expect, uint32_t value)