CUBA
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
c
f
i
o
p
s
t
w
+
Functions
o
w
Typedefs
Enumerations
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
e
f
g
i
l
m
p
r
s
t
v
~
+
Functions
a
b
c
e
f
g
p
s
t
v
~
Variables
+
Files
File List
excep.hh
1
8
#ifndef EXCEP_HH_
9
#define EXCEP_HH_
10
11
#include <stdexcept>
12
#include <exception>
13
#include <string>
14
15
using
std::runtime_error;
16
using
std::exception;
17
using
std::string;
18
19
namespace
ruba
{
20
24
class
cuba_runtime_error
:
public
runtime_error {
25
public
:
26
cuba_runtime_error
() :
27
runtime_error(
""
) {
28
}
29
cuba_runtime_error
(
const
std::string& msg) :
30
runtime_error(msg) {
31
}
32
};
33
37
class
cuba_exception
:
public
exception {
38
public
:
39
string
message;
40
short
code;
41
42
inline
cuba_exception
() :
43
message(
""
), code(-1) {
44
45
}
46
47
inline
cuba_exception
(
const
string
& message,
const
short
& code = -1) :
48
message(message), code(code) {
49
}
// must provide some message
50
51
virtual
const
char
* what()
const
throw
() {
52
return
message.c_str();
53
}
54
};
55
56
}
57
#endif
/* EXCEP_HH_ */
ruba::cuba_runtime_error
customized runtime error class
Definition:
excep.hh:24
ruba
Definition:
cpda.cc:10
ruba::cuba_exception
customized exception
Definition:
excep.hh:37
src
utils
excep.hh
Generated by
1.8.15