cam_exceptions.cpp

00001
00002 /***************************************************************************
00003  *  cam_exceptions.cpp - Camera-related exceptions
00004  *
00005  *  Created: Sat Apr 14 23:07:12 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #include <cams/cam_exceptions.h>
00025
00026 using namespace fawkes;
00027 
00028 /** @class CameraNotOpenedException <cams/cam_exceptions.h>
00029  * Camera not opened exception.
00030  * Throw this exception if an operations was requested on a camera that is
00031  * not possible if the camera has not been properly opened before.
00032  */
00033 
00034 /** Constructor. */
00035 CameraNotOpenedException::CameraNotOpenedException()
00036   : Exception("Camera not opened")
00037 {
00038 }
00039 
00040 /** @class CameraNotStartedException <cams/cam_exceptions.h>
00041  * Camera not started exception.
00042  * Throw this exception if an operations was requested on a camera that is
00043  * not possible if the camera has not been properly started before.
00044  */
00045 
00046 /** Constructor. */
00047 CameraNotStartedException::CameraNotStartedException()
00048   : Exception("Camera not started")
00049 {
00050 }
00051
00052 
00053 /** @class CaptureException <cams/cam_exceptions.h>
00054  * Capturing a frame failed.
00055  * This exception is thrown if a camera failed to retrieve a new image from
00056  * the camera.
00057  */
00058 
00059 /** Constructor.
00060  * @param format format of the descriptive message
00061  */
00062 CaptureException::CaptureException(const char *format, ...)
00063   : Exception()
00064 {
00065   va_list va;
00066   va_start(va, format);
00067   append_va(format, va);
00068   va_end(va);
00069 }
00070
00071 
00072 /** @class UnknownCameraTypeException <cams/cam_exceptions.h>
00073  * Unknown camera type exception.
00074  * Thrown if the requested camera has not been recognized or the needed
00075  * libraries were not available at compile time.
00076  */
00077 
00078 /** Constructor.
00079  * @param msg optional extra message
00080  */
00081 UnknownCameraTypeException::UnknownCameraTypeException(const char *msg)
00082   : Exception("Unknown camera type")
00083 {
00084   append(msg);
00085 }
00086
00087 
00088 /** @class UnknownCameraException <cams/cam_exceptions.h>
00089  * Unknown camera exception.
00090  * Thrown if the requested camera is not available.
00091  */
00092 
00093 /** Constructor.
00094  * @param msg optional extra message
00095  */
00096 UnknownCameraException::UnknownCameraException(const char *msg)
00097   : Exception("Unknown camera")
00098 {
00099   append(msg);
00100 }
00101
00102 
00103 /** @class UnknownCameraControlTypeException <cams/cam_exceptions.h>
00104  * Unknown camera control exception.
00105  * Thrown if the requested camera control has not been recognized or the needed
00106  * libraries were not available at compile time.
00107  */
00108 
00109 /** Constructor.
00110  * @param msg optional extra message
00111  */
00112 UnknownCameraControlTypeException::UnknownCameraControlTypeException(const char *msg)
00113   : Exception("Unknown camera control type")
00114 {
00115   append(msg);
00116 }