AuboCaps  0.6.0
arcs::aubo_scope::IntegerRangeValidator Struct Reference

#include <input_validator.h>

Inheritance diagram for arcs::aubo_scope::IntegerRangeValidator:
Collaboration diagram for arcs::aubo_scope::IntegerRangeValidator:

Public Member Functions

 IntegerRangeValidator (int min_value, int max_value)
 
 IntegerRangeValidator (std::function< std::pair< int, int >()> range_func)
 
bool isValid (std::string value) override
 
std::string getMessage (std::string value) override
 Returns a meaningful message in case the value is not valid. More...
 

Private Member Functions

void updateValue ()
 

Private Attributes

int min_value_ { INT_MIN }
 
int max_value_ { INT_MAX }
 
std::function< std::pair< int, int >)> range_func_ { nullptr }
 

Detailed Description

Definition at line 48 of file input_validator.h.

Constructor & Destructor Documentation

arcs::aubo_scope::IntegerRangeValidator::IntegerRangeValidator ( int  min_value,
int  max_value 
)
inline

Definition at line 50 of file input_validator.h.

arcs::aubo_scope::IntegerRangeValidator::IntegerRangeValidator ( std::function< std::pair< int, int >()>  range_func)
inline

Definition at line 55 of file input_validator.h.

Member Function Documentation

std::string arcs::aubo_scope::IntegerRangeValidator::getMessage ( std::string  value)
inlineoverridevirtual

Returns a meaningful message in case the value is not valid.

Parameters
valuethe invalid value. Can be included in the message if it makes sense.
Returns
message.

Implements arcs::aubo_scope::InputValidator.

Definition at line 77 of file input_validator.h.

bool arcs::aubo_scope::IntegerRangeValidator::isValid ( std::string  value)
inlineoverridevirtual
Parameters
valueto be validated.
Returns
true if value is valid.

Implements arcs::aubo_scope::InputValidator.

Definition at line 60 of file input_validator.h.

void arcs::aubo_scope::IntegerRangeValidator::updateValue ( )
inlineprivate

Definition at line 107 of file input_validator.h.

Member Data Documentation

int arcs::aubo_scope::IntegerRangeValidator::max_value_ { INT_MAX }
private

Definition at line 122 of file input_validator.h.

int arcs::aubo_scope::IntegerRangeValidator::min_value_ { INT_MIN }
private

Definition at line 121 of file input_validator.h.

std::function<std::pair<int, int>)> arcs::aubo_scope::IntegerRangeValidator::range_func_ { nullptr }
private

Definition at line 123 of file input_validator.h.


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