bpp-popgen3  3.0.0
GeneralExceptions.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef _GENERALEXCEPTIONS_H_
6 #define _GENERALEXCEPTIONS_H_
7 
8 // From STL
9 #include <string>
10 
11 #include <Bpp/Exceptions.h>
12 
13 namespace bpp
14 {
15 // ****************************************************************************
16 //
27  public Exception
28 {
29 public:
30  // Class constructor
34  BadIdentifierException(const char* text, size_t id);
38  BadIdentifierException(const std::string& text, size_t id);
39 
43  BadIdentifierException(const char* text, const std::string& id);
47  BadIdentifierException(const std::string& text, const std::string& id);
48 
49  // Class destructor
50  ~BadIdentifierException() throw ();
51 
52 public:
56  virtual const std::string getIdentifier() const;
57 
58 protected:
59  const std::string id_;
60 };
61 
62 // *****************************************************************************
63 
69 {
70 public:
71  // Class constructor
75  LocusNotFoundException(const char* text, size_t id);
76 
80  LocusNotFoundException(const std::string& text, size_t id);
81 
85  LocusNotFoundException(const char* text, const std::string& id);
86 
90  LocusNotFoundException(const std::string& text, const std::string& id);
91 
92  // Class destructor
93  ~LocusNotFoundException() throw ();
94 
95 public:
99  virtual const std::string getIdentifier() const;
100 };
101 
102 // *****************************************************************************
103 
109 {
110 public:
111  // Class constructor
115  AlleleNotFoundException(const char* text, size_t id);
116 
120  AlleleNotFoundException(const std::string& text, size_t id);
121 
125  AlleleNotFoundException(const char* text, const std::string& id);
126 
130  AlleleNotFoundException(const std::string& text, const std::string& id);
131 
132  // Class destructor
133  ~AlleleNotFoundException() throw ();
134 
135 public:
139  virtual const std::string getIdentifier() const;
140 };
141 
142 // *****************************************************************************
143 
149 {
150 public:
151  // Class constructor
155  LocalityNotFoundException(const char* text, size_t id);
156 
160  LocalityNotFoundException(const std::string& text, size_t id);
161 
165  LocalityNotFoundException(const char* text, const std::string& id);
166 
170  LocalityNotFoundException(const std::string& text, const std::string& id);
171 
172  // Class destructor
173  ~LocalityNotFoundException() throw ();
174 
175 public:
179  virtual const std::string getIdentifier() const;
180 };
181 
182 // *****************************************************************************
183 
189 {
190 public:
191  // Class constructor
195  IndividualNotFoundException(const char* text, size_t id);
196 
200  IndividualNotFoundException(const std::string& text, size_t id);
201 
205  IndividualNotFoundException(const char* text, const std::string& id);
206 
210  IndividualNotFoundException(const std::string& text, const std::string& id);
211 
212  // Class destructor
213  ~IndividualNotFoundException() throw ();
214 
215 public:
219  virtual const std::string getIdentifier() const;
220 };
221 
222 // *****************************************************************************
223 
229 {
230 public:
231  // Class constructor
235  GroupNotFoundException(const char* text, size_t id);
236 
240  GroupNotFoundException(const std::string& text, size_t id);
241 
245  GroupNotFoundException(const char* text, const std::string& id);
246 
250  GroupNotFoundException(const std::string& text, const std::string& id);
251 
252  // Class destructor
253  ~GroupNotFoundException() throw ();
254 
255 public:
259  virtual const std::string getIdentifier() const;
260 };
261 } // end of namespace bpp;
262 
263 #endif // _GENERALEXCEPTIONS_H_
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.