bpp-popgen  3.0.0
GeneralExceptions.h
Go to the documentation of this file.
1 //
2 // File GeneralExceptions.h
3 // Author : Sylvain Gaillard
4 // Last modification : Thursday July 29 2004
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
9 
10  This software is a computer program whose purpose is to provide classes
11  for population genetics analysis.
12 
13  This software is governed by the CeCILL license under French law and
14  abiding by the rules of distribution of free software. You can use,
15  modify and/ or redistribute the software under the terms of the CeCILL
16  license as circulated by CEA, CNRS and INRIA at the following URL
17  "http://www.cecill.info".
18 
19  As a counterpart to the access to the source code and rights to copy,
20  modify and redistribute granted by the license, users are provided only
21  with a limited warranty and the software's author, the holder of the
22  economic rights, and the successive licensors have only limited
23  liability.
24 
25  In this respect, the user's attention is drawn to the risks associated
26  with loading, using, modifying and/or developing or reproducing the
27  software by the user in light of its specific status of free software,
28  that may mean that it is complicated to manipulate, and that also
29  therefore means that it is reserved for developers and experienced
30  professionals having in-depth computer knowledge. Users are therefore
31  encouraged to load and test the software's suitability as regards their
32  requirements in conditions enabling the security of their systems and/or
33  data to be ensured and, more generally, to use and operate it in the
34  same conditions as regards security.
35 
36  The fact that you are presently reading this means that you have had
37  knowledge of the CeCILL license and that you accept its terms.
38  */
39 
40 #ifndef _GENERALEXCEPTIONS_H_
41 #define _GENERALEXCEPTIONS_H_
42 
43 // From STL
44 #include <string>
45 
46 #include <Bpp/Exceptions.h>
47 
48 namespace bpp
49 {
50 // ****************************************************************************
51 //
62  public Exception
63 {
64 public:
65  // Class constructor
69  BadIdentifierException(const char* text, size_t id);
73  BadIdentifierException(const std::string& text, size_t id);
74 
78  BadIdentifierException(const char* text, const std::string& id);
82  BadIdentifierException(const std::string& text, const std::string& id);
83 
84  // Class destructor
85  ~BadIdentifierException() throw ();
86 
87 public:
91  virtual const std::string getIdentifier() const;
92 
93 protected:
94  const std::string id_;
95 };
96 
97 // *****************************************************************************
98 
104 {
105 public:
106  // Class constructor
110  LocusNotFoundException(const char* text, size_t id);
111 
115  LocusNotFoundException(const std::string& text, size_t id);
116 
120  LocusNotFoundException(const char* text, const std::string& id);
121 
125  LocusNotFoundException(const std::string& text, const std::string& id);
126 
127  // Class destructor
128  ~LocusNotFoundException() throw ();
129 
130 public:
134  virtual const std::string getIdentifier() const;
135 };
136 
137 // *****************************************************************************
138 
144 {
145 public:
146  // Class constructor
150  AlleleNotFoundException(const char* text, size_t id);
151 
155  AlleleNotFoundException(const std::string& text, size_t id);
156 
160  AlleleNotFoundException(const char* text, const std::string& id);
161 
165  AlleleNotFoundException(const std::string& text, const std::string& id);
166 
167  // Class destructor
168  ~AlleleNotFoundException() throw ();
169 
170 public:
174  virtual const std::string getIdentifier() const;
175 };
176 
177 // *****************************************************************************
178 
184 {
185 public:
186  // Class constructor
190  LocalityNotFoundException(const char* text, size_t id);
191 
195  LocalityNotFoundException(const std::string& text, size_t id);
196 
200  LocalityNotFoundException(const char* text, const std::string& id);
201 
205  LocalityNotFoundException(const std::string& text, const std::string& id);
206 
207  // Class destructor
208  ~LocalityNotFoundException() throw ();
209 
210 public:
214  virtual const std::string getIdentifier() const;
215 };
216 
217 // *****************************************************************************
218 
224 {
225 public:
226  // Class constructor
230  IndividualNotFoundException(const char* text, size_t id);
231 
235  IndividualNotFoundException(const std::string& text, size_t id);
236 
240  IndividualNotFoundException(const char* text, const std::string& id);
241 
245  IndividualNotFoundException(const std::string& text, const std::string& id);
246 
247  // Class destructor
248  ~IndividualNotFoundException() throw ();
249 
250 public:
254  virtual const std::string getIdentifier() const;
255 };
256 
257 // *****************************************************************************
258 
264 {
265 public:
266  // Class constructor
270  GroupNotFoundException(const char* text, size_t id);
271 
275  GroupNotFoundException(const std::string& text, size_t id);
276 
280  GroupNotFoundException(const char* text, const std::string& id);
281 
285  GroupNotFoundException(const std::string& text, const std::string& id);
286 
287  // Class destructor
288  ~GroupNotFoundException() throw ();
289 
290 public:
294  virtual const std::string getIdentifier() const;
295 };
296 } // end of namespace bpp;
297 
298 #endif // _GENERALEXCEPTIONS_H_
299 
The AlleleNotFoundException class.
AlleleNotFoundException(const char *text, size_t id)
Build the exception with a numerical identifier.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
The BadIdentifierException class.
BadIdentifierException(const char *text, size_t id)
Build the exception with a numerical identifier.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
The GroupNotFoundException class.
GroupNotFoundException(const char *text, size_t id)
Build the exception with a numerical identifier.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
The IndividualNotFoundException class.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
IndividualNotFoundException(const char *text, size_t id)
Build the exception with a numerical identifier.
The LocalityNotFoundException class.
LocalityNotFoundException(const char *text, size_t id)
Build the exception with a numerical identifier.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
The LocusNotFoundException class.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
LocusNotFoundException(const char *text, size_t id)
Build the exception with a numerical identifier.