1 // $Id: gc_structures_err.cpp,v 1.12 2011/12/01 22:32:42 jmcgill Exp $
2 
3 /*
4   Copyright 2002  Mary Kuhner, Jon Yamato, and Joseph Felsenstein
5 
6   This software is distributed free of charge for non-commercial use
7   and is copyrighted.  Of course, we do not guarantee that the software
8   works, and are not responsible for any damage you may cause or have.
9 */
10 
11 #include "gc_structures_err.h"
12 #include "gc_strings.h" // EWFIX.P4 refactor out
13 #include "gc_strings_structures.h"
14 
gc_structures_err(const wxString & wh)15 gc_structures_err::gc_structures_err(const wxString & wh) throw()
16     :   gc_data_error(wh)
17 {
18 }
19 
~gc_structures_err()20 gc_structures_err::~gc_structures_err() throw() {};
21 
22 //------------------------------------------------------------------------------------
23 
duplicate_file_base_name_error(const wxString & wh)24 duplicate_file_base_name_error::duplicate_file_base_name_error(const wxString & wh) throw()
25     : gc_structures_err(wxString::Format(gcerr_structures::duplicateFileBaseName,wh.c_str()))
26 {
27 }
28 
~duplicate_file_base_name_error()29 duplicate_file_base_name_error::~duplicate_file_base_name_error() throw() {};
30 
duplicate_file_error(const wxString & wh)31 duplicate_file_error::duplicate_file_error(const wxString & wh) throw()
32     : gc_structures_err(wxString::Format(gcerr_structures::duplicateFileName,wh.c_str()))
33 {
34 }
35 
~duplicate_file_error()36 duplicate_file_error::~duplicate_file_error() throw() {};
37 
duplicate_name_error(const wxString & name,const wxString & where)38 duplicate_name_error::duplicate_name_error(const wxString& name, const wxString & where) throw()
39     : gc_structures_err(wxString::Format(gcerr_structures::duplicateName,name.c_str(),where.c_str()))
40 {
41 }
42 
~duplicate_name_error()43 duplicate_name_error::~duplicate_name_error() throw() {};
44 
empty_name_error(const wxString & where)45 empty_name_error::empty_name_error(const wxString& where) throw()
46     : gc_structures_err(wxString::Format(gcerr::emptyName,where.c_str()))
47 {
48 }
49 
~empty_name_error()50 empty_name_error::~empty_name_error() throw() {};
51 
incompatible_pops(const wxString & wh)52 incompatible_pops::incompatible_pops(const wxString& wh) throw()
53     : gc_structures_err(wh)
54 {
55 }
56 
~incompatible_pops()57 incompatible_pops::~incompatible_pops() throw() {};
58 
missing_file_error(const wxString & wh)59 missing_file_error::missing_file_error(const wxString & wh) throw()
60     : gc_structures_err(wxString::Format(gcerr_structures::missingFile,wh.c_str()))
61 {
62 }
63 
~missing_file_error()64 missing_file_error::~missing_file_error() throw() {};
65 
missing_name_error(const wxString & name,const wxString & where)66 missing_name_error::missing_name_error(const wxString& name, const wxString & where) throw()
67     : gc_structures_err(wxString::Format(gcerr_structures::missingName,name.c_str(),where.c_str()))
68 {
69 }
70 
missing_migration(const wxString & migrationName)71 missing_migration::missing_migration(const wxString & migrationName) throw()
72     : gc_structures_err(wxString::Format(gcerr_structures::missingMigration,migrationName.c_str()))
73 {
74 }
75 
missing_migration(const wxString & fromName,const wxString & toName)76 missing_migration::missing_migration(const wxString & fromName, const wxString & toName) throw()
77     : gc_structures_err(wxString::Format(gcerr_structures::migrationNotDefined, fromName.c_str(), toName.c_str()))
78 {
79 }
80 
~missing_migration()81 missing_migration::~missing_migration() throw() {};
82 
missing_migration_id(const wxString & idString)83 missing_migration_id::missing_migration_id(const wxString & idString) throw()
84     : gc_structures_err(wxString::Format(gcerr_structures::missingMigrationId,idString.c_str()))
85 {
86 }
87 
~missing_migration_id()88 missing_migration_id::~missing_migration_id() throw() {};
89 
~missing_name_error()90 missing_name_error::~missing_name_error() throw() {};
91 
unparsable_file_error(const wxString & wh)92 unparsable_file_error::unparsable_file_error(const wxString & wh) throw()
93     : gc_structures_err((wxString::Format(gcerr_structures::unparsableFile,wh.c_str())))
94 {
95 }
96 
~unparsable_file_error()97 unparsable_file_error::~unparsable_file_error() throw() {};
98 
gc_missing_population(const wxString & popName)99 gc_missing_population::gc_missing_population(const wxString & popName) throw()
100     : gc_structures_err(wxString::Format(gcerr_structures::missingPopulation,popName.c_str()))
101 {
102 }
103 
~gc_missing_population()104 gc_missing_population::~gc_missing_population() throw() {};
105 
missing_panel(const wxString & panelName)106 missing_panel::missing_panel(const wxString & panelName) throw()
107     : gc_structures_err(wxString::Format(gcerr_structures::missingPanel,panelName.c_str()))
108 {
109 }
110 
missing_panel(const wxString & regionName,const wxString & popName)111 missing_panel::missing_panel(const wxString & regionName, const wxString & popName) throw()
112     : gc_structures_err(wxString::Format(gcerr_structures::panelNotDefined,regionName.c_str(), popName.c_str()))
113 {
114 }
115 
~missing_panel()116 missing_panel::~missing_panel() throw() {};
117 
missing_panel_id(const wxString & idString)118 missing_panel_id::missing_panel_id(const wxString & idString) throw()
119     : gc_structures_err(wxString::Format(gcerr_structures::missingPanelId,idString.c_str()))
120 {
121 }
122 
~missing_panel_id()123 missing_panel_id::~missing_panel_id() throw() {};
124 
panel_size_clash(const wxString & popName,const wxString & region1Name,const wxString & region2Name)125 panel_size_clash::panel_size_clash(const wxString & popName, const wxString & region1Name, const wxString & region2Name) throw()
126     : gc_structures_err(wxString::Format(gcerr_structures::panelSizeClash, popName.c_str(), region1Name.c_str(), region2Name.c_str()))
127 {
128 }
129 
~panel_size_clash()130 panel_size_clash::~panel_size_clash() throw() {};
131 
panel_blessed_error(const wxString & regionName,const wxString & popName)132 panel_blessed_error::panel_blessed_error(const wxString & regionName, const wxString & popName) throw()
133     : gc_structures_err(wxString::Format(gcerr_structures::panelBlessedError,regionName.c_str(), popName.c_str()))
134 {
135 }
136 
~panel_blessed_error()137 panel_blessed_error::~panel_blessed_error() throw() {};
138 
missing_region(const wxString & regName)139 missing_region::missing_region(const wxString & regName) throw()
140     : gc_structures_err(wxString::Format(gcerr_structures::missingRegion,regName.c_str()))
141 {
142 }
143 
missing_parent(const wxString & parentName)144 missing_parent::missing_parent(const wxString & parentName) throw()
145     : gc_structures_err(wxString::Format(gcerr_structures::missingParent,parentName.c_str()))
146 {
147 }
148 
~missing_parent()149 missing_parent::~missing_parent() throw() {};
150 
missing_parent_id(const wxString & idString)151 missing_parent_id::missing_parent_id(const wxString & idString) throw()
152     : gc_structures_err(wxString::Format(gcerr_structures::missingParentId,idString.c_str()))
153 {
154 }
155 
~missing_parent_id()156 missing_parent_id::~missing_parent_id() throw() {};
157 
~missing_region()158 missing_region::~missing_region() throw() {};
159 
missing_trait(const wxString & traitName)160 missing_trait::missing_trait(const wxString & traitName) throw()
161     : gc_structures_err(wxString::Format(gcerr_structures::missingTrait,traitName.c_str()))
162 {
163 }
164 
~missing_trait()165 missing_trait::~missing_trait() throw() {};
166 
effective_pop_size_clash(double size1,double size2)167 effective_pop_size_clash::effective_pop_size_clash(double size1, double size2) throw()
168     :   gc_structures_err(wxString::Format(gcerr_structures::regionEffPopSizeClash,size1,size2))
169 {
170 }
171 
~effective_pop_size_clash()172 effective_pop_size_clash::~effective_pop_size_clash() throw() {};
173 
gc_name_repeat_allele(wxString & name,int row1,int row2)174 gc_name_repeat_allele::gc_name_repeat_allele(wxString & name, int row1, int row2) throw()
175     :   gc_structures_err(wxString::Format(gcerr_structures::nameRepeatAllele,name.c_str(),row1))
176 {
177     setRow(row2);
178 }
179 
~gc_name_repeat_allele()180 gc_name_repeat_allele::~gc_name_repeat_allele() throw() {};
181 
gc_name_repeat_locus(wxString & name,int row1,int row2)182 gc_name_repeat_locus::gc_name_repeat_locus(wxString & name, int row1, int row2) throw()
183     :   gc_structures_err(wxString::Format(gcerr_structures::nameRepeatLocus,name.c_str(),row1))
184 {
185     setRow(row2);
186 }
187 
~gc_name_repeat_locus()188 gc_name_repeat_locus::~gc_name_repeat_locus() throw() {};
189 
gc_name_repeat_pop(wxString & name,int row1,int row2)190 gc_name_repeat_pop::gc_name_repeat_pop(wxString & name, int row1, int row2) throw()
191     :   gc_structures_err(wxString::Format(gcerr_structures::nameRepeatPop,name.c_str(),row1))
192 {
193     setRow(row2);
194 }
195 
~gc_name_repeat_pop()196 gc_name_repeat_pop::~gc_name_repeat_pop() throw() {};
197 
gc_name_repeat_region(wxString & name,int row1,int row2)198 gc_name_repeat_region::gc_name_repeat_region(wxString & name, int row1, int row2) throw()
199     :   gc_structures_err(wxString::Format(gcerr_structures::nameRepeatRegion,name.c_str(),row1))
200 {
201     setRow(row2);
202 }
203 
~gc_name_repeat_region()204 gc_name_repeat_region::~gc_name_repeat_region() throw() {};
205 
gc_name_repeat_trait(wxString & name,int row1,int row2)206 gc_name_repeat_trait::gc_name_repeat_trait(wxString & name, int row1, int row2) throw()
207     :   gc_structures_err(wxString::Format(gcerr_structures::nameRepeatTrait,name.c_str(),row1))
208 {
209     setRow(row2);
210 }
211 
~gc_name_repeat_trait()212 gc_name_repeat_trait::~gc_name_repeat_trait() throw() {};
213 
gc_allele_trait_mismatch(wxString name,wxString newTraitName,wxString oldTraitName)214 gc_allele_trait_mismatch::gc_allele_trait_mismatch(wxString name, wxString newTraitName, wxString oldTraitName) throw()
215     :   gc_structures_err(wxString::Format(gcerr_structures::mismatchAlleleTrait,name.c_str(),newTraitName.c_str(),oldTraitName.c_str()))
216 {
217 }
218 
~gc_allele_trait_mismatch()219 gc_allele_trait_mismatch::~gc_allele_trait_mismatch() throw() {};
220 
gc_locus_region_mismatch(wxString name,wxString newRegionName,wxString oldRegionName)221 gc_locus_region_mismatch::gc_locus_region_mismatch(wxString name, wxString newRegionName, wxString oldRegionName) throw()
222     :   gc_structures_err(wxString::Format(gcerr_structures::mismatchLocusRegion,name.c_str(),newRegionName.c_str(),oldRegionName.c_str()))
223 {
224 }
225 
~gc_locus_region_mismatch()226 gc_locus_region_mismatch::~gc_locus_region_mismatch() throw() {};
227 
228 
gc_wrong_divergence_error()229 gc_wrong_divergence_error::gc_wrong_divergence_error() throw()
230     :   gc_structures_err(gcerr::wrongDivergenceCount)
231 {
232 }
233 
~gc_wrong_divergence_error()234 gc_wrong_divergence_error::~gc_wrong_divergence_error() throw() {};
235 
236 
gc_divergence_bad_id_error(wxString parent,wxString child)237 gc_divergence_bad_id_error::gc_divergence_bad_id_error(wxString parent, wxString child) throw()
238     :   gc_structures_err(wxString::Format(gcerr::badDivergenceId,parent.c_str(), child.c_str()))
239 {
240 }
241 
~gc_divergence_bad_id_error()242 gc_divergence_bad_id_error::~gc_divergence_bad_id_error() throw() {};
243 
gc_rate_too_small_error()244 gc_rate_too_small_error::gc_rate_too_small_error() throw()
245     :   gc_structures_err(gcerr::migrationRateTooSmall)
246 {
247 }
248 
~gc_rate_too_small_error()249 gc_rate_too_small_error::~gc_rate_too_small_error() throw() {};
250 
gc_bad_name_error(wxString name)251 gc_bad_name_error::gc_bad_name_error(wxString name) throw()
252     :   gc_structures_err(wxString::Format(gcerr::badName, name.c_str()))
253 {
254 }
255 
~gc_bad_name_error()256 gc_bad_name_error::~gc_bad_name_error() throw() {};
257 
258 //____________________________________________________________________________________
259