ViSP  2.8.0
vpException.h
1 /****************************************************************************
2  *
3  * $Id: vpException.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Exception handling.
36  *
37  * Authors:
38  * Nicolas Mansard
39  *
40  *****************************************************************************/
41 
42 
43 /* \file vpException.h
44  \brief error that can be emited by the vp class and its derivates
45  */
46 
47 #ifndef __vpException_H
48 #define __vpException_H
49 
50 
51 /* --------------------------------------------------------------------- */
52 /* --- INCLUDE --------------------------------------------------------- */
53 /* --------------------------------------------------------------------- */
54 
55 #include <visp/vpConfig.h>
56 
57 /* Classes standards. */
58 #include <iostream> /* Classe std::ostream. */
59 #include <string> /* Classe string. */
60 
61 /* --------------------------------------------------------------------- */
62 /* --- CLASS ----------------------------------------------------------- */
63 /* --------------------------------------------------------------------- */
64 
65 
75 class VISP_EXPORT vpException : public std::exception
76 {
77 
78 private:
79 
81  int code;
82 
84  std::string message;
85 
86 private:
87 
89  vpException();
90 
91 public:
92 
94  {
105  notInitialized
106  } ;
107 
108  vpException (const int code, const char * msg);
109  vpException (const int code, const std::string & msg);
110  vpException (const int code);
111 
116  virtual ~vpException() throw() {}
117 
119  int getCode (void);
120 
122  const std::string &getStringMessage (void);
125  const char *getMessage (void);
126 
128  friend VISP_EXPORT std::ostream & operator << (std::ostream & os,
129  const vpException & art);
130 
131  const char* what () const throw();
132 
133 };
134 
135 
136 
137 
138 
139 #endif /* #ifndef __vpException_H */
140 
141 
142 /*
143  * Local variables:
144  * c-basic-offset: 2
145  * End:
146  */
error that can be emited by ViSP classes.
Definition: vpException.h:75
virtual ~vpException()
Definition: vpException.h:116