Fawkes API  Fawkes Development Version
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 <fvcams/cam_exceptions.h>
00025 
00026 using namespace fawkes;
00027 
00028 namespace firevision {
00029 #if 0 /* just to make Emacs auto-indent happy */
00030 }
00031 #endif
00032 
00033 /** @class CameraNotOpenedException <fvcams/cam_exceptions.h>
00034  * Camera not opened exception.
00035  * Throw this exception if an operations was requested on a camera that is
00036  * not possible if the camera has not been properly opened before.
00037  */
00038 
00039 /** Constructor. */
00040 CameraNotOpenedException::CameraNotOpenedException()
00041   : Exception("Camera not opened")
00042 {
00043 }
00044 
00045 /** @class CameraNotStartedException <fvcams/cam_exceptions.h>
00046  * Camera not started exception.
00047  * Throw this exception if an operations was requested on a camera that is
00048  * not possible if the camera has not been properly started before.
00049  */
00050 
00051 /** Constructor. */
00052 CameraNotStartedException::CameraNotStartedException()
00053   : Exception("Camera not started")
00054 {
00055 }
00056 
00057 
00058 /** @class CaptureException <fvcams/cam_exceptions.h>
00059  * Capturing a frame failed.
00060  * This exception is thrown if a camera failed to retrieve a new image from
00061  * the camera.
00062  */
00063 
00064 /** Constructor.
00065  * @param format format of the descriptive message
00066  */
00067 CaptureException::CaptureException(const char *format, ...)
00068   : Exception()
00069 {
00070   va_list va;
00071   va_start(va, format);
00072   append_va(format, va);
00073   va_end(va);
00074 }
00075 
00076 
00077 /** @class UnknownCameraTypeException <fvcams/cam_exceptions.h>
00078  * Unknown camera type exception.
00079  * Thrown if the requested camera has not been recognized or the needed
00080  * libraries were not available at compile time.
00081  */
00082 
00083 /** Constructor.
00084  * @param msg optional extra message
00085  */
00086 UnknownCameraTypeException::UnknownCameraTypeException(const char *msg)
00087   : Exception("Unknown camera type")
00088 {
00089   append(msg);
00090 }
00091 
00092 
00093 /** @class UnknownCameraException <fvcams/cam_exceptions.h>
00094  * Unknown camera exception.
00095  * Thrown if the requested camera is not available.
00096  */
00097 
00098 /** Constructor.
00099  * @param msg optional extra message
00100  */
00101 UnknownCameraException::UnknownCameraException(const char *msg)
00102   : Exception("Unknown camera")
00103 {
00104   append(msg);
00105 }
00106 
00107 
00108 /** @class UnknownCameraControlTypeException <fvcams/cam_exceptions.h>
00109  * Unknown camera control exception.
00110  * Thrown if the requested camera control has not been recognized or the needed
00111  * libraries were not available at compile time.
00112  */
00113 
00114 /** Constructor.
00115  * @param msg optional extra message
00116  */
00117 UnknownCameraControlTypeException::UnknownCameraControlTypeException(const char *msg)
00118   : Exception("Unknown camera control type")
00119 {
00120   append(msg);
00121 }
00122 
00123 } // end namespace firevision