bpp-popgen3  3.0.0
GeneralExceptions.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #include "GeneralExceptions.h"
6 
7 #include <Bpp/Text/TextTools.h>
8 
9 using namespace bpp;
10 using namespace std;
11 
12 // ** BadIdentifierException **************************************************/
13 
15  const size_t id) : Exception("BadIdentifierException: " +
16  string(text) + "(" + TextTools::toString(id) + ")"),
17  id_(TextTools::toString(id)) {}
18 
20  const size_t id) : Exception("BadIdentifierException: " +
21  text + "(" + TextTools::toString(id) + ")"),
22  id_(TextTools::toString(id)) {}
23 
25  const std::string& id) : Exception("BadIdentifierException: " + string(text) +
26  "(" + id + ")"),
27  id_(id) {}
28 
30  const std::string& id) : Exception("BadIdentifierException: " + text +
31  "(" + id + ")"),
32  id_(id) {}
33 
35 
36 const std::string BadIdentifierException::getIdentifier() const
37 {
38  return id_;
39 }
40 
41 // ** LocusNotFoundException **************************************************/
42 
44  const size_t id) : BadIdentifierException("LocusNotFoundException: " +
45  string(text) + "(" + TextTools::toString(id) + ")",
46  id) {}
47 
49  const size_t id) : BadIdentifierException("LocusNotFoundException: " +
50  text + "(" + TextTools::toString(id) + ")",
51  id) {}
52 
54  const std::string& id) : BadIdentifierException("LocusNotFoundException: " + string(text) +
55  "(" + id + ")",
56  id) {}
57 
59  const std::string& id) : BadIdentifierException("LocusNotFoundException: " + text +
60  "(" + id + ")",
61  id) {}
62 
64 
65 const std::string LocusNotFoundException::getIdentifier() const
66 {
68 }
69 
70 // ** AlleleNotFoundException **************************************************/
71 
73  const size_t id) : BadIdentifierException("AlleleNotFoundException: " +
74  string(text) + "(" + TextTools::toString(id) + ")",
75  id) {}
76 
78  const size_t id) : BadIdentifierException("AlleleNotFoundException: " +
79  text + "(" + TextTools::toString(id) + ")",
80  id) {}
81 
83  const std::string& id) : BadIdentifierException("AlleleNotFoundException: " + string(text) +
84  "(" + id + ")",
85  id) {}
86 
88  const std::string& id) : BadIdentifierException("AlleleNotFoundException: " + text +
89  "(" + id + ")",
90  id) {}
91 
93 
94 const std::string AlleleNotFoundException::getIdentifier() const
95 {
97 }
98 
99 // ** LocalityNotFoundException **************************************************/
100 
102  const size_t id) : BadIdentifierException("LocalityNotFoundException: " +
103  string(text) + "(" + TextTools::toString(id) + ")",
104  id) {}
105 
107  const size_t id) : BadIdentifierException("LocalityNotFoundException: " +
108  text + "(" + TextTools::toString(id) + ")",
109  id) {}
110 
112  const std::string& id) : BadIdentifierException("LocalityNotFoundException: " + string(text) +
113  "(" + id + ")",
114  id) {}
115 
117  const std::string& id) : BadIdentifierException("LocalityNotFoundException: " + text +
118  "(" + id + ")",
119  id) {}
120 
122 
124 {
126 }
127 
128 // ** IndividualNotFoundException **************************************************/
129 
131  const size_t id) : BadIdentifierException("IndividualNotFoundException: " +
132  string(text) + "(" + TextTools::toString(id) + ")",
133  id) {}
134 
136  const size_t id) : BadIdentifierException("IndividualNotFoundException: " +
137  text + "(" + TextTools::toString(id) + ")",
138  id) {}
139 
141  const std::string& id) : BadIdentifierException("IndividualNotFoundException: " + string(text) +
142  "(" + id + ")",
143  id) {}
144 
146  const std::string& id) : BadIdentifierException("IndividualNotFoundException: " + text +
147  "(" + id + ")",
148  id) {}
149 
151 
153 {
155 }
156 
157 // ** GroupNotFoundException **************************************************/
158 
160  const size_t id) : BadIdentifierException("GroupNotFoundException: " +
161  string(text) + "(" + TextTools::toString(id) + ")",
162  id) {}
163 
165  const size_t id) : BadIdentifierException("GroupNotFoundException: " +
166  text + "(" + TextTools::toString(id) + ")",
167  id) {}
168 
170  const std::string& id) : BadIdentifierException("GroupNotFoundException: " + string(text) +
171  "(" + id + ")",
172  id) {}
173 
175  const std::string& id) : BadIdentifierException("GroupNotFoundException: " + text +
176  "(" + id + ")",
177  id) {}
178 
180 
181 const std::string GroupNotFoundException::getIdentifier() const
182 {
184 }
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.
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.
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.
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.
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.
std::string toString(T t)