Project
Loading...
Searching...
No Matches
exceptions.h
Go to the documentation of this file.
1// Copyright 2019-2023 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef RANS_INTERNAL_COMMON_EXCEPTIONS_
17#define RANS_INTERNAL_COMMON_EXCEPTIONS_
18
19#include <string>
20#include <stdexcept>
21
22namespace o2::rans
23{
24class Exception : public std::exception
25{
26 public:
27 Exception() = default;
28 Exception(const Exception& other) = default;
30 Exception& operator=(const Exception& other) = default;
32 ~Exception() override = default;
33
34 Exception(const std::string& msg) : mMsg{msg} {};
35 Exception(const char* msg) : mMsg{msg} {};
36
37 const char* what() const noexcept override
38 {
39 return mMsg.c_str();
40 };
41
42 std::string mMsg{};
43};
44
45class RuntimeError : public Exception
46{
48};
49
50class IOError : public Exception
51{
53};
54
55class ParsingError : public IOError
56{
57 using IOError::IOError;
58};
59
60class ValueError : public Exception
61{
63};
64
66{
68};
69
71{
73};
74
76{
78};
79
80class CodingError : public Exception
81{
83};
84
86{
87 using CodingError::CodingError;
88};
89
91{
92 using CodingError::CodingError;
93};
94
96{
97 using CodingError::CodingError;
98};
99
100} // namespace o2::rans
101
102#endif /* RANS_INTERNAL_COMMON_EXCEPTIONS_ */
Exception(const std::string &msg)
Definition exceptions.h:34
Exception(const char *msg)
Definition exceptions.h:35
Exception(const Exception &other)=default
std::string mMsg
Definition exceptions.h:42
Exception(Exception &&other)=default
const char * what() const noexcept override
Definition exceptions.h:37
Exception & operator=(Exception &&other)=default
Exception & operator=(const Exception &other)=default
~Exception() override=default
VectorOfTObjectPtrs other
uint64_t const void const *restrict const msg
Definition x9.h:153