libSBML C++ API
5.18.0
|
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
LibSBML implements facilities for verifying that a given SBML document is valid according to the SBML specifications; it also exposes the validation interface so that user programs and SBML Level 3 package authors may use the facilities to implement new validators. There are two main interfaces to libSBML's validation facilities, based on the classes Validator and SBMLValidator.
The Validator class is the basis of the system for validating an SBML document against the validation rules defined in the SBML specifications. The scheme used by Validator relies is compact and uses the visitor programming pattern, but it relies on C/C++ features and is not directly accessible from language bindings. SBMLValidator offers a framework for straightforward class-based extensibility, so that user code can subclass SBMLValidator to implement new validation systems, different validators can be introduced or turned off at run-time, and interfaces can be provided in the libSBML language bindings. SBMLValidator can call Validator functionality internally (as is the case in the current implementation of SBMLInternalValidator) or use entirely different implementation approaches, as necessary.
Public Member Functions | |
virtual void | addConstraint (VConstraint *c) |
Adds the given VContraint object to this validator. More... | |
void | clearFailures () |
Clears this Validator's list of validation failures. More... | |
unsigned int | getCategory () const |
Get the category of validation rules covered by this validator. More... | |
const std::list< SBMLError > & | getFailures () const |
Get the list of SBMLError objects logged during validator execution. More... | |
virtual void | init ()=0 |
Initializes this Validator object. More... | |
void | logFailure (const SBMLError &err) |
Adds the given failure to this list of validation failures. More... | |
virtual unsigned int | validate (const SBMLDocument &d) |
Validates the given SBML document. More... | |
virtual unsigned int | validate (const std::string &filename) |
Validates the SBML document located at the given file name. More... | |
Validator (SBMLErrorCategory_t category=LIBSBML_CAT_SBML) | |
Constructor; creates a new Validator object for the given category of validation. More... | |
virtual | ~Validator () |
Destroys this Validator object. More... | |
Validator::Validator | ( | SBMLErrorCategory_t | category = LIBSBML_CAT_SBML | ) |
Constructor; creates a new Validator object for the given category of validation.
category | code indicating the kind of validations that this validator will perform. The category code value must be taken from the enumeration SBMLErrorCategory_t |
|
virtual |
Destroys this Validator object.
|
virtual |
Adds the given VContraint object to this validator.
c | the VConstraint ("validator constraint") object to add. |
Reimplemented in QualValidator, GroupsValidator, LayoutValidator, RenderValidator, MultiValidator, CompValidator, and FbcValidator.
void Validator::clearFailures | ( | ) |
unsigned int Validator::getCategory | ( | ) | const |
Get the category of validation rules covered by this validator.
const std::list< SBMLError > & Validator::getFailures | ( | ) | const |
Get the list of SBMLError objects logged during validator execution.
|
pure virtual |
Initializes this Validator object.
When creating a subclass of Validator, override this method to add your own validation code.
Implemented in QualValidator, GroupsValidator, LayoutValidator, RenderValidator, MultiValidator, CompValidator, and FbcValidator.
void Validator::logFailure | ( | const SBMLError & | err | ) |
Adds the given failure to this list of validation failures.
This method can be used in the implementation of custom validators.
err | the SBMLError object to append. |
|
virtual |
Validates the given SBML document.
d | the SBMLDocument object to be validated. |
Reimplemented in QualValidator, GroupsValidator, LayoutValidator, RenderValidator, MultiValidator, CompValidator, and FbcValidator.
|
virtual |
Validates the SBML document located at the given file name.
filename | the path to the file to be read and validated. |
Reimplemented in QualValidator, GroupsValidator, LayoutValidator, RenderValidator, MultiValidator, CompValidator, and FbcValidator.