libSBML Perl API  libSBML 5.17.2 Perl API
RenderValidator Class Referenceabstract
Inheritance diagram for RenderValidator:
[legend]

Detailed Description

{render}

render Entry point for “render” package validation.

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.

The RenderValidator class extends the Validator class from core libSBML to apply validation to the constructs introduced by the SBML Level 3 Render package. This class then acts as a base class for any validators that apply rules to the “render” package specification constructs or to entire models that use the “render” package, and may therefore be subject to other global restrictions introduced.

Public Member Functions

virtual void addConstraint (VConstraint *c)
 Adds the given VConstraint object to this RenderValidator. 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 RenderValidator object. More...
 
void logFailure (const SBMLError &err)
 Adds the given failure to this list of validation failures. More...
 
 RenderValidator (SBMLErrorCategory_t category=LIBSBML_CAT_SBML)
 Creates a new RenderValidator object for the given category of validation. More...
 
virtual unsigned int validate (const SBMLDocument &d)
 Validates the given SBMLDocument. More...
 
virtual unsigned int validate (const std::string &filename)
 Validates the SBMLDocument located at the given filename. More...
 
virtual ~RenderValidator ()
 Destroys this RenderValidator object. More...
 

Constructor & Destructor Documentation

◆ RenderValidator()

RenderValidator::RenderValidator ( SBMLErrorCategory_t  category = LIBSBML_CAT_SBML)

Creates a new RenderValidator object for the given category of validation.

Parameters
categorycode indicating the type of validation that this validator will perform.

◆ ~RenderValidator()

RenderValidator::~RenderValidator ( )
virtual

Destroys this RenderValidator object.

Member Function Documentation

◆ addConstraint()

void RenderValidator::addConstraint ( VConstraint c)
virtual

Adds the given VConstraint object to this RenderValidator.

Parameters
cthe VConstraint ("validator constraint") object to add.

Reimplemented from Validator.

◆ clearFailures()

void Validator::clearFailures ( )
inherited

Clears this Validator's list of validation failures.

If you are validating multiple SBML documents with the same Validator, call this method after you have processed the list of failures from the last Validation run and before validating the next document.

◆ getCategory()

unsigned int Validator::getCategory ( ) const
inherited

Get the category of validation rules covered by this validator.

Returns
an integer code representing the category of validator rules covered by this validator class. The category values are drawn from the enumeration SBMLErrorCategory_t. See the documentation for the class SBMLError for more information.

◆ getFailures()

const std::list< SBMLError > & Validator::getFailures ( ) const
inherited

Get the list of SBMLError objects logged during validator execution.

Returns
a list of failures logged during validation. The list may be empty if no errors or other diagnostics were logged by the validator.

◆ init()

virtual void RenderValidator::init ( )
pure virtual

Initializes this RenderValidator object.

When creating a subclass of RenderValidator, override this method to add your own validation code.

Implements Validator.

◆ logFailure()

void Validator::logFailure ( const SBMLError err)
inherited

Adds the given failure to this list of validation failures.

This method can be used in the implementation of custom validators.

Parameters
errthe SBMLError object to append.

◆ validate() [1/2]

unsigned int RenderValidator::validate ( const SBMLDocument d)
virtual

Validates the given SBMLDocument.

Parameters
dthe SBMLDocument object to be validated.
Returns
the number of validation failures that occurred. The objects describing the actual failures can be retrieved using getFailures().

Reimplemented from Validator.

◆ validate() [2/2]

unsigned int RenderValidator::validate ( const std::string &  filename)
virtual

Validates the SBMLDocument located at the given filename.

Parameters
filenamethe path to the file to be read and validated.
Returns
the number of validation failures that occurred. The objects describing the actual failures can be retrieved using getFailures().

Reimplemented from Validator.