Fawkes API  Fawkes Development Version
exception.cpp
1 
2 /***************************************************************************
3  * software.cpp - Katana Controller exceptions
4  *
5  * Created: Tue Jan 03 11:40:31 2012
6  * Copyright 2012 Bahram Maleki-Fard, AllemaniACs RoboCup Team
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 #include "exception.h"
25 
26 #include <cmath>
27 
28 namespace fawkes {
29 
30 /** @class KatanaNoSolutionException <plugins/katana/exception.h>
31  * No joint configuration for desired target found.
32  * @ingroup Exceptions
33  */
34 /** Constructor
35  * @param format message format, takes sprintf() parameters as variadic arguments
36  */
37 KatanaNoSolutionException::KatanaNoSolutionException(const char *format, ...) throw() : Exception()
38 {
39  va_list va;
40  va_start(va, format);
41  append_va(format, va);
42  va_end(va);
43 }
44 
45 /** @class KatanaOutOfRangeException <plugins/katana/exception.h>
46  * At least one motor is out of range.
47  * @ingroup Exceptions
48  */
49 /** Constructor
50  * @param format message format, takes sprintf() parameters as variadic arguments
51  */
52 KatanaOutOfRangeException::KatanaOutOfRangeException(const char *format, ...) throw() : Exception()
53 {
54  va_list va;
55  va_start(va, format);
56  append_va(format, va);
57  va_end(va);
58 }
59 
60 /** @class KatanaMotorCrashedException <plugins/katana/exception.h>
61  * At least one motor crashed
62  * @ingroup Exceptions
63  */
64 /** Constructor
65  * @param format message format, takes sprintf() parameters as variadic arguments
66  */
67 KatanaMotorCrashedException::KatanaMotorCrashedException(const char *format, ...) throw()
68 : Exception()
69 {
70  va_list va;
71  va_start(va, format);
72  append_va(format, va);
73  va_end(va);
74 }
75 
76 /** @class KatanaUnsupportedException <plugins/katana/exception.h>
77  * Unsupported command.
78  * @ingroup Exceptions
79  */
80 /** Constructor
81  * @param format message format, takes sprintf() parameters as variadic arguments
82  */
83 KatanaUnsupportedException::KatanaUnsupportedException(const char *format, ...) throw()
84 : Exception()
85 {
86  va_list va;
87  va_start(va, format);
88  append_va(format, va);
89  va_end(va);
90 }
91 
92 } // end namespace fawkes
fawkes::Exception::append_va
void append_va(const char *format, va_list va)
Append messages to the message list.
Definition: exception.cpp:353
fawkes::KatanaUnsupportedException::KatanaUnsupportedException
KatanaUnsupportedException(const char *format,...)
Constructor.
Definition: exception.cpp:89
fawkes
fawkes::KatanaOutOfRangeException::KatanaOutOfRangeException
KatanaOutOfRangeException(const char *format,...)
Constructor.
Definition: exception.cpp:58
fawkes::KatanaMotorCrashedException::KatanaMotorCrashedException
KatanaMotorCrashedException(const char *format,...)
Constructor.
Definition: exception.cpp:73
fawkes::KatanaNoSolutionException::KatanaNoSolutionException
KatanaNoSolutionException(const char *format,...)
Constructor.
Definition: exception.cpp:43
fawkes::Exception
Definition: exception.h:41