Fawkes API  Fawkes Development Version
cam_exceptions.cpp
1 
2 /***************************************************************************
3  * cam_exceptions.cpp - Camera-related exceptions
4  *
5  * Created: Sat Apr 14 23:07:12 2007
6  * Copyright 2005-2007 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 #include <fvcams/cam_exceptions.h>
25 
26 using namespace fawkes;
27 
28 namespace firevision {
29 #if 0 /* just to make Emacs auto-indent happy */
30 }
31 #endif
32 
33 /** @class CameraNotOpenedException <fvcams/cam_exceptions.h>
34  * Camera not opened exception.
35  * Throw this exception if an operations was requested on a camera that is
36  * not possible if the camera has not been properly opened before.
37  */
38 
39 /** Constructor. */
40 CameraNotOpenedException::CameraNotOpenedException()
41  : Exception("Camera not opened")
42 {
43 }
44 
45 /** @class CameraNotStartedException <fvcams/cam_exceptions.h>
46  * Camera not started exception.
47  * Throw this exception if an operations was requested on a camera that is
48  * not possible if the camera has not been properly started before.
49  */
50 
51 /** Constructor. */
53  : Exception("Camera not started")
54 {
55 }
56 
57 
58 /** @class CaptureException <fvcams/cam_exceptions.h>
59  * Capturing a frame failed.
60  * This exception is thrown if a camera failed to retrieve a new image from
61  * the camera.
62  */
63 
64 /** Constructor.
65  * @param format format of the descriptive message
66  */
67 CaptureException::CaptureException(const char *format, ...)
68  : Exception()
69 {
70  va_list va;
71  va_start(va, format);
72  append_va(format, va);
73  va_end(va);
74 }
75 
76 
77 /** @class UnknownCameraTypeException <fvcams/cam_exceptions.h>
78  * Unknown camera type exception.
79  * Thrown if the requested camera has not been recognized or the needed
80  * libraries were not available at compile time.
81  */
82 
83 /** Constructor.
84  * @param msg optional extra message
85  */
87  : Exception("Unknown camera type")
88 {
89  append(msg);
90 }
91 
92 
93 /** @class UnknownCameraException <fvcams/cam_exceptions.h>
94  * Unknown camera exception.
95  * Thrown if the requested camera is not available.
96  */
97 
98 /** Constructor.
99  * @param msg optional extra message
100  */
102  : Exception("Unknown camera")
103 {
104  append(msg);
105 }
106 
107 
108 /** @class UnknownCameraControlTypeException <fvcams/cam_exceptions.h>
109  * Unknown camera control exception.
110  * Thrown if the requested camera control has not been recognized or the needed
111  * libraries were not available at compile time.
112  */
113 
114 /** Constructor.
115  * @param msg optional extra message
116  */
118  : Exception("Unknown camera control type")
119 {
120  append(msg);
121 }
122 
123 } // end namespace firevision
CaptureException(const char *format,...)
Constructor.
Fawkes library namespace.
UnknownCameraException(const char *msg=0)
Constructor.
UnknownCameraTypeException(const char *msg=0)
Constructor.
Base class for exceptions in Fawkes.
Definition: exception.h:36
void append_va(const char *format, va_list va)
Append messages to the message list.
Definition: exception.cpp:361
UnknownCameraControlTypeException(const char *msg=0)
Constructor.
void append(const char *format,...)
Append messages to the message list.
Definition: exception.cpp:341