IBR-DTNSuite
0.10
Main Page
Namespaces
Classes
Files
File List
File Members
Exceptions.h
Go to the documentation of this file.
1
/*
2
* Exceptions.h
3
*
4
* Copyright (C) 2011 IBR, TU Braunschweig
5
*
6
* Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7
*
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
11
*
12
* http://www.apache.org/licenses/LICENSE-2.0
13
*
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
19
*
20
*/
21
22
#ifndef EXCEPTIONS_H_
23
#define EXCEPTIONS_H_
24
25
#include "
ibrcommon/Exceptions.h
"
26
27
#include <stdexcept>
28
#include <string>
29
30
31
using namespace
std;
32
33
namespace
dtn
34
{
38
class
InvalidDataException
:
public
ibrcommon::Exception
39
{
40
public
:
41
InvalidDataException
(
string
what =
"Invalid input data."
) throw() : Exception(what)
42
{
43
};
44
};
45
46
class
InvalidProtocolException
:
public
dtn::InvalidDataException
47
{
48
public
:
49
InvalidProtocolException
(
string
what =
"The received data does not match the protocol."
) throw() : dtn::
InvalidDataException
(what)
50
{
51
};
52
};
53
54
class
SerializationFailedException
:
public
dtn::InvalidDataException
55
{
56
public
:
57
SerializationFailedException
(
string
what =
"The serialization failed."
) throw() : dtn::
InvalidDataException
(what)
58
{
59
};
60
};
61
62
class
PayloadReceptionInterrupted
:
public
dtn::SerializationFailedException
63
{
64
public
:
65
const
size_t
length
;
66
PayloadReceptionInterrupted
(
const
size_t
l,
string
what =
"The payload reception has been interrupted."
) throw() : dtn::
SerializationFailedException
(what), length(l)
67
{
68
};
69
};
70
71
class
MissingObjectException
:
public
ibrcommon::Exception
72
{
73
public
:
74
MissingObjectException
(
string
what =
"Object not available."
) throw() : Exception(what)
75
{
76
};
77
};
78
79
class
ConnectionInterruptedException
:
public
ibrcommon::IOException
80
{
81
public
:
82
ConnectionInterruptedException
() : ibrcommon::IOException(
"The connection has been interrupted."
)
83
{
84
}
85
};
86
}
87
88
#endif
/*EXCEPTIONS_H_*/
ibrdtn
ibrdtn
data
Exceptions.h
Generated on Mon Jul 22 2013 15:16:00 for IBR-DTNSuite by
1.8.3.1