Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
exceptions.h
1
2
/***************************************************************************
3
* exceptions.h - BlackBoard exceptions
4
*
5
* Generated: Wed Oct 04 18:37:50 2006
6
* Copyright 2006 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __BLACKBOARD_EXCEPTIONS_H_
25
#define __BLACKBOARD_EXCEPTIONS_H_
26
27
#include <core/exception.h>
28
29
namespace
fawkes {
30
31
/** A NULL pointer was supplied where not allowed.
32
* Throw this exception if a pointer to NULL has been supplied where this is
33
* not allowed.
34
*/
35
class
BlackBoardMemMgrInvalidPointerException
:
public
Exception
{
36
public
:
37
/** Constructor */
38
BlackBoardMemMgrInvalidPointerException
() :
Exception
(
"Invalid pointer to free"
) {}
39
};
40
41
42
/** Thrown when BlackBoard memory has been corupted
43
* This exception is thrown by the memory manager if the memory has been
44
* corrupted, for example if there are bytes that belong to neither a free chunk nor
45
* a allocated chunk.
46
*/
47
class
BBInconsistentMemoryException
:
public
Exception
{
48
public
:
49
/** Constructor
50
* @param msg message, appended to exception, base message "Memory corruption detected"
51
*/
52
BBInconsistentMemoryException
(
const
char
*msg)
53
:
Exception
(
"Memory corruption detected"
)
54
{
55
append
(msg);
56
}
57
};
58
59
/** Thrown if BlackBoard is not master and master operation has been requested.
60
* This exception is thrown by the memory manager if the memory is not owned but
61
* master mode is required. The interface manager throws it if you try to create
62
* a new interface but are not master.
63
* corrupted, for example if there are bytes that belong to neither a free chunk nor
64
* a allocated chunk.
65
*/
66
class
BBNotMasterException
:
public
Exception
{
67
public
:
68
/** Constructor
69
* @param msg message, appended to exception, base message "Memory corruption detected"
70
*/
71
BBNotMasterException
(
const
char
*msg)
72
:
Exception
(
"Not BlackBoard Master!"
)
73
{
74
append
(msg);
75
}
76
};
77
78
79
/** Thrown if shared memory could not be opened. Can happen only if opening the
80
* segment as non-master.
81
*/
82
class
BBMemMgrCannotOpenException
:
public
Exception
{
83
public
:
84
/** Constructor */
85
BBMemMgrCannotOpenException
() :
Exception
(
"Cannot open shared memory segment"
) {}
86
};
87
88
89
/** Thrown if no definition of interface or interface generator found.
90
*/
91
class
BlackBoardInterfaceNotFoundException
:
public
Exception
{
92
public
:
93
/** Constructor
94
* @param type type of interface that could not be found
95
* @param add_msg additional message, add a space as first character
96
*/
97
BlackBoardInterfaceNotFoundException
(
const
char
*type,
const
char
*add_msg =
""
)
98
:
Exception
(
"Interface of type '%s' not found.%s"
, type, add_msg)
99
{
100
}
101
};
102
103
104
/** Thrown if versions do not match.
105
* If the hashes of two interfaces of the very same type do not match they
106
* are incompatible.
107
*/
108
class
BlackBoardInterfaceVersionMismatchException
:
public
Exception
{
109
public
:
110
/** Constructor. */
111
BlackBoardInterfaceVersionMismatchException
()
112
:
Exception
(
"Interface versions do not match, need to update and recompile interfaces?"
)
113
{
114
}
115
};
116
117
118
/** Thrown if a writer is already active on an interface that writing has
119
* been requested for.
120
*/
121
class
BlackBoardWriterActiveException
:
public
Exception
{
122
public
:
123
/** Constructor
124
* @param type type of interface that could not be found
125
* @param id identifier of the interface
126
*/
127
BlackBoardWriterActiveException
(
const
char
*
id
,
const
char
*type) :
Exception
()
128
{
129
append
(
"There is already a writer on interface '%s' of type '%s'"
,
id
, type);
130
}
131
};
132
133
134
/** Thrown if BlackBoard is opened as non-master with no master alive.
135
*/
136
class
BlackBoardNoMasterAliveException
:
public
Exception
{
137
public
:
138
/** Constructor*/
139
BlackBoardNoMasterAliveException
() :
Exception
(
"No master BlackBoard alive"
) {}
140
};
141
142
143
/** Thrown if no writer interface is alive.
144
*/
145
class
BlackBoardNoWritingInstanceException
:
public
Exception
{
146
public
:
147
/** Constructor*/
148
BlackBoardNoWritingInstanceException
() :
Exception
(
"No writing instance for interface"
) {}
149
};
150
151
}
// end namespace fawkes
152
153
#endif
src
libs
blackboard
exceptions.h
Generated by
1.8.1.2