CSL
6.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
CSL_Exceptions.h
Go to the documentation of this file.
1
///
2
/// CSL_Exceptions.h -- the CSL Exception classes (specifications + implementations)
3
///
4
/// Exception classes
5
///
6
/// Status - enumerated return flag type
7
/// CException - Base class of CSL exceptions (written upper-case).
8
/// MemoryError - Malloc failure subclass
9
/// Wrong kind of operand error
10
/// TimingError - Time-out
11
/// RunTimeError - Illegal operation at run time
12
/// LogicError - Impossible operation
13
/// DomainError - Numerical data of wrong type
14
/// OutOfRangeError - Data out of range
15
/// IOError - IO Error
16
///
17
/// See the copyright notice and acknowledgment of authors in the file COPYRIGHT
18
///
19
20
#ifndef CSL_EXCEPTIONS_H
21
#define CSL_EXCEPTIONS_H
22
23
#include <exception>
// Standard C++ exception library
24
#include <string>
25
26
namespace
csl
{
27
28
using namespace
std
;
29
30
///
31
/// CSL status flags (for return values)
32
///
33
34
typedef
enum
{
35
kOk
,
///< "OK" return status
36
kFound
,
///< "found" return status
37
kNotFound
,
///< "not found" return status
38
kEmpty
,
///< "empty" return status
39
kErr
///< "error" return status
40
}
Status
;
41
42
#ifndef CSL_ENUMS
43
// class exception { }; // forward def needed for SWIG
44
#endif
45
46
///
47
/// Base class of CSL exceptions (written upper-case).
48
/// Has a string message
49
///
50
51
class
CException
:
public
std::exception {
52
public
:
53
string
mMessage
;
54
CException
(
const
string
& msg)
throw
() : mMessage(msg) { };
55
~CException
() throw() { };
56
const
char
*
what
() {
return
mMessage.c_str(); };
57
};
58
59
///
60
/// Malloc failure subclass
61
///
62
63
class
MemoryError
:
public
CException
{
64
public
:
65
MemoryError
(
const
string
& msg) :
CException
(msg) { };
66
};
67
68
///
69
/// Wrong kind of operand error
70
///
71
72
class
ValueError
:
public
CException
{
73
public
:
74
ValueError
(
const
string
& msg) :
CException
(msg) { };
75
};
76
77
///
78
/// Time-out
79
///
80
81
class
TimingError
:
public
CException
{
82
public
:
83
TimingError
(
const
string
& msg) :
CException
(msg) { };
84
};
85
86
///
87
/// Illegal operation at run time
88
///
89
90
class
RunTimeError
:
public
CException
{
91
public
:
92
RunTimeError
(
const
string
& msg) :
CException
(msg) { };
93
};
94
95
///
96
/// Impossible operation
97
///
98
99
class
LogicError
:
public
CException
{
100
public
:
101
LogicError
(
const
string
& msg) :
CException
(msg) { };
102
};
103
104
///
105
/// Numerical data of wrong type
106
///
107
108
class
DomainError
:
public
ValueError
{
109
public
:
110
DomainError
(
const
string
& msg) :
ValueError
(msg) { };
111
};
112
113
///
114
/// Data out of range
115
///
116
117
class
OutOfRangeError
:
public
ValueError
{
118
public
:
119
OutOfRangeError
(
const
string
& msg) :
ValueError
(msg) { };
120
};
121
122
///
123
/// IO Error
124
///
125
126
class
IOError
:
public
ValueError
{
127
public
:
128
IOError
(
const
string
& msg) :
ValueError
(msg) { };
129
};
130
131
///
132
/// DB Error
133
///
134
135
class
DBError
:
public
LogicError
{
136
public
:
137
DBError
(
const
string
& msg) :
LogicError
(msg) { };
138
};
139
140
///
141
/// Processing Error
142
///
143
144
class
ProcessingError
:
public
ValueError
{
145
public
:
146
ProcessingError
(
const
string
& msg) :
ValueError
(msg) { };
147
};
148
149
}
150
151
#endif
csl
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition:
Accessor.h:17
csl::TimingError
Time-out.
Definition:
CSL_Exceptions.h:81
csl::kEmpty
"empty" return status
Definition:
CSL_Exceptions.h:38
csl::LogicError::LogicError
LogicError(const string &msg)
Definition:
CSL_Exceptions.h:101
csl::ProcessingError
Processing Error.
Definition:
CSL_Exceptions.h:144
csl::ValueError::ValueError
ValueError(const string &msg)
Definition:
CSL_Exceptions.h:74
csl::IOError::IOError
IOError(const string &msg)
Definition:
CSL_Exceptions.h:128
csl::ProcessingError::ProcessingError
ProcessingError(const string &msg)
Definition:
CSL_Exceptions.h:146
csl::kNotFound
"not found" return status
Definition:
CSL_Exceptions.h:37
csl::RunTimeError
Illegal operation at run time.
Definition:
CSL_Exceptions.h:90
csl::kOk
"OK" return status
Definition:
CSL_Exceptions.h:35
std
csl::CException::~CException
~CException()
Definition:
CSL_Exceptions.h:55
csl::LogicError
Impossible operation.
Definition:
CSL_Exceptions.h:99
csl::CException::mMessage
string mMessage
Definition:
CSL_Exceptions.h:53
csl::CException::what
const char * what()
Definition:
CSL_Exceptions.h:56
csl::MemoryError
Malloc failure subclass.
Definition:
CSL_Exceptions.h:63
csl::TimingError::TimingError
TimingError(const string &msg)
Definition:
CSL_Exceptions.h:83
csl::DBError::DBError
DBError(const string &msg)
Definition:
CSL_Exceptions.h:137
csl::OutOfRangeError::OutOfRangeError
OutOfRangeError(const string &msg)
Definition:
CSL_Exceptions.h:119
csl::MemoryError::MemoryError
MemoryError(const string &msg)
Definition:
CSL_Exceptions.h:65
csl::DBError
DB Error.
Definition:
CSL_Exceptions.h:135
csl::DomainError::DomainError
DomainError(const string &msg)
Definition:
CSL_Exceptions.h:110
csl::CException::CException
CException(const string &msg)
Definition:
CSL_Exceptions.h:54
csl::Status
Status
CSL status flags (for return values)
Definition:
CSL_Exceptions.h:34
csl::IOError
IO Error.
Definition:
CSL_Exceptions.h:126
csl::RunTimeError::RunTimeError
RunTimeError(const string &msg)
Definition:
CSL_Exceptions.h:92
csl::OutOfRangeError
Data out of range.
Definition:
CSL_Exceptions.h:117
csl::kFound
"found" return status
Definition:
CSL_Exceptions.h:36
csl::kErr
"error" return status
Definition:
CSL_Exceptions.h:39
csl::DomainError
Numerical data of wrong type.
Definition:
CSL_Exceptions.h:108
csl::ValueError
Wrong kind of operand error.
Definition:
CSL_Exceptions.h:72
csl::CException
Base class of CSL exceptions (written upper-case). Has a string message.
Definition:
CSL_Exceptions.h:51
Src
Kernel
CSL_Exceptions.h
Generated on Fri Apr 17 2020 13:29:55 for CSL by
1.8.8