Caffa  1.1.0
C++ Application Framework for Embedded Systems with introspection
Public Types | Public Member Functions | List of all members
caffa::FieldValidatorInterface Class Referenceabstract

An abstract field validator interface for validating field values. More...

#include <cafFieldValidator.h>

Inheritance diagram for caffa::FieldValidatorInterface:
Inheritance graph
[legend]

Public Types

enum  FailureSeverity { VALIDATOR_WARNING, VALIDATOR_ERROR, VALIDATOR_CRITICAL }
 The severity of failure. Essentially tells the application how to treat a validator failure: VALIDATOR_WARNING -> user warning VALIDATOR_ERROR -> user error VALIDATOR_CRITICAL -> critical application failure.
 

Public Member Functions

 FieldValidatorInterface (FailureSeverity failureSeverity)
 Construct a new Field Validator Interface object. More...
 
virtual void readFromString (const std::string &string)=0
 Read the validator from string. More...
 
virtual std::string writeToString () const =0
 Write the validator tostring. More...
 
FailureSeverity failureSeverity () const
 Get the severity of a failure of the validator. More...
 

Detailed Description

An abstract field validator interface for validating field values.

Constructor & Destructor Documentation

◆ FieldValidatorInterface()

caffa::FieldValidatorInterface::FieldValidatorInterface ( FailureSeverity  failureSeverity)
inline

Construct a new Field Validator Interface object.

Parameters
failureSeveritythe severity of a validation failure

Member Function Documentation

◆ failureSeverity()

FailureSeverity caffa::FieldValidatorInterface::failureSeverity ( ) const
inline

Get the severity of a failure of the validator.

Returns
FailureSeverity

◆ readFromString()

virtual void caffa::FieldValidatorInterface::readFromString ( const std::string &  string)
pure virtual

Read the validator from string.

Parameters
stringthe string to read from

Implemented in caffa::RangeValidator< DataType >.

◆ writeToString()

virtual std::string caffa::FieldValidatorInterface::writeToString ( ) const
pure virtual

Write the validator tostring.

Returns
a string containing the validator info

Implemented in caffa::RangeValidator< DataType >.


The documentation for this class was generated from the following file: