1 /**
2  * @file    SBMLError.h
3  * @brief   Represents SBML errors and other diagnostics
4  * @author  Michael Hucka
5  * @author  Sarah Keating
6  *
7  * <!--------------------------------------------------------------------------
8  * This file is part of libSBML.  Please visit http://sbml.org for more
9  * information about SBML, and the latest version of libSBML.
10  *
11  * Copyright (C) 2020 jointly by the following organizations:
12  *     1. California Institute of Technology, Pasadena, CA, USA
13  *     2. University of Heidelberg, Heidelberg, Germany
14  *     3. University College London, London, UK
15  *
16  * Copyright (C) 2019 jointly by the following organizations:
17  *     1. California Institute of Technology, Pasadena, CA, USA
18  *     2. University of Heidelberg, Heidelberg, Germany
19  *
20  * Copyright (C) 2013-2018 jointly by the following organizations:
21  *     1. California Institute of Technology, Pasadena, CA, USA
22  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
23  *     3. University of Heidelberg, Heidelberg, Germany
24  *
25  * Copyright (C) 2009-2013 jointly by the following organizations:
26  *     1. California Institute of Technology, Pasadena, CA, USA
27  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
28  *
29  * Copyright (C) 2006-2008 by the California Institute of Technology,
30  *     Pasadena, CA, USA
31  *
32  * Copyright (C) 2002-2005 jointly by the following organizations:
33  *     1. California Institute of Technology, Pasadena, CA, USA
34  *     2. Japan Science and Technology Agency, Japan
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the GNU Lesser General Public License as published by
38  * the Free Software Foundation.  A copy of the license agreement is provided
39  * in the file named "LICENSE.txt" included with this software distribution
40  * and also available online as http://sbml.org/software/libsbml/license.html
41  * ------------------------------------------------------------------------ -->
42  *
43  * @class SBMLError
44  * @sbmlbrief{core} An error, warning or other diagnostic.
45  *
46  * @htmlinclude not-sbml-warning.html
47  *
48  * When a libSBML operation on SBML content results in an error, or when
49  * there is something wrong with the SBML content, the problems are
50  * reported as SBMLError objects.  These are generally stored in an
51  * SBMLErrorLog object; this log object, in turn, is kept in the
52  * SBMLDocument object containing the SBML content.  Applications can
53  * obtain the list of logged errors using SBMLDocument::getErrorLog() and
54  * then use the methods provided by SBMLErrorLog to access individual
55  * SBMLError objects.  (Note that despite the word "error" in the name,
56  * SBMLError objects are used to represent not only "true" errors, but also
57  * warnings and some informational diagnostics.  The name is a historical
58  * hold-over from early versions of libSBML, in which the object really was
59  * only used to report errors.)
60  *
61  * @if clike
62  * Each SBMLError object instance has an identification number that
63  * identifies the nature of the problem.  This "error id" number will be up
64  * to five digits long, and it will be listed in one of two enumerations:
65  * <a class="el" href="#SBMLErrorCode_t"> SBMLErrorCode_t</a> (described <a
66  * class="el" href="#SBMLErrorCode_t"> below</a>) or @link
67  * XMLError::XMLErrorCode_t XMLErrorCode_t@endlink (described in the
68  * documentation for the class XMLError).  The former enumeration contains
69  * all the SBML validation rule numbers listed in the appendices of the
70  * SBML specification documents, as well as some additional
71  * libSBML-specific error codes.
72  * @endif@if java
73  * Each SBMLError object instance has an identification number that
74  * identifies the nature of the problem.  This "error id" number will be up
75  * to five digits long, and it will come from one of two sets of static
76  * integer constants defined in the interface class <code><a
77  * href="libsbmlConstants.html"> libsbmlConstants</a></code>: either the
78  * SBML error identifiers <a class="el" href="#SBMLErrorCode_t"> (described
79  * below)</a> or the XML error identifiers (described in the documentation
80  * for the class <code><a href="XMLError.html"> XMLError</a></code>).  The
81  * former set of constants includes all the SBML validation rule numbers
82  * listed in the appendices of the SBML specification documents, as well as
83  * some additional libSBML-specific error codes.
84  * @endif@if python
85  * Each SBMLError object instance has an identification number that
86  * identifies the nature of the problem.  This "error id" number will be up
87  * to five digits long, and it will come from one
88  * of two sets of static integer constants defined in
89  * the interface class @link libsbml libsbml@endlink: either the SBML
90  * error identifiers <a
91  * class="el" href="#SBMLErrorCode_t"> (described below)</a> or the XML
92  * error identifiers (described in the documentation for the class XMLError).
93  * The former set of constants
94  * includes all the SBML validation rule numbers listed in the appendices
95  * of the SBML specification documents, as well as some additional
96  * libSBML-specific error codes.
97  * @endif@~
98  *
99  * Error codes are useful mainly for software.  For human readers,
100  * SBMLError also includes text messages that describe the nature of a
101  * given problem.  The messages can be accessed using
102  * SBMLError::getShortMessage() and SBMLError::getMessage().  The former
103  * provides a brief one-line description of the issue, while
104  * SBMLError::getMessage() provides a more detailed text, including (if
105  * appropriate) references to sections of the SBML specifications where
106  * relevant topics are discussed.  These text strings are suitable for
107  * displaying to human users.
108  *
109  * @if clike
110  * An SBMLError object also contains a category code; its value may be
111  * retrieved using the method SBMLError::getCategory().  Category values
112  * are drawn from the enumeration <a class="el"
113  * href="#SBMLErrorCategory_t">SBMLErrorCategory_t</a> described below.
114  * Categories are used to partition errors into distinct conceptual groups.
115  * This is principally used by the libSBML validation system to group
116  * classes of validation checks.  For example,
117  * @sbmlconstant{LIBSBML_CAT_IDENTIFIER_CONSISTENCY, SBMLErrorCategory_t}
118  * is the category for tests that check identifier consistency;
119  * @sbmlconstant{LIBSBML_CAT_MATHML_CONSISTENCY, SBMLErrorCategory_t}
120  * is the category for MathML consistency checking; and
121  * so on.
122  * @endif@if java
123  * An SBMLError object also contains a category code; its value may be
124  * retrieved using the method SBMLError::getCategory().  Category values
125  * are drawn from a set of static integer constants
126  * defined in <code><a href="libsbmlConstants.html">libsbmlConstants</a></code>,
127  * and having names beginning with the characters
128  * <code>LIBSBML_CAT_</code>.  The list of possible codes is described in a
129  * separate section below.  Categories are used to partition errors into
130  * distinct conceptual groups.  This is principally used by the libSBML
131  * validation system to group classes of validation checks.  For example,
132  * @sbmlconstant{LIBSBML_CAT_IDENTIFIER_CONSISTENCY, SBMLErrorCategory_t}
133  * is the category for tests that check identifier consistency;
134  * @sbmlconstant{LIBSBML_CAT_MATHML_CONSISTENCY, SBMLErrorCategory_t}
135  * is the category for MathML consistency checking; and
136  * so on.
137  * @endif@if python
138  * An SBMLError object also contains a category code; its value may be
139  * retrieved using the method SBMLError::getCategory().  Category values
140  * are drawn from a set of static integer constants
141  * defined in @link libsbml libsbml@endlink and having names beginning with the characters
142  * <code>LIBSBML_CAT_</code>.  The list of possible codes is described in a
143  * separate section below.  Categories are used to partition errors into
144  * distinct conceptual groups.  This is principally used by the libSBML
145  * validation system to group classes of validation checks.  For example,
146  * @sbmlconstant{LIBSBML_CAT_IDENTIFIER_CONSISTENCY, SBMLErrorCategory_t}
147  * is the category for tests that check identifier consistency;
148  * @sbmlconstant{LIBSBML_CAT_MATHML_CONSISTENCY, SBMLErrorCategory_t}
149  * is the category for MathML consistency checking; and
150  * so on.
151  * @endif@~
152  *
153  * In addition, SBMLError also has a severity code.  Its value may be
154  * retrieved using the method SBMLError::getSeverity().  The possible
155  * severity values are the same as those reported by @if clike XMLError.@endif@if python XMLError.@endif@if java <code><a href="XMLError.html">XMLError</a></code>.@endif@~
156  * Severity levels currently range from informational
157  * (@sbmlconstant{LIBSBML_SEV_INFO, XMLErrorSeverity_t})
158  * to fatal errors
159  * (@sbmlconstant{LIBSBML_SEV_FATAL, XMLErrorSeverity_t}).
160  * They can be
161  * used by an application to evaluate how serious a given problem
162  * is.
163  *
164  * SBMLError also tracks the Level&nbsp;3 package extension, if any, was
165  * responsible for a given warning or error.  Each diagnostic code logged by
166  * an libSBML extension for SBML Level&nbsp;3 packages includes a record of
167  * the package that logged it.  It can be retrieved using
168  * SBMLError::getPackage().  The information is a simple text string; the
169  * string will be the nickname of the package, such as @c "comp" for the
170  * Hierarchical %Model Composition package, @c "fbc" for the Flux Balance
171  * Constraints package, and so on.  If the value returned by
172  * SBMLError::getPackage() is an empty string or has the value @c "core",
173  * then the error came from libSBML core.
174  *
175  * Finally, SBMLError records the line and column near where the problem
176  * occurred in the SBML content.  The values may be retrieved using the
177  * methods SBMLError::getLine() and SBMLError::getColumn().  We say "near",
178  * because a lot of factors affect how accurate the line/column information
179  * ultimately is.  For example, different XML parsers have different
180  * conventions for which line and column number they report for a
181  * particular problem (which makes a difference when a problem involves an
182  * opening XML tag on one line and a closing tag on another line).  In some
183  * situations, some parsers report invalid line and/or column numbers
184  * altogether.  If this occurs, libSBML sets the line and/or column number
185  * in the SBMLError object to the the value of the maximum unsigned long
186  * integer representable on the platform where libSBML is running.  (This
187  * is equal to the constant named <code>ULONG_MAX</code> in C and C++.)
188  * The probability that a true line or column number in an SBML model would
189  * equal this value is vanishingly small; thus, if an application
190  * encounters these values in an XMLError object, it can assume no valid
191  * line/column number could be provided by libSBML in that situation.
192  *
193  * @if clike
194  * <h3><a class="anchor" name="SBMLErrorCode_t">SBMLErrorCode_t</a></h3>
195  *
196  * #SBMLErrorCode_t is an enumeration of all SBML-level error, warning and
197  * informational diagnostic codes.  Every SBMLError object has an error
198  * code value that can be either a value from this enumeration, or a value
199  * from the #XMLErrorCode_t
200  * enumeration (see the documentation for XMLError).  The latter values
201  * apply when the error or warning signifies a basic XML issue rather than
202  * an SBML issue per se.  The values of #SBMLErrorCode_t are distinguished
203  * from those of #XMLErrorCode_t by
204  * being numbered 10000 and higher, while the XML layer's codes are 9999 and
205  * lower.  The method SBMLError::getErrorId() returns the error code of a
206  * given SBMLError object instance.
207  *
208  * The following is a table of the symbolic names of #SBMLErrorCode_t values
209  * and the meaning of each code.  In this table, the right-hand columns
210  * titled "L1V1", "L1V2", etc. refer to Levels and Versions of the SBML
211  * specifications, and the entries in each column refer to whether the
212  * severity of the condition in that particular Level+Version of SBML.
213  * The codes stand for the following:
214  *
215  * @endif@if java <h3><a class="anchor"
216  * name="SBMLErrorCode_t">Error codes associated with SBMLError objects</a></h3>
217  *
218  * The error and warning codes returned by libSBML are listed in the table
219  * below.  The method SBMLError::getErrorId() returns the error code of a
220  * given SBMLError object instance.  In the libSBML Java language
221  * interface, these error identifiers are currently
222  * implemented as static integer constants defined in the interface class
223  * <code><a href="libsbmlConstants.html">libsbmlConstants</a></code>.  This
224  * is admittedly not an ideal approach from the standpoint of modern Java
225  * programming, but it was necessary to work around the lack of
226  * enumerations in Java prior to JDK 1.5.  Future versions of libSBML may
227  * use a proper Java enumeration type to define the error identifiers.
228  *
229  * In this table, the right-hand columns titled "L1V1", "L1V2", etc. refer
230  * to Levels and Versions of the SBML specifications, and the entries in
231  * each column refer to whether the severity of the condition in that
232  * particular Level+Version of SBML.  The codes stand for the following:
233  *
234  * @endif@if python <h3><a class="anchor"
235  * name="SBMLErrorCode_t">Error codes associated with SBMLError objects</a></h3>
236  *
237  * The error and warning codes returned by libSBML are listed in the table
238  * below.  The method SBMLError::getErrorId() returns the error code of a
239  * given SBMLError object instance.  In the libSBML Python language
240  * interface, these error identifiers are currently
241  * implemented as static integer constants defined in the interface class
242  * @link libsbml libsbml@endlink.
243  *
244  * In this table, the right-hand columns titled "L1V1", "L1V2", etc. refer
245  * to Levels and Versions of the SBML specifications, and the entries in
246  * each column refer to whether the severity of the condition in that
247  * particular Level+Version of SBML.  The codes stand for the following:
248  *
249  * @endif@~
250  *
251  * <table cellspacing="1" cellpadding="2" border="0" class="normal-font">
252  * <tr><td class="s-na"></td><td>= Not applicable</td></tr>
253  * <tr><td class="s-warning"></td><td>= Warning</td></tr>
254  * <tr><td class="s-error"></td><td>= Error</td></tr>
255  * <tr><td class="s-fatal"></td><td>= Fatal</td></tr>
256  * </table>
257  *
258  * The text shown in the "Meaning" is the text returned by the
259  * SBMLError::getShortMessage() method on a given SBMLError object.  A
260  * longer and (hopefully) clearer explanation of the issue is returned by
261  * SBMLError::getMessage().
262  *
263  * The error codes come from different lists depending on whether they're
264  * from libSBML core or from an SBML Level&nbsp;3 package extension.
265  * @if clike The errors below come from #XMLErrorCode_t and #SBMLErrorCode_t
266  * (for core), and #CompSBMLErrorCode_t, #FbcSBMLErrorCode_t,
267  * #LayoutSBMLErrorCode_t, and #QualSBMLErrorCode_t (for packages).@endif
268  * @ifnot clike However, in the language interfaces other than C++, all
269  * libSBML error codes are ultimately represented as integer constants rather
270  * than separate enumerations lists, and they are all stored in a single
271  * interface class.  Codes from different libSBML extensions have names that
272  * begin with the package's nickname, such as <code>Qual</code> for
273  * the Qualitative Models package, <code>Layout</code> for the Layout
274  * package, and so on.  If the name of a code does not begin with one of
275  * the package nicknames (<code>%Layout</code>, <code>Fbc</code>,
276  * <code>Comp</code>, <code>Qual</code>, etc.), then it is a code
277  * from libSBML core.@endif
278  *
279  * @copydetails doc_sbml_error_table
280  *
281  * @if clike <h3><a class="anchor" name="SBMLErrorCategory_t">SBMLErrorCategory_t</a></h3>
282  *
283  * #SBMLErrorCategory_t is an enumeration of category codes for SBMLError
284  * diagnostics.  The category can be retrieved from an SBMLError object
285  * using the method SBMLError::getCategory().  These enumeration values are
286  * distinct from (and in addition to) the
287  * #XMLErrorCategory_t codes used by
288  * the parent XMLError object.  User programs receiving an SBMLError object
289  * can use this distinction to check whether the error represents a
290  * low-level XML problem or an SBML problem.
291  *
292  * The following table lists each possible value and a brief description of
293  * its meaning.
294  *
295  * @endif@if python <h3><a class="anchor" name="SBMLErrorCategory_t">Category codes associated with SBMLError objects</a></h3>
296  *
297  * As discussed above, each SBMLError object contains a value for a
298  * category identifier, describing the type of issue that the SBMLError
299  * object represents.  The category can be retrieved from an SBMLError
300  * object using the method SBMLError::getCategory().  The following table
301  * lists each possible value and a brief description of its meaning.
302  *
303  * As is the case with the error codes, in the libSBML Python language
304  * interface, the category identifiers are currently implemented as static
305  * integer constants defined in the interface class
306  * @link libsbml libsbml@endlink.
307  *
308  * The following table lists each possible value and a brief description of
309  * its meaning.
310  *
311  * @endif@if java <h3><a class="anchor"
312  * name="SBMLErrorCategory_t">Category codes associated with SBMLError objects</a></h3>
313  *
314  * As discussed above, each SBMLError object contains a value for a
315  * category identifier, describing the type of issue that the SBMLError
316  * object represents.  The category can be retrieved from an SBMLError
317  * object using the method SBMLError::getCategory().  The following table
318  * lists each possible value and a brief description of its meaning.
319  *
320  * As is the case with the error codes, in the libSBML Java language
321  * interface, the category identifiers are currently implemented as static
322  * integer constants defined in the interface class
323  * {@link libsbmlConstants}.
324  *
325  * The following table lists each possible value and a brief description of
326  * its meaning.
327  *
328  * @endif@if csharp <h3><a class="anchor"
329  * name="SBMLErrorCategory_t">Category codes associated with SBMLError objects</a></h3>
330  *
331  * As discussed above, each SBMLError object contains a value for a
332  * category identifier, describing the type of issue that the SBMLError
333  * object represents.  The category can be retrieved from an SBMLError
334  * object using the method SBMLError::getCategory().  The following table
335  * lists each possible value and a brief description of its meaning.
336  *
337  * As is the case with the error codes, in the libSBML C# language
338  * interface, the category identifiers are currently implemented as static
339  * integer constants defined in the interface class
340  * {@link libsbmlcs.libsbml}.
341  *
342  * The following table lists each possible value and a brief description of
343  * its meaning.
344  *
345  * @endif@~
346  *
347  * <center>
348  * <table width="90%" cellspacing="1" cellpadding="4" border="0"  class="text-table normal-font alt-row-colors">
349  *  <tr style="background: lightgray" class="normal-font">
350  *      <th>Enumerator</td>
351  *      <th>Meaning</td>
352  *  </tr>
353  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML, XMLErrorCategory_t}</td><td>General error not falling into
354  * another category below.</td></tr>
355  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L1_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
356  * that can only occur during attempted translation from one Level/Version
357  * of SBML to another.  This particular category applies to errors
358  * encountered while trying to convert a model from SBML Level&nbsp;2 to SBML
359  * Level&nbsp;1.</td></tr>
360  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L2V1_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
361  * that can only occur during attempted translation from one Level/Version
362  * of SBML to another.  This particular category applies to errors
363  * encountered while trying to convert a model to SBML Level&nbsp;2
364  * Version&nbsp;1.</td></tr>
365  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L2V2_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
366  * that can only occur during attempted translation from one Level/Version
367  * of SBML to another.  This particular category applies to errors
368  * encountered while trying to convert a model to SBML Level&nbsp;2
369  * Version&nbsp;2.</td></tr>
370  * <tr><td>@sbmlconstant{LIBSBML_CAT_GENERAL_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of
371  * errors that can occur while validating general SBML constructs.  With
372  * respect to the SBML specification, these concern failures in applying
373  * the validation rules numbered 2xxxx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
374  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
375  * <tr><td>@sbmlconstant{LIBSBML_CAT_IDENTIFIER_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of
376  * errors that can occur while validating symbol identifiers in a model.
377  * With respect to the SBML specification, these concern failures in
378  * applying the validation rules numbered 103xx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
379  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
380  * <tr><td>@sbmlconstant{LIBSBML_CAT_UNITS_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of
381  * errors that can occur while validating the units of measurement on
382  * quantities in a model.  With respect to the SBML specification, these
383  * concern failures in applying the validation rules numbered 105xx in the
384  * Level&nbsp;2 Versions&nbsp;2&ndash;4
385  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
386  * <tr><td>@sbmlconstant{LIBSBML_CAT_MATHML_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of
387  * errors that can occur while validating MathML formulas in a model.  With
388  * respect to the SBML specification, these concern failures in applying
389  * the validation rules numbered 102xx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
390  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
391  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBO_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of errors
392  * that can occur while validating SBO identifiers in a model.  With
393  * respect to the SBML specification, these concern failures in applying
394  * the validation rules numbered 107xx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
395  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
396  * <tr><td>@sbmlconstant{LIBSBML_CAT_OVERDETERMINED_MODEL, XMLErrorCategory_t}</td><td>Error in the
397  * system of equations in the model: the system is overdetermined,
398  * therefore violating a tenet of proper SBML.  With respect to the SBML
399  * specification, this is validation rule #10601 in the SBML Level&nbsp;2 Versions&nbsp;2&ndash;4
400  * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications.</td></tr>
401  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L2V3_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
402  * that can only occur during attempted translation from one Level/Version
403  * of SBML to another.  This particular category applies to errors
404  * encountered while trying to convert a model to SBML Level&nbsp;2
405  * Version&nbsp;3.</td></tr>
406  * <tr><td>@sbmlconstant{LIBSBML_CAT_MODELING_PRACTICE, XMLErrorCategory_t}</td><td>Category of
407  * warnings about recommended good practices involving SBML and
408  * computational modeling.  (These are tests performed by libSBML and do
409  * not have equivalent SBML validation rules.)</td></tr>
410  * <tr><td>@sbmlconstant{LIBSBML_CAT_INTERNAL_CONSISTENCY, XMLErrorCategory_t}</td><td>Category of
411  * errors that can occur while validating libSBML's internal representation
412  * of SBML constructs. (These are tests performed by libSBML and do
413  * not have equivalent SBML validation rules.)</td></tr>
414  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L2V4_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
415  * that can only occur during attempted translation from one Level/Version
416  * of SBML to another.  This particular category applies to errors
417  * encountered while trying to convert a model to SBML Level&nbsp;2
418  * Version&nbsp;4.</td></tr>
419  * <tr><td>@sbmlconstant{LIBSBML_CAT_SBML_L3V1_COMPAT, XMLErrorCategory_t}</td><td>Category of errors
420  * that can only occur during attempted translation from one Level/Version
421  * of SBML to another.  This particular category applies to errors
422  * encountered while trying to convert a model to SBML Level&nbsp;3
423  * Version&nbsp;1.</td></tr>
424  *
425  * </table>
426  * </center>
427  *
428  * @if clike
429  * <h3><a class="anchor" name="SBMLErrorSeverity_t">SBMLErrorSeverity_t</a></h3>
430  *
431  * This is an enumeration of severity codes for SBMLError diagnostics.
432  * User programs receiving an SBMLError object can use this distinction to
433  * check whether the error represents a low-level XML problem or an SBML
434  * problem.
435  *
436  * In libSBML version @htmlinclude libsbml-version.html
437  * there are no additional severity codes in
438  * #SBMLErrorSeverity_t beyond those defined in #XMLErrorSeverity_t.
439  *
440  * <hr>
441  * @endif@if java <h3><a class="anchor"
442  * name="SBMLErrorSeverity_t">Severity codes associated with SBMLError
443  * objects</h3>
444  *
445  * In libSBML version @htmlinclude libsbml-version.html
446  * there are no additional severity codes beyond those defined by XMLError.
447  * They are implemented as static integer constants defined in the interface
448  * class <code><a href="libsbmlConstants.html">libsbmlConstants</a></code>,
449  * and have names beginning with <code>LIBSBML_SEV_</code>.
450  * @endif@if python <h3><a class="anchor"
451  * name="SBMLErrorSeverity_t">Severity codes associated with SBMLError
452  * objects</h3>
453  *
454  * In libSBML version @htmlinclude libsbml-version.html
455  * there are no additional severity codes beyond those defined by XMLError.
456  * They are implemented as static integer constants defined in the
457  * interface class @link libsbml libsbml@endlink, and have names beginning
458  * with <code>LIBSBML_SEV_</code>.
459  * @endif@~
460  */
461 
462 #ifndef SBMLError_h
463 #define SBMLError_h
464 
465 #include <sbml/common/extern.h>
466 #include <sbml/xml/XMLError.h>
467 #include <sbml/SBMLNamespaces.h>
468 
469 
470 LIBSBML_CPP_NAMESPACE_BEGIN
471 BEGIN_C_DECLS
472 
473 /**
474  * @enum SBMLErrorCode_t
475  * Codes for all SBML-level errors and warnings from the core specification.
476  *
477  * @copydetails doc_sbml_error_code_ranges
478  */
479 typedef enum
480 {
481   UnknownError                          = 10000 /*!< Encountered unknown internal libSBML error. */
482 , NotUTF8                               = 10101 /*!< File does not use UTF-8 encoding. */
483 , UnrecognizedElement                   = 10102 /*!< Encountered unrecognized element. */
484 , NotSchemaConformant                   = 10103 /*!< Document does not conform to the SBML XML schema. */
485 , L3NotSchemaConformant                 = 10104 /*!< Document is not well-formed XML. */
486 , InvalidMathElement                    = 10201 /*!< Invalid MathML. */
487 , DisallowedMathMLSymbol                = 10202 /*!< Disallowed MathML symbol found. */
488 , DisallowedMathMLEncodingUse           = 10203 /*!< Use of the MathML 'encoding' attribute is not allowed on this element. */
489 , DisallowedDefinitionURLUse            = 10204 /*!< Use of the MathML 'definitionURL' attribute is not allowed on this element. */
490 , BadCsymbolDefinitionURLValue          = 10205 /*!< Invalid <code>&lt;csymbol&gt;</code> 'definitionURL' attribute value. */
491 , DisallowedMathTypeAttributeUse        = 10206 /*!< Use of the MathML 'type' attribute is not allowed on this element. */
492 , DisallowedMathTypeAttributeValue      = 10207 /*!< Disallowed MathML 'type' attribute value. */
493 , LambdaOnlyAllowedInFunctionDef        = 10208 /*!< Use of <code>&lt;lambda&gt;</code> not permitted outside of FunctionDefinition objects. */
494 , BooleanOpsNeedBooleanArgs             = 10209 /*!< Non-Boolean argument given to Boolean operator. */
495 , NumericOpsNeedNumericArgs             = 10210 /*!< Non-numerical argument given to numerical operator. */
496 , ArgsToEqNeedSameType                  = 10211 /*!< Arguments to <code>&lt;eq&gt;</code> and <code>&lt;neq&gt;</code> must have the same data types. */
497 , PiecewiseNeedsConsistentTypes         = 10212 /*!< Terms in a <code>&lt;piecewise&gt;</code> expression must have consistent data types. */
498 , PieceNeedsBoolean                     = 10213 /*!< The second argument of a <code>&lt;piece&gt;</code> expression must yield a Boolean value. */
499 , ApplyCiMustBeUserFunction             = 10214 /*!< A <code>&lt;ci&gt;</code> element in this context must refer to a function definition. */
500 , ApplyCiMustBeModelComponent           = 10215 /*!< A <code>&lt;ci&gt;</code> element in this context must refer to a model component. */
501 , KineticLawParametersAreLocalOnly      = 10216 /*!< Cannot use a KineticLaw local parameter outside of its local scope. */
502 , MathResultMustBeNumeric               = 10217 /*!< A formula's result in this context must be a numerical value. */
503 , OpsNeedCorrectNumberOfArgs            = 10218 /*!< Incorrect number of arguments given to MathML operator. */
504 , InvalidNoArgsPassedToFunctionDef      = 10219 /*!< Incorrect number of arguments given to function invocation. */
505 , DisallowedMathUnitsUse                = 10220 /*!< Attribute 'units' is only permitted on <code>&lt;cn&gt;</code> elements. */
506 , InvalidUnitsValue                     = 10221 /*!< Invalid value given for the 'units' attribute. */
507 , CiCannotReference0DCompartment        = 10222 /*!< A <code>&lt;ci&gt;</code> element cannot reference a 0D compartment. */
508 , RateOfTargetMustBeCi                  = 10223 /*!< A 'rateOf' <code>&lt;csymbol&gt;</code> must target only a single <code>&lt;ci&gt;</code> element. */
509 , RateOfTargetCannotBeAssigned          = 10224 /*!< The target of a 'rateOf' <code>&lt;csymbol&gt;</code> cannot be assigned. */
510 , RateOfSpeciesTargetCompartmentNot     = 10225 /*!< Compartments of non-substance <code>&lt;species&gt;</code> referenced by 'rateOf' must not vary. */
511 , DuplicateComponentId                  = 10301 /*!< Duplicate 'id' attribute value. */
512 , DuplicateUnitDefinitionId             = 10302 /*!< Duplicate unit definition 'id' attribute value. */
513 , DuplicateLocalParameterId             = 10303 /*!< Duplicate local parameter 'id' attribute value. */
514 , MultipleAssignmentOrRateRules         = 10304 /*!< Multiple rules for the same variable are not allowed. */
515 , MultipleEventAssignmentsForId         = 10305 /*!< Multiple event assignments for the same variable are not allowed. */
516 , EventAndAssignmentRuleForId           = 10306 /*!< An event assignment and an assignment rule must not have the same value for 'variable'. */
517 , DuplicateMetaId                       = 10307 /*!< Duplicate 'metaid' attribute value. */
518 , InvalidSBOTermSyntax                  = 10308 /*!< Invalid syntax for an 'sboTerm' attribute value. */
519 , InvalidMetaidSyntax                   = 10309 /*!< Invalid syntax for a 'metaid' attribute value. */
520 , InvalidIdSyntax                       = 10310 /*!< Invalid syntax for an 'id' attribute value. */
521 , InvalidUnitIdSyntax                   = 10311 /*!< Invalid syntax for the identifier of a unit. */
522 , InvalidNameSyntax                     = 10312 /*!< Invalid syntax for a 'name' attribute value. */
523 , DanglingUnitReference                 = 10313 /*!< Dangling reference to a unit. */
524 , MissingAnnotationNamespace            = 10401 /*!< Missing declaration of the XML namespace for the annotation. */
525 , DuplicateAnnotationNamespaces         = 10402 /*!< Multiple annotations using the same XML namespace. */
526 , SBMLNamespaceInAnnotation             = 10403 /*!< The SBML XML namespace cannot be used in an Annotation object. */
527 , MultipleAnnotations                   = 10404 /*!< Only one Annotation object is permitted under a given SBML object. */
528 , InconsistentArgUnits                  = 10501 /*!< The units of the function call's arguments are not consistent with its definition. */
529 , InconsistentKineticLawUnitsL3         = 10503 /*!< The kinetic law's units are inconsistent with those of other kinetic laws in the model. */
530 , AssignRuleCompartmentMismatch         = 10511 /*!< Mismatched units in assignment rule for compartment. */
531 , AssignRuleSpeciesMismatch             = 10512 /*!< Mismatched units in assignment rule for species. */
532 , AssignRuleParameterMismatch           = 10513 /*!< Mismatched units in assignment rule for parameter. */
533 , AssignRuleStoichiometryMismatch       = 10514 /*!< Mismatched units in assignment rule for stoichiometry. */
534 , InitAssignCompartmenMismatch          = 10521 /*!< Mismatched units in initial assignment to compartment. */
535 , InitAssignSpeciesMismatch             = 10522 /*!< Mismatched units in initial assignment to species. */
536 , InitAssignParameterMismatch           = 10523 /*!< Mismatched units in initial assignment to parameter. */
537 , InitAssignStoichiometryMismatch       = 10524 /*!< Mismatched units in initial assignment to stoichiometry. */
538 , RateRuleCompartmentMismatch           = 10531 /*!< Mismatched units in rate rule for compartment. */
539 , RateRuleSpeciesMismatch               = 10532 /*!< Mismatched units in rate rule for species. */
540 , RateRuleParameterMismatch             = 10533 /*!< Mismatched units in rate rule for parameter. */
541 , RateRuleStoichiometryMismatch         = 10534 /*!< Mismatched units in rate rule for stoichiometry. */
542 , KineticLawNotSubstancePerTime         = 10541 /*!< The units of the kinetic law are not 'substance'/'time'. */
543 , SpeciesInvalidExtentUnits             = 10542 /*!< The species' units are not consistent with units of extent. */
544 , DelayUnitsNotTime                     = 10551 /*!< The units of the delay expression are not units of time. */
545 , EventAssignCompartmentMismatch        = 10561 /*!< Mismatched units in event assignment for compartment. */
546 , EventAssignSpeciesMismatch            = 10562 /*!< Mismatched units in event assignment for species. */
547 , EventAssignParameterMismatch          = 10563 /*!< Mismatched units in event assignment for parameter. */
548 , EventAssignStoichiometryMismatch      = 10564 /*!< Mismatched units in event assignment for stoichiometry. */
549 , PriorityUnitsNotDimensionless         = 10565 /*!< The units of a priority expression must be 'dimensionless'. */
550 , UpperUnitBound                        = 10599 /*!< Upper boundary of unit validation diagnostic codes. */
551 , OverdeterminedSystem                  = 10601 /*!< The model is overdetermined. */
552 , InvalidModelSBOTerm                   = 10701 /*!< Invalid 'sboTerm' attribute value for a Model object. */
553 , InvalidFunctionDefSBOTerm             = 10702 /*!< Invalid 'sboTerm' attribute value for a FunctionDefinition object. */
554 , InvalidParameterSBOTerm               = 10703 /*!< Invalid 'sboTerm' attribute value for a Parameter object. */
555 , InvalidInitAssignSBOTerm              = 10704 /*!< Invalid 'sboTerm' attribute value for an InitialAssignment object. */
556 , InvalidRuleSBOTerm                    = 10705 /*!< Invalid 'sboTerm' attribute value for a Rule object. */
557 , InvalidConstraintSBOTerm              = 10706 /*!< Invalid 'sboTerm' attribute value for a Constraint object. */
558 , InvalidReactionSBOTerm                = 10707 /*!< Invalid 'sboTerm' attribute value for a Reaction object. */
559 , InvalidSpeciesReferenceSBOTerm        = 10708 /*!< Invalid 'sboTerm' attribute value for a SpeciesReference object. */
560 , InvalidKineticLawSBOTerm              = 10709 /*!< Invalid 'sboTerm' attribute value for a KineticLaw object. */
561 , InvalidEventSBOTerm                   = 10710 /*!< Invalid 'sboTerm' attribute value for an Event object. */
562 , InvalidEventAssignmentSBOTerm         = 10711 /*!< Invalid 'sboTerm' attribute value for an EventAssignment object. */
563 , InvalidCompartmentSBOTerm             = 10712 /*!< Invalid 'sboTerm' attribute value for a Compartment object. */
564 , InvalidSpeciesSBOTerm                 = 10713 /*!< Invalid 'sboTerm' attribute value for a Species object. */
565 , InvalidCompartmentTypeSBOTerm         = 10714 /*!< Invalid 'sboTerm' attribute value for a CompartmentType object. */
566 , InvalidSpeciesTypeSBOTerm             = 10715 /*!< Invalid 'sboTerm' attribute value for a SpeciesType object. */
567 , InvalidTriggerSBOTerm                 = 10716 /*!< Invalid 'sboTerm' attribute value for an Event Trigger object. */
568 , InvalidDelaySBOTerm                   = 10717 /*!< Invalid 'sboTerm' attribute value for an Event Delay object. */
569 , InvalidLocalParameterSBOTerm          = 10718 /*!< Invalid 'sboTerm' attribute value for a LocalParameter object. */
570 , InvalidSBMLElementSBOTerm             = 10719 /*!< Invalid 'sboTerm' attribute value for the <code>&lt;sbml&gt;</code> element. */
571 , NotesNotInXHTMLNamespace              = 10801 /*!< Notes must be placed in the XHTML XML namespace. */
572 , NotesContainsXMLDecl                  = 10802 /*!< XML declarations are not permitted in Notes objects. */
573 , NotesContainsDOCTYPE                  = 10803 /*!< XML DOCTYPE elements are not permitted in Notes objects. */
574 , InvalidNotesContent                   = 10804 /*!< Invalid notes content found. */
575 , OnlyOneNotesElementAllowed            = 10805 /*!< Only one Notes subobject is permitted on a given SBML object. */
576 , InvalidNamespaceOnSBML                = 20101 /*!< Invalid XML namespace for the SBML container element. */
577 , MissingOrInconsistentLevel            = 20102 /*!< Missing or inconsistent value for the 'level' attribute. */
578 , MissingOrInconsistentVersion          = 20103 /*!< Missing or inconsistent value for the 'version' attribute. */
579 , PackageNSMustMatch                    = 20104 /*!< Inconsistent or invalid SBML Level/Version for the package namespace declaration. */
580 , LevelPositiveInteger                  = 20105 /*!< The 'level' attribute must have a positive integer value. */
581 , VersionPositiveInteger                = 20106 /*!< The 'version' attribute must have a positive integer value. */
582 , AllowedAttributesOnSBML               = 20108 /*!< Invalid attribute found on the SBML container element. */
583 , L3PackageOnLowerSBML                  = 20109 /*!< An L3 package ns found on the SBML container element. */
584 , MissingModel                          = 20201 /*!< No model definition found. */
585 , IncorrectOrderInModel                 = 20202 /*!< Incorrect ordering of components within the Model object. */
586 , EmptyListElement                      = 20203 /*!< Empty ListOf___ object found. */
587 , NeedCompartmentIfHaveSpecies          = 20204 /*!< The presence of a species requires a compartment. */
588 , OneOfEachListOf                       = 20205 /*!< Only one of each kind of ListOf___ object is allowed inside a Model object. */
589 , OnlyFuncDefsInListOfFuncDefs          = 20206 /*!< Only FunctionDefinition, Notes and Annotation objects are allowed in ListOfFunctionDefinitions. */
590 , OnlyUnitDefsInListOfUnitDefs          = 20207 /*!< Only UnitDefinition, Notes and Annotation objects are allowed in ListOfUnitDefinitions objects. */
591 , OnlyCompartmentsInListOfCompartments  = 20208 /*!< Only Compartment, Notes and Annotation objects are allowed in ListOfCompartments objects. */
592 , OnlySpeciesInListOfSpecies            = 20209 /*!< Only Species, Notes and Annotation objects are allowed in ListOfSpecies objects. */
593 , OnlyParametersInListOfParameters      = 20210 /*!< Only Parameter, Notes and Annotation objects are allowed in ListOfParameters objects. */
594 , OnlyInitAssignsInListOfInitAssigns    = 20211 /*!< Only InitialAssignment, Notes and Annotation objects are allowed in ListOfInitialAssignments objects. */
595 , OnlyRulesInListOfRules                = 20212 /*!< Only Rule, Notes and Annotation objects are allowed in ListOfRules objects. */
596 , OnlyConstraintsInListOfConstraints    = 20213 /*!< Only Constraint, Notes and Annotation objects are allowed in ListOfConstraints objects. */
597 , OnlyReactionsInListOfReactions        = 20214 /*!< Only Reaction, Notes and Annotation objects are allowed in ListOfReactions objects. */
598 , OnlyEventsInListOfEvents              = 20215 /*!< Only Event, Notes and Annotation objects are allowed in ListOfEvents objects. */
599 , L3ConversionFactorOnModel             = 20216 /*!< A 'conversionFactor' attribute value must reference a Parameter object. */
600 , L3TimeUnitsOnModel                    = 20217 /*!< Invalid 'timeUnits' attribute value. */
601 , L3VolumeUnitsOnModel                  = 20218 /*!< Invalid 'volumeUnits' attribute value. */
602 , L3AreaUnitsOnModel                    = 20219 /*!< Invalid 'areaUnits' attribute value. */
603 , L3LengthUnitsOnModel                  = 20220 /*!< Invalid 'lengthUnits' attribute value. */
604 , L3ExtentUnitsOnModel                  = 20221 /*!< Invalid 'extentUnits' attribute value. */
605 , AllowedAttributesOnModel              = 20222 /*!< Invalid attribute found on the Model object. */
606 , AllowedAttributesOnListOfFuncs        = 20223 /*!< Invalid attribute found on the ListOfFunctionDefinitions object. */
607 , AllowedAttributesOnListOfUnitDefs     = 20224 /*!< Invalid attribute found on the ListOfUnitDefinitions object. */
608 , AllowedAttributesOnListOfComps        = 20225 /*!< Invalid attribute found on the ListOfCompartments object. */
609 , AllowedAttributesOnListOfSpecies      = 20226 /*!< Invalid attribute found on the ListOfSpecies object. */
610 , AllowedAttributesOnListOfParams       = 20227 /*!< Invalid attribute found on the ListOfParameters object. */
611 , AllowedAttributesOnListOfInitAssign   = 20228 /*!< Invalid attribute found on the ListOfInitialAssignments object. */
612 , AllowedAttributesOnListOfRules        = 20229 /*!< Invalid attribute found on the ListOfRules object. */
613 , AllowedAttributesOnListOfConstraints  = 20230 /*!< Invalid attribute found on the ListOfConstraints object. */
614 , AllowedAttributesOnListOfReactions    = 20231 /*!< Invalid attribute found on the ListOfReactions object. */
615 , AllowedAttributesOnListOfEvents       = 20232 /*!< Invalid attribute found on the ListOfEvents object. */
616 , L3V2SubstanceUnitsOnModel             = 20233 /*!< Invalid 'substanceUnits' attribute value. */
617 , FunctionDefMathNotLambda              = 20301 /*!< Invalid expression found in the function definition. */
618 , InvalidApplyCiInLambda                = 20302 /*!< Invalid forward reference in the MathML <code>&lt;apply&gt;</code><code>&lt;ci&gt;</code>...<code>&lt;/ci&gt;</code><code>&lt;/apply&gt;</code> expression. */
619 , RecursiveFunctionDefinition           = 20303 /*!< Recursive function definitions are not permitted. */
620 , InvalidCiInLambda                     = 20304 /*!< Invalid <code>&lt;ci&gt;</code> reference found inside the <code>&lt;lambda&gt;</code> mathematical formula. */
621 , InvalidFunctionDefReturnType          = 20305 /*!< A function's return type must be either a number or a Boolean. */
622 , OneMathElementPerFunc                 = 20306 /*!< A FunctionDefinition object may contain one <code>&lt;math&gt;</code> element. */
623 , AllowedAttributesOnFunc               = 20307 /*!< Invalid attribute found on the FunctionDefinition object. */
624 , OnlyCiInsideBVar                      = 99304
625 , InvalidUnitDefId                      = 20401 /*!< Invalid 'id' attribute value for a UnitDefinition object. */
626 , InvalidSubstanceRedefinition          = 20402 /*!< Invalid redefinition of built-in type 'substance'. */
627 , InvalidLengthRedefinition             = 20403 /*!< Invalid redefinition of built-in type 'length'. */
628 , InvalidAreaRedefinition               = 20404 /*!< Invalid redefinition of built-in type name 'area'. */
629 , InvalidTimeRedefinition               = 20405 /*!< Invalid redefinition of built-in type name 'time'. */
630 , InvalidVolumeRedefinition             = 20406 /*!< Invalid redefinition of built-in type name 'volume'. */
631 , VolumeLitreDefExponentNotOne          = 20407 /*!< Must use 'exponent'=1 when defining 'volume' in terms of litres. */
632 , VolumeMetreDefExponentNot3            = 20408 /*!< Must use 'exponent'=3 when defining 'volume' in terms of metres. */
633 , EmptyListOfUnits                      = 20409 /*!< An empty list of Unit objects is not permitted in a UnitDefinition object. */
634 , InvalidUnitKind                       = 20410 /*!< Invalid value for the 'kind' attribute of a UnitDefinition object. */
635 , OffsetNoLongerValid                   = 20411 /*!< Unit attribute 'offset' is not supported in this Level+Version of SBML. */
636 , CelsiusNoLongerValid                  = 20412 /*!< Unit name 'Celsius' is not defined in this Level+Version of SBML. */
637 , EmptyUnitListElement                  = 20413 /*!< A ListOfUnits object must not be empty. */
638 , OneListOfUnitsPerUnitDef              = 20414 /*!< At most one ListOfUnits object is allowed inside a UnitDefinition object. */
639 , OnlyUnitsInListOfUnits                = 20415 /*!< Only Unit, Notes and Annotation objects are allowed in ListOfUnits objects. */
640 , AllowedAttributesOnUnitDefinition     = 20419 /*!< Invalid attribute found on the UnitDefinition object. */
641 , AllowedAttributesOnListOfUnits        = 20420 /*!< Invalid attribute found on the ListOfUnits object. */
642 , AllowedAttributesOnUnit               = 20421 /*!< Invalid attribute found on the Unit object. */
643 , ZeroDimensionalCompartmentSize        = 20501 /*!< Invalid use of the 'size' attribute for a zero-dimensional compartment. */
644 , ZeroDimensionalCompartmentUnits       = 20502 /*!< Invalid use of the 'units' attribute for a zero-dimensional compartment. */
645 , ZeroDimensionalCompartmentConst       = 20503 /*!< Zero-dimensional compartments must be defined to be constant. */
646 , UndefinedOutsideCompartment           = 20504 /*!< Invalid value for the 'outside' attribute of a Compartment object. */
647 , RecursiveCompartmentContainment       = 20505 /*!< Recursive nesting of compartments via the 'outside' attribute is not permitted. */
648 , ZeroDCompartmentContainment           = 20506 /*!< Invalid nesting of zero-dimensional compartments. */
649 , Invalid1DCompartmentUnits             = 20507 /*!< Invalid value for the 'units' attribute of a one-dimensional compartment. */
650 , Invalid2DCompartmentUnits             = 20508 /*!< Invalid value for the 'units' attribute of a two-dimensional compartment. */
651 , Invalid3DCompartmentUnits             = 20509 /*!< Invalid value for the 'units' attribute of a three-dimensional compartment. */
652 , InvalidCompartmentTypeRef             = 20510 /*!< Invalid value for the 'compartmentType' attribute of a compartment. */
653 , OneDimensionalCompartmentUnits        = 20511 /*!< No units defined for 1-D compartment. */
654 , TwoDimensionalCompartmentUnits        = 20512 /*!< No units defined for 2-D compartment. */
655 , ThreeDimensionalCompartmentUnits      = 20513 /*!< No units defined for 3-D Compartment object. */
656 , AllowedAttributesOnCompartment        = 20517 /*!< Invalid attribute found on Compartment object. */
657 , NoUnitsOnCompartment                  = 20518 /*!< No units defined for Compartment object. */
658 , InvalidSpeciesCompartmentRef          = 20601 /*!< Invalid value found for Species 'compartment' attribute. */
659 , HasOnlySubsNoSpatialUnits             = 20602 /*!< Attribute 'spatialSizeUnits' must not be set if 'hasOnlySubstanceUnits'='true'. */
660 , NoSpatialUnitsInZeroD                 = 20603 /*!< Attribute 'spatialSizeUnits' must not be set if the compartment is zero-dimensional. */
661 , NoConcentrationInZeroD                = 20604 /*!< Attribute 'initialConcentration' must not be set if the compartment is zero-dimensional. */
662 , SpatialUnitsInOneD                    = 20605 /*!< Invalid value for 'spatialSizeUnits' attribute of a one-dimensional compartment. */
663 , SpatialUnitsInTwoD                    = 20606 /*!< Invalid value for the 'spatialSizeUnits' attribute of a two-dimensional compartment. */
664 , SpatialUnitsInThreeD                  = 20607 /*!< Invalid value for the 'spatialSizeUnits' attribute of a three-dimensional compartment. */
665 , InvalidSpeciesSusbstanceUnits         = 20608 /*!< Invalid value for a Species 'units' attribute. */
666 , BothAmountAndConcentrationSet         = 20609 /*!< Cannot set both 'initialConcentration' and 'initialAmount' attributes simultaneously. */
667 , NonBoundarySpeciesAssignedAndUsed     = 20610 /*!< Cannot use a non-boundary species in both reactions and rules simultaneously. */
668 , NonConstantSpeciesUsed                = 20611 /*!< Cannot use a constant, non-boundary species as a reactant or product. */
669 , InvalidSpeciesTypeRef                 = 20612 /*!< Invalid value for the 'speciesType' attribute of a species. */
670 , MultSpeciesSameTypeInCompartment      = 20613 /*!< Cannot have multiple species of the same species type in the same compartment. */
671 , MissingSpeciesCompartment             = 20614 /*!< Missing value for the 'compartment' attribute. */
672 , SpatialSizeUnitsRemoved               = 20615 /*!< Attribute 'spatialSizeUnits' is not supported in this Level+Version of SBML. */
673 , SubstanceUnitsOnSpecies               = 20616 /*!< No substance units defined for the species. */
674 , ConversionFactorOnSpecies             = 20617 /*!< Invalid value for the 'conversionFactor' attribute. */
675 , AllowedAttributesOnSpecies            = 20623 /*!< Invalid attribute found on Species object. */
676 , InvalidParameterUnits                 = 20701 /*!< Invalid value for the 'units' attribute of a Parameter object. */
677 , ParameterUnits                        = 20702 /*!< No units defined for the parameter. */
678 , ConversionFactorMustConstant          = 20705 /*!< A conversion factor must reference a Parameter object declared to be a constant. */
679 , AllowedAttributesOnParameter          = 20706 /*!< Invalid attribute found on Parameter object. */
680 , InvalidInitAssignSymbol               = 20801 /*!< Invalid value for the 'symbol' attribute of an InitialAssignment object. */
681 , MultipleInitAssignments               = 20802 /*!< Multiple initial assignments for the same 'symbol' value are not allowed. */
682 , InitAssignmentAndRuleForSameId        = 20803 /*!< Cannot set a value using both an initial assignment and an assignment rule simultaneously. */
683 , OneMathElementPerInitialAssign        = 20804 /*!< An InitialAssignment object may contain one <code>&lt;math&gt;</code> element. */
684 , AllowedAttributesOnInitialAssign      = 20805 /*!< Invalid attribute found on an InitialAssignment object. */
685 , InitAssignmentCannotRef0DComp         = 20806 /*!< InitialAssignment cannot reference 0D compartment. */
686 , InvalidAssignRuleVariable             = 20901 /*!< Invalid value for the 'variable' attribute of an AssignmentRule object. */
687 , InvalidRateRuleVariable               = 20902 /*!< Invalid value for the 'variable' attribute of a RateRule object. */
688 , AssignmentToConstantEntity            = 20903 /*!< An assignment rule cannot assign an entity declared to be constant. */
689 , RateRuleForConstantEntity             = 20904 /*!< A rate rule cannot assign an entity declared to be constant. */
690 , RepeatedRule10304                     = 20905
691 , CircularRuleDependency                = 20906 /*!< Circular dependencies involving rules and reactions are not permitted. */
692 , OneMathElementPerRule                 = 20907 /*!< A rule object may contain one <code>&lt;math&gt;</code> element. */
693 , AllowedAttributesOnAssignRule         = 20908 /*!< Invalid attribute found on an AssignmentRule object. */
694 , AllowedAttributesOnRateRule           = 20909 /*!< Invalid attribute found on a RateRule object. */
695 , AllowedAttributesOnAlgRule            = 20910 /*!< Invalid attribute found on an AlgebraicRule object. */
696 , RuleCannotRef0DComp                   = 20911 /*!< Rule cannot reference 0D compartment. */
697 , CircularDependencyRateOf              = 20912 /*!< Circular dependencies are not permitted in RateRule and KineticLaw objects. */
698 , ConstraintMathNotBoolean              = 21001 /*!< A Constraint object's <code>&lt;math&gt;</code> must evaluate to a Boolean value. */
699 , IncorrectOrderInConstraint            = 21002 /*!< Subobjects inside the Constraint object are not in the prescribed order. */
700 , ConstraintNotInXHTMLNamespace         = 21003 /*!< A Constraint's Message subobject must be in the XHTML XML namespace. */
701 , ConstraintContainsXMLDecl             = 21004 /*!< XML declarations are not permitted within Constraint's Message objects. */
702 , ConstraintContainsDOCTYPE             = 21005 /*!< XML DOCTYPE elements are not permitted within Constraint's Message objects. */
703 , InvalidConstraintContent              = 21006 /*!< Invalid content for a Constraint object's Message object. */
704 , OneMathElementPerConstraint           = 21007 /*!< A Constraint object may contain one <code>&lt;math&gt;</code> element. */
705 , OneMessageElementPerConstraint        = 21008 /*!< A Constraint object can only have one Message subobject. */
706 , AllowedAttributesOnConstraint         = 21009 /*!< Invalid attribute found on Constraint object. */
707 , NoReactantsOrProducts                 = 21101 /*!< Cannot have a reaction with neither reactants nor products. */
708 , IncorrectOrderInReaction              = 21102 /*!< Subobjects inside the Reaction object are not in the prescribed order. */
709 , EmptyListInReaction                   = 21103 /*!< Reaction components, if present, cannot be empty. */
710 , InvalidReactantsProductsList          = 21104 /*!< Invalid object found in the list of reactants or products. */
711 , InvalidModifiersList                  = 21105 /*!< Invalid object found in the list of modifiers. */
712 , OneSubElementPerReaction              = 21106 /*!< A Reaction object can only contain one of each allowed type of object. */
713 , CompartmentOnReaction                 = 21107 /*!< Invalid value for the Reaction 'compartment' attribute. */
714 , AllowedAttributesOnReaction           = 21110 /*!< Invalid attribute for a Reaction object. */
715 , InvalidSpeciesReference               = 21111 /*!< Invalid 'species' attribute value in SpeciesReference object. */
716 , RepeatedRule20611                     = 21112
717 , BothStoichiometryAndMath              = 21113 /*!< The 'stoichiometry' attribute and StoichiometryMath subobject are mutually exclusive. */
718 , AllowedAttributesOnSpeciesReference   = 21116 /*!< Invalid attribute found on the SpeciesReference object. */
719 , AllowedAttributesOnModifier           = 21117 /*!< Invalid attribute found on the ModifierSpeciesReference object. */
720 , UndeclaredSpeciesRef                  = 21121 /*!< Unknown species referenced in the kinetic law <code>&lt;math&gt;</code> formula. */
721 , IncorrectOrderInKineticLaw            = 21122 /*!< Incorrect ordering of components in the KineticLaw object. */
722 , EmptyListInKineticLaw                 = 21123 /*!< The list of parameters, if present, cannot be empty. */
723 , NonConstantLocalParameter             = 21124 /*!< Parameters local to a KineticLaw object must have a 'constant' attribute value of 'true'. */
724 , SubsUnitsNoLongerValid                = 21125 /*!< Attribute 'substanceUnits' is not supported in this Level+Version of SBML. */
725 , TimeUnitsNoLongerValid                = 21126 /*!< Attribute 'timeUnits' is not supported in this Level+Version of SBML. */
726 , OneListOfPerKineticLaw                = 21127 /*!< Only one ListOfLocalParameters object is permitted within a KineticLaw object. */
727 , OnlyLocalParamsInListOfLocalParams    = 21128 /*!< Only LocalParameter, Notes and Annotation objects are allowed in ListOfLocalParameter objects. */
728 , AllowedAttributesOnListOfLocalParam   = 21129 /*!< Invalid attribute found on the ListOfLocalParameters object. */
729 , OneMathPerKineticLaw                  = 21130 /*!< Only one <code>&lt;math&gt;</code> element is allowed in a KineticLaw object. */
730 , UndeclaredSpeciesInStoichMath         = 21131 /*!< Unknown species referenced in the StoichiometryMath object's <code>&lt;math&gt;</code> formula. */
731 , AllowedAttributesOnKineticLaw         = 21132 /*!< Invalid attribute found on the KineticLaw object. */
732 , AllowedAttributesOnListOfSpeciesRef   = 21150 /*!< Invalid attribute found on the ListOfSpeciesReferences object. */
733 , AllowedAttributesOnListOfMods         = 21151 /*!< Invalid attribute found on the ListOfModifiers object. */
734 , L3V2FastDeprecated                    = 21152 /*!< Fast attribute deprecated. */
735 , AllowedAttributesOnLocalParameter     = 21172 /*!< Invalid attribute found on the LocalParameter object. */
736 , LocalParameterShadowsSpecies          = 21173 /*!< Invalid attribute found on the LocalParameter object. */
737 , MissingTriggerInEvent                 = 21201 /*!< The Event object is missing a Trigger subobject. */
738 , TriggerMathNotBoolean                 = 21202 /*!< A Trigger object's <code>&lt;math&gt;</code> expression must evaluate to a Boolean value. */
739 , MissingEventAssignment                = 21203 /*!< The Event object is missing an EventAssignment subobject. */
740 , TimeUnitsEvent                        = 21204 /*!< Units referenced by 'timeUnits' attribute are not compatible with units of time. */
741 , IncorrectOrderInEvent                 = 21205 /*!< Incorrect ordering of components in Event object. */
742 , ValuesFromTriggerTimeNeedDelay        = 21206 /*!< Attribute 'useValuesFromTriggerTime'='false', but the Event object does not define a delay. */
743 , DelayNeedsValuesFromTriggerTime       = 21207 /*!< The use of a Delay object requires the Event attribute 'useValuesFromTriggerTime'. */
744 , OneMathPerTrigger                     = 21209 /*!< A Trigger object may have one <code>&lt;math&gt;</code> element. */
745 , OneMathPerDelay                       = 21210 /*!< A Delay object may have one <code>&lt;math&gt;</code> element. */
746 , InvalidEventAssignmentVariable        = 21211 /*!< Invalid 'variable' attribute value in Event object. */
747 , EventAssignmentForConstantEntity      = 21212 /*!< An EventAssignment object cannot assign to a component having attribute 'constant'='true'. */
748 , OneMathPerEventAssignment             = 21213 /*!< An EventAssignment object may have one <code>&lt;math&gt;</code> element. */
749 , AllowedAttributesOnEventAssignment    = 21214 /*!< Invalid attribute found on the EventAssignment object. */
750 , OnlyOneDelayPerEvent                  = 21221 /*!< An Event object can only have one Delay subobject. */
751 , OneListOfEventAssignmentsPerEvent     = 21222 /*!< An Event object can only have one ListOfEventAssignments subobject. */
752 , OnlyEventAssignInListOfEventAssign    = 21223 /*!< Only EventAssignment, Notes and Annotation objects are allowed in ListOfEventAssignments. */
753 , AllowedAttributesOnListOfEventAssign  = 21224 /*!< Invalid attribute found on the ListOfEventAssignments object. */
754 , AllowedAttributesOnEvent              = 21225 /*!< Invalid attribute found on the Event object. */
755 , AllowedAttributesOnTrigger            = 21226 /*!< Invalid attribute found on the Trigger object. */
756 , AllowedAttributesOnDelay              = 21227 /*!< Invalid attribute found on the Delay object. */
757 , PersistentNotBoolean                  = 21228 /*!< The Trigger attribute 'persistent' must evaluate to a Boolean value. */
758 , InitialValueNotBoolean                = 21229 /*!< The Trigger attribute 'initialValue' must evaluate to a Boolean value. */
759 , OnlyOnePriorityPerEvent               = 21230 /*!< An Event object can only have one Priority subobject. */
760 , OneMathPerPriority                    = 21231 /*!< A Priority object may have one <code>&lt;math&gt;</code> element. */
761 , AllowedAttributesOnPriority           = 21232 /*!< Invalid attribute found on the Priority object. */
762 , GeneralWarningNotSpecified            = 29999 /*!< Unknown error. */
763 , CompartmentShouldHaveSize             = 80501 /*!< It's best to define a size for every compartment in a model. */
764 , SpeciesShouldHaveValue                = 80601 /*!< It's best to define an initial amount or initial concentration for every species in a model. */
765 , ParameterShouldHaveUnits              = 80701 /*!< It's best to declare units for every parameter in a model. */
766 , ParameterShouldHaveValue              = 80702 /*!< It's best to declare values for every parameter in a model. */
767 , LocalParameterShadowsId               = 81121 /*!< Local parameters defined within a kinetic law shadow global object symbols. */
768 , LibSBMLAdditionalCodesLowerBound      = 90000 /*!< Lower boundary of libSBML-specific diagnostic codes. */
769 , CannotConvertToL1V1                   = 90001 /*!< Cannot convert to SBML Level 1 Version 1. */
770 , NoEventsInL1                          = 91001 /*!< SBML Level 1 does not support events. */
771 , NoFunctionDefinitionsInL1             = 91002 /*!< SBML Level 1 does not support function definitions. */
772 , NoConstraintsInL1                     = 91003 /*!< SBML Level 1 does not support constraints. */
773 , NoInitialAssignmentsInL1              = 91004 /*!< SBML Level 1 does not support initial assignments. */
774 , NoSpeciesTypesInL1                    = 91005 /*!< SBML Level 1 does not support species types. */
775 , NoCompartmentTypeInL1                 = 91006 /*!< SBML Level 1 does not support compartment types. */
776 , NoNon3DCompartmentsInL1               = 91007 /*!< SBML Level 1 only supports three-dimensional compartments. */
777 , NoFancyStoichiometryMathInL1          = 91008 /*!< SBML Level 1 does not support non-integer nor non-rational stoichiometry formulas. */
778 , NoNonIntegerStoichiometryInL1         = 91009 /*!< SBML Level 1 does not support non-integer 'stoichiometry' attribute values. */
779 , NoUnitMultipliersOrOffsetsInL1        = 91010 /*!< SBML Level 1 does not support multipliers or offsets in unit definitions. */
780 , SpeciesCompartmentRequiredInL1        = 91011 /*!< In SBML Level 1, a value for 'compartment' is mandatory in species definitions. */
781 , NoSpeciesSpatialSizeUnitsInL1         = 91012 /*!< SBML Level 1 does not support species 'spatialSizeUnits' settings. */
782 , NoSBOTermsInL1                        = 91013 /*!< SBML Level 1 does not support the 'sboTerm' attribute. */
783 , StrictUnitsRequiredInL1               = 91014 /*!< SBML Level 1 requires strict unit consistency. */
784 , ConversionFactorNotInL1               = 91015 /*!< SBML Level 1 does not support the 'conversionFactor' attribute. */
785 , CompartmentNotOnL1Reaction            = 91016 /*!< SBML Level 1 does not support the 'compartment' attribute on Reaction objects. */
786 , ExtentUnitsNotSubstance               = 91017 /*!< Units of extent must be compatible with units of substance. */
787 , GlobalUnitsNotDeclared                = 91018 /*!< Global units must be refer to unit kind or unitDefinition. */
788 , HasOnlySubstanceUnitsNotinL1          = 91019 /*!< The concept of hasOnlySubstanceUnits was not available in SBML Level 1. */
789 , AvogadroNotSupported                  = 91020 /*!< Avogadro not supported in Levels 2 and 1. */
790 , NoConstraintsInL2v1                   = 92001 /*!< SBML Level 2 Version 1 does not support Constraint objects. */
791 , NoInitialAssignmentsInL2v1            = 92002 /*!< SBML Level 2 Version 1 does not support InitialAssignment objects. */
792 , NoSpeciesTypeInL2v1                   = 92003 /*!< SBML Level 2 Version 1 does not support SpeciesType objects. */
793 , NoCompartmentTypeInL2v1               = 92004 /*!< SBML Level 2 Version 1 does not support CompartmentType objects. */
794 , NoSBOTermsInL2v1                      = 92005 /*!< SBML Level 2 Version 1 does not support the 'sboTerm' attribute. */
795 , NoIdOnSpeciesReferenceInL2v1          = 92006 /*!< SBML Level 2 Version 1 does not support the 'id' attribute on SpeciesReference objects. */
796 , NoDelayedEventAssignmentInL2v1        = 92007 /*!< SBML Level 2 Version 1 does not support the 'useValuesFromTriggerTime' attribute. */
797 , StrictUnitsRequiredInL2v1             = 92008 /*!< SBML Level 2 Version 1 requires strict unit consistency. */
798 , IntegerSpatialDimensions              = 92009 /*!< SBML Level 2 Version 1 requires that compartments have spatial dimensions of 0-3. */
799 , StoichiometryMathNotYetSupported      = 92010 /*!< Conversion to StoichiometryMath objects not yet supported. */
800 , PriorityLostFromL3                    = 92011 /*!< SBML Level 2 Version 1 does not support priorities on Event objects. */
801 , NonPersistentNotSupported             = 92012 /*!< SBML Level 2 Version 1 does not support the 'persistent' attribute on Trigger objects. */
802 , InitialValueFalseEventNotSupported    = 92013 /*!< SBML Level 2 Version 1 does not support the 'initialValue' attribute on Trigger objects. */
803 , SBOTermNotUniversalInL2v2             = 93001 /*!< The 'sboTerm' attribute is invalid for this component in SBML Level 2 Version 2. */
804 , NoUnitOffsetInL2v2                    = 93002 /*!< This Level+Version of SBML does not support the 'offset' attribute on Unit objects. */
805 , NoKineticLawTimeUnitsInL2v2           = 93003 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects. */
806 , NoKineticLawSubstanceUnitsInL2v2      = 93004 /*!< This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects. */
807 , NoDelayedEventAssignmentInL2v2        = 93005 /*!< This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attribute. */
808 , ModelSBOBranchChangedBeyondL2v2       = 93006 /*!< The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version. */
809 , StrictUnitsRequiredInL2v2             = 93007 /*!< SBML Level 2 Version 2 requires strict unit consistency. */
810 , StrictSBORequiredInL2v2               = 93008 /*!< SBML Level 2 Version 2 requires strict SBO term consistency. */
811 , DuplicateAnnotationInvalidInL2v2      = 93009 /*!< Duplicate top-level annotations are invalid in SBML Level 2 Version 2. */
812 , NoUnitOffsetInL2v3                    = 94001 /*!< This Level+Version of SBML does not support the 'offset' attribute on Unit objects. */
813 , NoKineticLawTimeUnitsInL2v3           = 94002 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects. */
814 , NoKineticLawSubstanceUnitsInL2v3      = 94003 /*!< This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects. */
815 , NoSpeciesSpatialSizeUnitsInL2v3       = 94004 /*!< This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects. */
816 , NoEventTimeUnitsInL2v3                = 94005 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects. */
817 , NoDelayedEventAssignmentInL2v3        = 94006 /*!< This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attribute. */
818 , ModelSBOBranchChangedBeyondL2v3       = 94007 /*!< The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version. */
819 , StrictUnitsRequiredInL2v3             = 94008 /*!< SBML Level 2 Version 3 requires strict unit consistency. */
820 , StrictSBORequiredInL2v3               = 94009 /*!< SBML Level 2 Version 3 requires strict SBO term consistency. */
821 , DuplicateAnnotationInvalidInL2v3      = 94010 /*!< Duplicate top-level annotations are invalid in SBML Level 2 Version 3. */
822 , NoUnitOffsetInL2v4                    = 95001 /*!< This Level+Version of SBML does not support the 'offset' attribute on Unit objects. */
823 , NoKineticLawTimeUnitsInL2v4           = 95002 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects. */
824 , NoKineticLawSubstanceUnitsInL2v4      = 95003 /*!< This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects. */
825 , NoSpeciesSpatialSizeUnitsInL2v4       = 95004 /*!< This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects. */
826 , NoEventTimeUnitsInL2v4                = 95005 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects. */
827 , ModelSBOBranchChangedInL2v4           = 95006 /*!< The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version. */
828 , DuplicateAnnotationInvalidInL2v4      = 95007 /*!< Duplicate top-level annotations are invalid in SBML Level 2 Version 4. */
829 , NoSpeciesTypeInL3v1                   = 96001 /*!< SBML Level 3 Version 1 does not support SpeciesType objects. */
830 , NoCompartmentTypeInL3v1               = 96002 /*!< SBML Level 3 Version 1 does not support CompartmentType objects. */
831 , NoUnitOffsetInL3v1                    = 96003 /*!< This Level+Version of SBML does not support the 'offset' attribute on Unit objects. */
832 , NoKineticLawTimeUnitsInL3v1           = 96004 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects. */
833 , NoKineticLawSubstanceUnitsInL3v1      = 96005 /*!< This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects. */
834 , NoSpeciesSpatialSizeUnitsInL3v1       = 96006 /*!< This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects. */
835 , NoEventTimeUnitsInL3v1                = 96007 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects. */
836 , ModelSBOBranchChangedInL3v1           = 96008 /*!< The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version. */
837 , DuplicateAnnotationInvalidInL3v1      = 96009 /*!< Duplicate top-level annotations are invalid in SBML Level 3 Version 1. */
838 , NoCompartmentOutsideInL3v1            = 96010 /*!< This Level+Version of SBML does not support the 'outside' attribute on Compartment objects. */
839 , NoStoichiometryMathInL3v1             = 96011 /*!< This Level+Version of SBML does not support the StoichiometryMath object. */
840 , DoubleExponentNotSupported            = 98001 /*!< Exponent of type double not supported in Levels 2 and 1. */
841 , MathMLElementNotSupported             = 98002 /*!< This MathML element is only permitted in L3V2. */
842 , EmptyListOfElementNotSupported        = 98003 /*!< Empty 'ListOf' element is only permitted in L3V2. */
843 , MissingMathElementNotSupported        = 98004 /*!< Missing <code>&lt;math&gt;</code> element is only permitted in L3V2. */
844 , MissingTriggerElementNotSupported     = 98005 /*!< missing <code>&lt;trigger&gt;</code> element is only permitted in L3V2. */
845 , BooleanNumericDiscrepancy             = 98006 /*!< Interchange of Boolean and numeric values only permitted in L3V2. */
846 , IdNameSBaseInL3V2                     = 98007 /*!< Conversion will lose attributes only available in L3V2 and higher. */
847 , MissingParticipantsNotSupported       = 98008 /*!< Omission of both <code>&lt;listOfReactants&gt;</code> and <code>&lt;listOfProducts&gt;</code> is only valid in L3V2. */
848 , ConvertibleMathInitialAssignment      = 98009 /*!< Some L3V2-specific MathML elements are not permitted in InitialAssignment objects. */
849 , FastReactionsNotSupported             = 98010 /*!< Conversion of reactions employing the 'fast' attribute is not supported. */
850 , SpeciesRefIdInMathMLNotSupported      = 98011 /*!< This MathML element is only permitted in L3V2. */
851 , InvalidSBMLLevelVersion               = 99101 /*!< Unknown Level+Version combination of SBML. */
852 , InvalidPackageLevelVersion            = 99102 /*!< Invalid package Level+Version combination of SBML. */
853 , AnnotationNotesNotAllowedLevel1       = 99104 /*!< Annotation objects on the SBML container element are not permitted in SBML Level 1. */
854 , InvalidRuleOrdering                   = 99106 /*!< Invalid ordering of rules. */
855 , RequiredPackagePresent                = 99107 /*!< The SBML document requires an SBML Level 3 package unavailable in this software. */
856 , UnrequiredPackagePresent              = 99108 /*!< The SBML document uses an SBML Level 3 package unavailable in this software. */
857 , PackageRequiredShouldBeFalse          = 99109 /*!< This package expects required to be false. */
858 , SubsUnitsAllowedInKL                  = 99127 /*!< Disallowed value for attribute 'substanceUnits' on KineticLaw object. */
859 , TimeUnitsAllowedInKL                  = 99128 /*!< Disallowed value for attribute 'timeUnits' on KineticLaw object. */
860 , FormulaInLevel1KL                     = 99129 /*!< Only predefined functions are allowed in SBML Level 1 formulas. */
861 , L3SubstanceUnitsOnModel               = 99130 /*!< Invalid 'substanceUnits' attribute value. */
862 , StoichiometryMathMissingMath          = 99131 /*!< The <code>&lt;stoichiometryMath&gt;</code> element must contain a <code>&lt;math&gt;</code> element. */
863 , TimeUnitsRemoved                      = 99206 /*!< This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects. */
864 , BadMathML                             = 99219 /*!< Invalid MathML expression. */
865 , FailedMathMLReadOfDouble              = 99220 /*!< Missing or invalid floating-point number in MathML expression. */
866 , FailedMathMLReadOfInteger             = 99221 /*!< Missing or invalid integer in MathML expression. */
867 , FailedMathMLReadOfExponential         = 99222 /*!< Missing or invalid exponential expression in MathML. */
868 , FailedMathMLReadOfRational            = 99223 /*!< Missing or invalid rational expression in MathML. */
869 , BadMathMLNodeType                     = 99224 /*!< Invalid MathML element. */
870 , InvalidMathMLAttribute                = 99225 /*!< Invalid MathML attribute. */
871 , NoTimeSymbolInFunctionDef             = 99301 /*!< Use of <code>&lt;csymbol&gt;</code> for 'time' not allowed within FunctionDefinition objects. */
872 , NoBodyInFunctionDef                   = 99302 /*!< There must be a <code>&lt;lambda&gt;</code> body within the <code>&lt;math&gt;</code> element of a FunctionDefinition object. */
873 , DanglingUnitSIdRef                    = 99303 /*!< Units must refer to valid unit or unitDefinition. */
874 , RDFMissingAboutTag                    = 99401 /*!< RDF missing the <code>&lt;about&gt;</code> tag. */
875 , RDFEmptyAboutTag                      = 99402 /*!< RDF empty <code>&lt;about&gt;</code> tag. */
876 , RDFAboutTagNotMetaid                  = 99403 /*!< RDF <code>&lt;about&gt;</code> tag is not metaid. */
877 , RDFNotCompleteModelHistory            = 99404 /*!< RDF does not contain valid ModelHistory. */
878 , RDFNotModelHistory                    = 99405 /*!< RDF does not result in a ModelHistory. */
879 , AnnotationNotElement                  = 99406 /*!< Annotation must contain element. */
880 , NestedAnnotationNotAllowed            = 99407 /*!< Nested annotations not allowed. */
881 , InconsistentArgUnitsWarnings          = 99502 /*!< This is an internal error that reverts to 10501. */
882 , InconsistentPowerUnitsWarnings        = 99503 /*!< This is an internal error that reverts to 10501. */
883 , InconsistentExponUnitsWarnings        = 99504 /*!< This is an internal error that reverts to 10501. */
884 , UndeclaredUnits                       = 99505 /*!< Missing unit declarations on parameters or literal numbers in expression. */
885 , UndeclaredTimeUnitsL3                 = 99506 /*!< Unable to verify consistency of units: the unit of time has not been declared. */
886 , UndeclaredExtentUnitsL3               = 99507 /*!< Unable to verify consistency of units: the units of reaction extent have not been declared. */
887 , UndeclaredObjectUnitsL3               = 99508 /*!< Unable to verify consistency of units: encountered a model entity with no declared units. */
888 , CannotVerifyUnitsObjectNoMath         = 99509 /*!< Unable to verify consistency of units: encountered an object with no <code>&lt;math&gt;</code> element. */
889 , UnrecognisedSBOTerm                   = 99701 /*!< Unrecognized 'sboTerm' attribute value. */
890 , ObseleteSBOTerm                       = 99702 /*!< Obsolete 'sboTerm' attribute value. */
891 , IncorrectCompartmentSpatialDimensions = 99901 /*!< In SBML Level 1, only three-dimensional compartments are allowed. */
892 , CompartmentTypeNotValidAttribute      = 99902 /*!< CompartmentType objects are not available in this Level+Version of SBML. */
893 , ConstantNotValidAttribute             = 99903 /*!< This Level+Version of SBML does not support the 'constant' attribute on this component. */
894 , MetaIdNotValidAttribute               = 99904 /*!< Attribute 'metaid' is not available in SBML Level 1. */
895 , SBOTermNotValidAttributeBeforeL2V3    = 99905 /*!< The 'sboTerm' attribute is not available on this component before SBML Level 2 Version 3. */
896 , InvalidL1CompartmentUnits             = 99906 /*!< Invalid units for a compartment in SBML Level 1. */
897 , L1V1CompartmentVolumeReqd             = 99907 /*!< In SBML Level 1, a compartment's volume must be specified. */
898 , CompartmentTypeNotValidComponent      = 99908 /*!< CompartmentType objects are not available in this Level+Version of SBML. */
899 , ConstraintNotValidComponent           = 99909 /*!< Constraint objects are not available in this Level+Version of SBML. */
900 , EventNotValidComponent                = 99910 /*!< Event objects are not available in this Level+Version of SBML. */
901 , SBOTermNotValidAttributeBeforeL2V2    = 99911 /*!< The 'sboTerm' attribute is invalid for this component before Level 2 Version 2. */
902 , FuncDefNotValidComponent              = 99912 /*!< FunctionDefinition objects are not available in this Level+Version of SBML. */
903 , InitialAssignNotValidComponent        = 99913 /*!< InitialAssignment objects are not available in this Level+Version of SBML. */
904 , VariableNotValidAttribute             = 99914 /*!< Attribute 'variable' is not available on this component in this Level+Version of SBML. */
905 , UnitsNotValidAttribute                = 99915 /*!< Attribute 'units' is not available on this component in this Level+Version of SBML. */
906 , ConstantSpeciesNotValidAttribute      = 99916 /*!< Attribute 'constant' is not available on Species objects in SBML Level 1. */
907 , SpatialSizeUnitsNotValidAttribute     = 99917 /*!< Attribute 'spatialSizeUnits' is not available on Species objects in SBML Level 1. */
908 , SpeciesTypeNotValidAttribute          = 99918 /*!< Attribute 'speciesType' is not available on Species objects in SBML Level 1. */
909 , HasOnlySubsUnitsNotValidAttribute     = 99919 /*!< Attribute 'hasOnlySubstanceUnits' is not available on Species objects in SBML Level 1. */
910 , IdNotValidAttribute                   = 99920 /*!< Attribute 'id' is not available on SpeciesReference objects in SBML Level 1. */
911 , NameNotValidAttribute                 = 99921 /*!< Attribute 'name' is not available on SpeciesReference objects in SBML Level 1. */
912 , SpeciesTypeNotValidComponent          = 99922 /*!< The SpeciesType object is not supported in SBML Level 1. */
913 , StoichiometryMathNotValidComponent    = 99923 /*!< The StoichiometryMath object is not supported in SBML Level 1. */
914 , MultiplierNotValidAttribute           = 99924 /*!< Attribute 'multiplier' on Unit objects is not supported in SBML Level 1. */
915 , OffsetNotValidAttribute               = 99925 /*!< Attribute 'offset' on Unit objects is only available in SBML Level 2 Version 1. */
916 , L3SpatialDimensionsUnset              = 99926 /*!< No value given for 'spatialDimensions' attribute; assuming a value of 3. */
917 , OperationInterrupted                  = 99950 /*!< Operation was interrupted by the user. */
918 , UnknownCoreAttribute                  = 99994 /*!< Encountered an unknown attribute in the SBML Core namespace. */
919 , UnknownPackageAttribute               = 99995 /*!< Encountered an unknown attribute in an SBML Level 3 package namespace. */
920 , PackageConversionNotSupported         = 99996 /*!< Conversion of SBML Level 3 package constructs is not yet supported. */
921 , InvalidTargetLevelVersion             = 99997 /*!< The requested SBML Level/Version combination is not known to exist. */
922 , L3NotSupported                        = 99998 /*!< SBML Level 3 is not yet supported. */
923 , SBMLCodesUpperBound                   = 99999 /*!< Upper boundary of libSBML-specific diagnostic codes. */
924 } SBMLErrorCode_t;
925 
926 
927 /**
928  * @enum SBMLErrorCategory_t
929  * Category codes for SBMLError diagnostics.
930  *
931  * Note that these are distinct from XMLError's category codes.  User
932  * programs receiving an SBMLError object can use this distinction to
933  * check whether the error represents a low-level XML problem or an
934  * SBML problem.
935  *
936  * @see #XMLErrorCategory_t
937  */
938 typedef enum
939 {
940     LIBSBML_CAT_SBML = (LIBSBML_CAT_XML + 1)
941     /*!< General SBML error  not falling into another category below. */
942 
943   , LIBSBML_CAT_SBML_L1_COMPAT
944     /*!< Category of errors that can only occur during attempted
945      * translation from one Level/Version of SBML to another.  This
946      * particular category applies to errors encountered while trying to
947      * convert a model from SBML Level&nbsp;2 to SBML Level&nbsp;1. */
948 
949   , LIBSBML_CAT_SBML_L2V1_COMPAT
950     /*!< Category of errors that can only occur during attempted
951      * translation from one Level/Version of SBML to another.  This
952      * particular category applies to errors encountered while trying to
953      * convert a model to SBML Level&nbsp;2 Version&nbsp;1. */
954 
955   , LIBSBML_CAT_SBML_L2V2_COMPAT
956     /*!< Category of errors that can only occur during attempted
957      * translation from one Level/Version of SBML to another.  This
958      * particular category applies to errors encountered while trying to
959      * convert a model to SBML Level&nbsp;2 Version&nbsp;2. */
960 
961   , LIBSBML_CAT_GENERAL_CONSISTENCY
962     /*!< Category of errors that can occur while validating general SBML
963      * constructs.  With respect to the SBML specification, these concern
964      * failures in applying the validation rules numbered 2xxxx in the
965      * Level&nbsp;2 Versions&nbsp;2&ndash;4
966      * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications. */
967 
968   , LIBSBML_CAT_IDENTIFIER_CONSISTENCY
969     /*!< Category of errors that can occur while validating symbol
970      * identifiers in a model.  With respect to the SBML specification,
971      * these concern failures in applying the validation rules numbered
972      * 103xx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
973      * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications. */
974 
975   , LIBSBML_CAT_UNITS_CONSISTENCY
976     /*!< Category of errors that can occur while validating the units of
977      * measurement on quantities in a model.  With respect to the SBML
978      * specification, these concern failures in applying the validation
979      * rules numbered 105xx in the Level&nbsp;2 Versions&nbsp;2&ndash;4
980      * and Level&nbsp;3 Versions&nbsp;1&ndash;2
981      * specifications. */
982 
983   , LIBSBML_CAT_MATHML_CONSISTENCY
984     /*!< Category of errors that can occur while validating MathML formulas
985      * in a model.  With respect to the SBML specification, these concern
986      * failures in applying the validation rules numbered 102xx in the
987      * Level&nbsp;2 Versions&nbsp;2&ndash;4
988      * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications. */
989 
990   , LIBSBML_CAT_SBO_CONSISTENCY
991     /*!< Category of errors that can occur while validating SBO identifiers
992      * in a model.  With respect to the SBML specification, these concern
993      * failures in applying the validation rules numbered 107xx in the
994      * Level&nbsp;2 Versions&nbsp;2&ndash;4
995      * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications. */
996 
997   , LIBSBML_CAT_OVERDETERMINED_MODEL
998     /*!< Error in the system of equations in the model: the system is
999      * overdetermined, therefore violating a tenet of proper SBML.  With
1000      * respect to the SBML specification, this is validation rule #10601 in
1001      * the SBML Level&nbsp;2 Versions&nbsp;2&ndash;4
1002      * and Level&nbsp;3 Versions&nbsp;1&ndash;2 specifications. */
1003 
1004   , LIBSBML_CAT_SBML_L2V3_COMPAT
1005     /*!< Category of errors that can only occur during attempted
1006      * translation from one Level/Version of SBML to another.  This
1007      * particular category applies to errors encountered while trying to
1008      * convert a model to SBML Level&nbsp;2 Version&nbsp;3. */
1009 
1010   , LIBSBML_CAT_MODELING_PRACTICE
1011     /*!< Category of warnings about recommended good practices involving
1012      * SBML and computational modeling.  (These are tests performed by
1013      * libSBML and do not have equivalent SBML validation rules.) */
1014 
1015   , LIBSBML_CAT_INTERNAL_CONSISTENCY
1016     /*!< Category of errors that can occur while validating libSBML's
1017      * internal representation of SBML constructs. (These are tests
1018      * performed by libSBML and do not have equivalent SBML validation
1019      * rules.)  */
1020 
1021   , LIBSBML_CAT_SBML_L2V4_COMPAT
1022     /*!< Category of errors that can only occur during attempted
1023      * translation from one Level/Version of SBML to another.  This
1024      * particular category applies to errors encountered while trying to
1025      * convert a model to SBML Level&nbsp;2 Version&nbsp;4. */
1026 
1027   , LIBSBML_CAT_SBML_L3V1_COMPAT
1028     /*!< Category of errors that can only occur during attempted
1029      * translation from one Level/Version of SBML to another.  This
1030      * particular category applies to errors encountered while trying to
1031      * convert a model to SBML Level&nbsp;3 Version&nbsp;1. */
1032 
1033   , LIBSBML_CAT_SBML_L3V2_COMPAT
1034     /*!< Category of errors that can only occur during attempted
1035      * translation from one Level/Version of SBML to another.  This
1036      * particular category applies to errors encountered while trying to
1037      * convert a model to SBML Level&nbsp;3 Version&nbsp;1. */
1038 
1039   , LIBSBML_CAT_SBML_COMPATIBILITY
1040     /*!< Category of errors that can only occur during attempted
1041      * translation from one Level/Version of SBML to another. */
1042 
1043 } SBMLErrorCategory_t;
1044 
1045 
1046 /**
1047  * @enum SBMLErrorSeverity_t
1048  * Severity codes for SBMLError diagnostics.
1049  *
1050  * The only publicly-reported values of this type are the four from #XMLErrorSeverity_t.
1051  * All other values are used internally only, with translation of those
1052  * codes done in SBMLError.cpp
1053  *
1054  * @see XMLErrorSeverity_t
1055  */
1056 typedef enum
1057 {
1058   /** @cond doxygenLibsbmlInternal **/
1059 
1060   /* The following are used internally in SBMLErrorTable, but publicly,
1061    * we only report one of the 4 XMLError_Severity values.  Translation
1062    * of the codes is done in SBMLError.cpp.
1063    */
1064 
1065     LIBSBML_SEV_SCHEMA_ERROR    = (LIBSBML_SEV_FATAL + 1)
1066     /*!< The XML content does not conform to
1067      * the relevant version of the SBML XML
1068      * Schema.  The content is not valid SBML. */
1069 
1070   , LIBSBML_SEV_GENERAL_WARNING
1071     /*!< The XML content is invalid for some
1072      * levels/versions of SBML, and while it
1073      * may be valid in others, it is something
1074      * that is best avoided anyway.  LibSBML
1075      * will issue warnings in those cases it
1076      * can recognize. */
1077 
1078   , LIBSBML_SEV_NOT_APPLICABLE
1079     /*!< This error code is only a placeholder
1080      * for errors that have relevance to some
1081      * versions of SBML but not others. */
1082 
1083   , LIBSBML_SEV_UNKNOWN
1084   /*!< This error code is used as the default argument to the SBMLError constructor, so the constructor can know if the caller deliberately set the severity or not. */
1085 
1086   /** @endcond **/
1087 } SBMLErrorSeverity_t;
1088 
1089 END_C_DECLS
1090 LIBSBML_CPP_NAMESPACE_END
1091 
1092 #ifdef __cplusplus
1093 
1094 LIBSBML_CPP_NAMESPACE_BEGIN
1095 
1096 class LIBSBML_EXTERN SBMLError : public XMLError
1097 {
1098 public:
1099 
1100   /**
1101    * Creates a new SBMLError to report that something occurred during SBML
1102    * processing.
1103    *
1104    * When a libSBML operation on SBML content results in a warning, error
1105    * or other diagnostic, the issue is reported as an SBMLError object.
1106    * SBMLError objects have identification numbers to indicate the nature
1107    * of the exception.  @if clike These numbers are drawn from
1108    * the enumeration <a class="el"
1109    * href="#SBMLErrorCode_t">
1110    * SBMLErrorCode_t</a>.  @endif@if java These numbers are
1111    * defined as unsigned integer constants in the file
1112    * "libsbmlConstants.html".  See the <a class="el"
1113    * href="#SBMLErrorCode_t">top of this documentation page</a> for a table
1114    * listing the possible values and their meanings. @endif@if python These
1115    * numbers are defined as unsigned integer constants in the interface
1116    * class @link libsbml libsbml@endlink.  See the <a class="el"
1117    * href="#SBMLErrorCode_t">top of this documentation page</a> for a table
1118    * listing the possible values and their meanings. @endif@~ The argument
1119    * @p errorId to this constructor @em can be (but does not have to be) a
1120    * value from this @if clike enumeration. If it @em is a value
1121    * from <a class="el" href="#SBMLErrorCode_t">SBMLErrorCode_t</a>, the
1122    * SBMLError class assumes the error is a low-level system or SBML layer
1123    * error and <em>prepends</em> a built-in, predefined error message to
1124    * any string passed in the argument @p details to this constructor.  In
1125    * addition, all <a class="el"
1126    * href="#SBMLErrorCode_t">SBMLErrorCode_t</a> errors have associated
1127    * values for the @p severity and @p category codes, and these fields are
1128    * filled-in as well from the enumerations <a class="el"
1129    * href="#SBMLErrorSeverity_t">SBMLErrorSeverity_t</a> and <a class="el"
1130    * href="#SBMLErrorCategory_t">SBMLErrorCategory_t</a>,
1131    * respectively. @else set of constants.  If it @em
1132    * is one of the predefined error identifiers, the SBMLError class
1133    * assumes the error is a low-level system or SBML layer error and
1134    * <em>prepends</em> a built-in, predefined error message to any string
1135    * passed in the argument @p details to this constructor.  In addition,
1136    * all the predefined error identifiers have associated values for the
1137    * @p severity and @p category codes, and these fields are filled-in using
1138    * the libSBML defaults for each different error identifier. @endif@~
1139    *
1140    * If the error identifier @p errorId is a number greater than 99999, the
1141    * SBMLError class assumes the error was generated from another part of
1142    * the software and does not do additional filling in of values beyond
1143    * the default in the constructor itself.  This allows SBMLError to serve
1144    * as a base class for other errors, such as for user-defined validation
1145    * rules (see Validator).  Callers should fill in all the parameters with
1146    * suitable values if generating errors with codes greater than 99999 to
1147    * make maximum use of the SBMLError facilities.
1148    *
1149    * @if clike As mentioned above, there are two other
1150    * enumerations, <a class="el"
1151    * href="#SBMLErrorSeverity_t">SBMLErrorSeverity_t</a> and <a class="el"
1152    * href="#SBMLErrorCategory_t">SBMLErrorCategory_t</a>, used for indicating
1153    * the severity and category of error for the predefined SBMLError codes.
1154    * The values passed in @p severity and @p category override the defaults
1155    * assigned based on the error code.  If the value of @p errorId is a
1156    * value from <a class="el" href="#SBMLErrorCode_t">SBMLErrorCode_t</a>,
1157    * callers do not need to fill in @p severity and @p category.
1158    * Conversely, if @p errorId is not a value from <a class="el"
1159    * href="#SBMLErrorCode_t">SBMLErrorCode_t</a>, callers can use other
1160    * values (not just those from <a class="el"
1161    * href="#SBMLErrorSeverity_t">SBMLErrorSeverity_t</a> and <a class="el"
1162    * href="#SBMLErrorCategory_t">SBMLErrorCategory_t</a>, but their own
1163    * special values) for @p severity and
1164    * @p category. @else As mentioned above,
1165    * there are additional constants defined for <a class="el"
1166    * href="#SBMLErrorSeverity_t">standard severity</a> and <a class="el"
1167    * href="#SBMLErrorCategory_t">standard category</a> codes, and every predefined
1168    * error in libSBML has an associated value for severity and category taken
1169    * from these predefined sets.  These constants have symbol names
1170    * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>,
1171    * respectively.  If the value of @p errorId is one of the standard error
1172    * codes, callers do not need to fill in @p severity and @p category in a
1173    * call to this constructor.  Conversely, if @p errorId is not an existing
1174    * SBML-level error code, callers can use other values for @p severity and
1175    * @p category. @endif@~
1176    *
1177    * Please see the top of the documentation for SBMLError for a longer
1178    * discussion of the possible error codes, their meanings, and their
1179    * applicability to different combinations of Level+Version of SBML.
1180    *
1181    * @param errorId an unsigned int, the identification number of the error.
1182    *
1183    * @param level the SBML Level of the SBML model.
1184    *
1185    * @param version the SBML Version within the Level of the SBML model.
1186    *
1187    * @param details a string containing additional details about the error.
1188    * If the error code in @p errorId is one that is recognized by SBMLError,
1189    * the given message is @em appended to a predefined message associated
1190    * with the given code.  If the error code is not recognized, the message
1191    * is stored as-is as the text of the error.
1192    *
1193    * @param line an unsigned int, the line number at which the error occured.
1194    *
1195    * @param column an unsigned int, the column number at which the error occured.
1196    *
1197    * @param severity an integer indicating severity of the error.
1198    *
1199    * @param category an integer indicating the category to which the error
1200    * belongs.
1201    *
1202    * @param package the SBML Level package involved.
1203    *
1204    * @param pkgVersion the version of the @p package.
1205    *
1206    * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif@~
1207    */
1208   SBMLError
1209   (
1210      const unsigned int errorId  = 0
1211    , const unsigned int level    = SBML_DEFAULT_LEVEL
1212    , const unsigned int version  = SBML_DEFAULT_VERSION
1213    , const std::string details  = ""
1214    , const unsigned int line     = 0
1215    , const unsigned int column   = 0
1216    , const unsigned int severity = LIBSBML_SEV_UNKNOWN
1217    , const unsigned int category = LIBSBML_CAT_SBML
1218    , const std::string package  = "core"
1219    , const unsigned int pkgVersion = 1
1220   );
1221 
1222 
1223   /**
1224    * Copy constructor; creates a copy of this SBMLError.
1225    *
1226    * @param orig the instance to copy.
1227    */
1228   SBMLError(const SBMLError& orig);
1229 
1230   /**
1231    * Destroys this SBMLError.
1232    */
1233   virtual ~SBMLError();
1234 
1235 
1236 #ifndef SWIG
1237 
1238   /** @cond doxygenLibsbmlInternal **/
1239 
1240   /**
1241    * Creates and returns a deep copy of this SBMLError object.
1242    *
1243    * @return the (deep) copy of this SBMLError object.
1244    */
1245   virtual SBMLError* clone() const;
1246 
1247   /**
1248    * Outputs this SBMLError to stream in the following format (and followed
1249    * by a newline):
1250    *
1251    *   line: (error id) message
1252    *
1253    * @param stream the output stream to write to.
1254    */
1255   virtual void print(std::ostream& stream) const;
1256 
1257   /** @endcond **/
1258 
1259 #endif  /* !SWIG */
1260 
1261 protected:
1262   /** @cond doxygenLibsbmlInternal **/
1263 
1264   virtual std::string stringForSeverity(unsigned int code) const;
1265   virtual std::string stringForCategory(unsigned int code) const;
1266 
1267   void adjustErrorId(unsigned int offset);
1268 
1269   /** @endcond **/
1270 };
1271 
1272 LIBSBML_CPP_NAMESPACE_END
1273 
1274 #endif  /* __cplusplus */
1275 #endif /* SBMLError_h */
1276