libNuML 1.1.1
Library for reading / writing NuML documents
NUMLError.h
Go to the documentation of this file.
1/*
2* ****************************************************************************
3* This file is part of libNUML. Please visit http://code.google.com/p/numl/for more
4* information about NUML, and the latest version of libNUML.
5* Copyright (c) 2013 The University of Manchester.
6*
7* This library is free software; you can redistribute it and/or modify it
8* under the terms of the GNU Lesser General Public License as published
9* by the Free Software Foundation. A copy of the license agreement is
10* provided in the file named "LICENSE.txt" included with this software
11* distribution and also available online as http://www.gnu.org/licenses/lgpl.html
12*
13* Contributors:
14* Joseph O. Dada, The University of Manchester - initial API and implementation
15* ****************************************************************************
16**/
17
24#ifndef NUMLError_h
25#define NUMLError_h
26
27#include <numl/common/extern.h>
28#include <sbml/xml/XMLError.h>
29#include <numl/NUMLNamespaces.h>
30
31
32LIBNUML_CPP_NAMESPACE_BEGIN
34
45typedef enum
46{
47 NUMLUnknownError = 10000
48 , NUMLNotUTF8 = 10101
95 /* Lower bound for additional error codes returned by libNUML but not
96 * defined in NUML specifications. */
97
102 /* L1Compatability */
103
110 /* These are errors checked by libNUML that were never
111 * published in a spec. */
112
118 /* These are internal errors that reverts to 10501. */
119
123 /* Internal consistency checks */
124
127 /* Bounds */
128
134
135
145typedef enum
146{
148
149 LIBNUML_CAT_NUML = (LIBSBML_CPP_NAMESPACE_QUALIFIER LIBSBML_CAT_XML + 1)
174 /* , LIBNUML_CAT_SBO_CONSISTENCY
175 !< Category of errors that can occur while validating SBO identifiers
176 * in a numl objects. With respect to the NUML specification, these concern
177 * failures in applying the validation rules numbered 107xx in the
178 * Level&nbsp;2 Versions&nbsp;2 and&nbsp;3 specifications. */
186
187
195typedef enum
196{
197
198 /* The following are used internally in NUMLErrorTable, but publicly,
199 * we only report one of the 4 XMLError_Severity values. Translation
200 * of the codes is done in NUMLError.cpp.
201 */
202
203 LIBNUML_SEV_ERROR = LIBSBML_CPP_NAMESPACE_QUALIFIER LIBSBML_SEV_ERROR,
204 LIBNUML_SEV_FATAL = LIBSBML_CPP_NAMESPACE_QUALIFIER LIBSBML_SEV_FATAL,
205 LIBNUML_SEV_WARNING = LIBSBML_CPP_NAMESPACE_QUALIFIER LIBSBML_SEV_WARNING,
206
226
228LIBNUML_CPP_NAMESPACE_END
229
230#ifdef __cplusplus
231
232LIBNUML_CPP_NAMESPACE_BEGIN
233
234class LIBNUML_EXTERN NUMLError : public LIBSBML_CPP_NAMESPACE_QUALIFIER XMLError
235{
236public:
237
349 (
350 const unsigned int errorId = 0
351 , const unsigned int level = NUML_DEFAULT_LEVEL
352 , const unsigned int version = NUML_DEFAULT_VERSION
353 , const std::string& details = ""
354 , const unsigned int line = 0
355 , const unsigned int column = 0
356 , const unsigned int severity = LIBNUML_SEV_ERROR
357 , const unsigned int category = LIBNUML_CAT_NUML
358 );
359
363 NUMLError(const NUMLError& orig);
364
365
369 virtual NUMLError* clone() const;
370
371#ifndef SWIG
372
381 virtual void print(std::ostream& stream) const;
382
383
384#endif /* !SWIG */
385
386protected:
387
388 virtual std::string stringForSeverity(unsigned int code) const;
389 virtual std::string stringForCategory(unsigned int code) const;
390
391
392};
393
394LIBNUML_CPP_NAMESPACE_END
395
396#endif /* __cplusplus */
397#endif /* NUMLError_h */
NUMLErrorSeverity_t
Severity codes for NUMLError diagnostics.
Definition: NUMLError.h:196
@ LIBNUML_SEV_GENERAL_WARNING
The XML content is invalid for some levels/versions of NUML, and while it may be valid in others,...
Definition: NUMLError.h:212
@ LIBNUML_SEV_ERROR
Definition: NUMLError.h:203
@ LIBNUML_SEV_FATAL
Definition: NUMLError.h:204
@ LIBNUML_SEV_NOT_APPLICABLE
This error code is only a placeholder for errors that have relevance to some versions of NUML but not...
Definition: NUMLError.h:220
@ LIBNUML_SEV_WARNING
Definition: NUMLError.h:205
@ LIBNUML_SEV_SCHEMA_ERROR
The XML content does not conform to the relevant version of the NUML XML Schema.
Definition: NUMLError.h:207
NUMLErrorCategory_t
Category codes for NUMLError diagnostics.
Definition: NUMLError.h:146
@ LIBNUML_CAT_NUML_L1_COMPAT
Category of errors that can only occur during attempted translation from one Level/Version of NUML to...
Definition: NUMLError.h:152
@ LIBNUML_CAT_IDENTIFIER_CONSISTENCY
Category of errors that can occur while validating symbol identifiers in a numl objects.
Definition: NUMLError.h:169
@ LIBNUML_CAT_INTERNAL_CONSISTENCY
Category of errors that can occur while validating libNUML's internal representation of NUML construc...
Definition: NUMLError.h:179
@ LIBNUML_CAT_NUML_L1V1_COMPAT
Category of errors that can only occur during attempted translation from one Level/Version of NUML to...
Definition: NUMLError.h:158
@ LIBNUML_CAT_NUML
General NUML error not falling into another category below.
Definition: NUMLError.h:149
@ LIBNUML_CAT_GENERAL_CONSISTENCY
Category of errors that can occur while validating general NUML constructs.
Definition: NUMLError.h:163
@ LIBNUML_CAT_INTERNAL
Definition: NUMLError.h:147
NUMLErrorCode_t
Codes for all NUML-level errors and warnings.
Definition: NUMLError.h:46
@ NUMLFunctionDefMathNotLambda
Invalid expression in function definition.
Definition: NUMLError.h:84
@ NUMLAnnotationNotesNotAllowedLevel1
Annotation on <numl> not permitted in NUML Level&#160;1.
Definition: NUMLError.h:79
@ NUMLObseleteSBOTerm
Obsolete sboTerm value.
Definition: NUMLError.h:121
@ NUMLNotesNotInXHTMLNamespace
Notes not placed in XHTML namespace.
Definition: NUMLError.h:72
@ NUMLNotSchemaConformant
Not conformant to NUML XML schema.
Definition: NUMLError.h:50
@ NUMLInvalidApplyCiInLambda
Invalid forward reference in <apply><ci>...</ci></apply> value.
Definition: NUMLError.h:85
@ NUMLInvalidIdSyntax
Invalid identifier syntax.
Definition: NUMLError.h:58
@ NUMLMultipleEventAssignmentsForId
Multiple event assignments for the same variable.
Definition: NUMLError.h:53
@ NUMLStrictUnitsRequiredInL1
NUML Level&#160;1 requires strict unit consistency.
Definition: NUMLError.h:105
@ NUMLAssignRuleCompartmentMismatch
Mismatched units in assignment rule for compartment.
Definition: NUMLError.h:66
@ NUMLMissingModel
Missing model.
Definition: NUMLError.h:80
@ NUMLInvalidRuleOrdering
Invalid ordering of rules.
Definition: NUMLError.h:114
@ NUMLNoTimeSymbolInFunctionDef
<csymbol> for time used within the <math> of a function definition
Definition: NUMLError.h:115
@ NUMLNeedCompartmentIfHaveSpecies
Missing compartment in species definition.
Definition: NUMLError.h:83
@ NUMLEventAssignmentForConstantEntity
Cannot assign to a constant component in an event assignment.
Definition: NUMLError.h:91
@ NUMLGeneralWarningNotSpecified
Unknown error.
Definition: NUMLError.h:93
@ InvalidNUMLLevelVersion
Invalid NUML Level and Version.
Definition: NUMLError.h:113
@ NUMLNotesContainsDOCTYPE
XML DOCTYPE not permitted in notes.
Definition: NUMLError.h:74
@ NUMLMissingOntologyTerms
Missing OntologyTerms.
Definition: NUMLError.h:63
@ NUMLOverdeterminedSystem
Model is overdetermined.
Definition: NUMLError.h:67
@ NUMLStrictUnitsRequiredInL2v1
NUML Level&#160;2 Version&#160;1 requires strict unit consistency.
Definition: NUMLError.h:108
@ NUMLConstraintContainsXMLDecl
XML declarations not permitted in constraint messages.
Definition: NUMLError.h:87
@ NUMLUnrecognisedSBOTerm
Unrecognized sboTerm value.
Definition: NUMLError.h:120
@ NUMLConstraintContainsDOCTYPE
XML DOCTYPE not permitted in constraint messages.
Definition: NUMLError.h:88
@ NUMLInvalidSBOTermSyntax
Invalid sboTerm value syntax.
Definition: NUMLError.h:56
@ NUMLIncorrectOrderInModel
Incorrect ordering of components in model definition.
Definition: NUMLError.h:81
@ NUMLInvalidNamespaceOnNUML
Invalid XML namespace for NUML container.
Definition: NUMLError.h:76
@ NUMLNoConstraintsInL2v1
NUML Level&#160;2 Version&#160;1 does not support constraints.
Definition: NUMLError.h:107
@ NUMLMultipleAssignmentOrRateRules
Multiple rules for the same variable.
Definition: NUMLError.h:52
@ NUMLCannotConvertToL1V1
Cannot convert to NUML Level&#160;1 Version&#160;1.
Definition: NUMLError.h:100
@ NUMLMissingOrInconsistentVersion
Missing or inconsistent value for version attribute.
Definition: NUMLError.h:78
@ LibNUMLAdditionalCodesLowerBound
Lower bound of libNUML-specific codes.
Definition: NUMLError.h:98
@ NUMLMissingAnnotationNamespace
Missing declaration of XML namespace for annotation.
Definition: NUMLError.h:60
@ NUMLInvalidMathElement
Invalid MathML.
Definition: NUMLError.h:51
@ NUMLInvalidRuleSBOTerm
Invalid sboTerm value for rule.
Definition: NUMLError.h:70
@ NUMLInvalidNotesContent
Invalid notes content.
Definition: NUMLError.h:75
@ NUMLNotUTF8
Not UTF8.
Definition: NUMLError.h:48
@ NUMLDuplicateMetaId
Duplicate metaid identifier.
Definition: NUMLError.h:55
@ NUMLEmptyListElement
A given listOf___, if present, cannot be empty.
Definition: NUMLError.h:82
@ NUMLInconsistentArgUnits
Units of arguments to function call do not match function's definition.
Definition: NUMLError.h:65
@ NUMLEventAndAssignmentRuleForId
variable value used in both event assignments and assignment rules
Definition: NUMLError.h:54
@ NUMLUnrecognizedElement
Unrecognized element.
Definition: NUMLError.h:49
@ NUMLConstraintNotInXHTMLNamespace
Constraint message is not in XHTML XML namespace.
Definition: NUMLError.h:86
@ NUMLMissingResultComponents
Missing ResultComponents.
Definition: NUMLError.h:64
@ NUMLDuplicateAnnotationNamespaces
Multiple annotations using same XML namespace.
Definition: NUMLError.h:61
@ NUMLUnknownError
Unknown internal libNUML error.
Definition: NUMLError.h:47
@ NUMLNoEventsInL1
NUML Level&#160;1 does not support events.
Definition: NUMLError.h:104
@ NUMLInvalidModelSBOTerm
Invalid sboTerm value for model.
Definition: NUMLError.h:68
@ NUMLInvalidMetaidSyntax
Invalid metaid value syntax.
Definition: NUMLError.h:57
@ NUMLInvalidUnitIdSyntax
Invalid unit identifier syntax.
Definition: NUMLError.h:59
@ NUMLMissingOrInconsistentLevel
Missing or inconsistent value for level attribute.
Definition: NUMLError.h:77
@ NUMLNamespaceInAnnotation
Invalid use of NUML XML namespace in annotation.
Definition: NUMLError.h:62
@ NUMLCodesUpperBound
99999, the upper bound of all libNUML codes.
Definition: NUMLError.h:129
@ NUMLInvalidConstraintContent
Invalid content for constraint message.
Definition: NUMLError.h:89
@ NUMLOffsetNotValidAttribute
Attribute offset on units only available in NUML Level&#160;2 Version&#160;1.
Definition: NUMLError.h:125
@ NUMLInvalidFunctionDefSBOTerm
Invalid sboTerm value for function definition.
Definition: NUMLError.h:69
@ NUMLInvalidConstraintSBOTerm
Invalid sboTerm value for constraint.
Definition: NUMLError.h:71
@ NUMLNotesContainsXMLDecl
XML declarations not permitted in notes.
Definition: NUMLError.h:73
LIBNUML_CPP_NAMESPACE_BEGIN const unsigned int NUML_DEFAULT_LEVEL
Definition: NUMLNamespaces.h:41
const unsigned int NUML_DEFAULT_VERSION
Definition: NUMLNamespaces.h:42
contains all error information collected
Definition: NUMLError.h:235
#define BEGIN_C_DECLS
Definition: extern.h:112
#define LIBNUML_EXTERN
Begin svn Header.
Definition: extern.h:104
#define END_C_DECLS
Definition: extern.h:113