AuboCaps  0.6.0
arcs::aubo_scope::DoubleRangeValidator Struct Reference

#include <input_validator.h>

Inheritance diagram for arcs::aubo_scope::DoubleRangeValidator:
Collaboration diagram for arcs::aubo_scope::DoubleRangeValidator:

Public Member Functions

 DoubleRangeValidator (double minValue, double maxValue, bool is_min_inclusive=true, bool is_max_inclusive=true)
 
 DoubleRangeValidator (std::function< std::pair< double, double >()> range_func)
 
 DoubleRangeValidator (std::function< std::tuple< double, double, bool, bool >()> 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

double min_value_ { DBL_MIN }
 
double max_value_ { DBL_MAX }
 
std::function< std::pair< double, double >)> range_func_
 
std::function< std::tuple< double, double, bool, bool >)> range_func_with_flags_
 
bool is_min_inclusive_ { true }
 
bool is_max_inclusive_ { true }
 

Detailed Description

Definition at line 194 of file input_validator.h.

Constructor & Destructor Documentation

arcs::aubo_scope::DoubleRangeValidator::DoubleRangeValidator ( double  minValue,
double  maxValue,
bool  is_min_inclusive = true,
bool  is_max_inclusive = true 
)
inline

Definition at line 196 of file input_validator.h.

arcs::aubo_scope::DoubleRangeValidator::DoubleRangeValidator ( std::function< std::pair< double, double >()>  range_func)
inline

Definition at line 205 of file input_validator.h.

arcs::aubo_scope::DoubleRangeValidator::DoubleRangeValidator ( std::function< std::tuple< double, double, bool, bool >()>  range_func)
inline

Definition at line 210 of file input_validator.h.

Member Function Documentation

std::string arcs::aubo_scope::DoubleRangeValidator::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 237 of file input_validator.h.

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

Implements arcs::aubo_scope::InputValidator.

Definition at line 216 of file input_validator.h.

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

Definition at line 274 of file input_validator.h.

Member Data Documentation

bool arcs::aubo_scope::DoubleRangeValidator::is_max_inclusive_ { true }
private

Definition at line 305 of file input_validator.h.

bool arcs::aubo_scope::DoubleRangeValidator::is_min_inclusive_ { true }
private

Definition at line 304 of file input_validator.h.

double arcs::aubo_scope::DoubleRangeValidator::max_value_ { DBL_MAX }
private

Definition at line 300 of file input_validator.h.

double arcs::aubo_scope::DoubleRangeValidator::min_value_ { DBL_MIN }
private

Definition at line 299 of file input_validator.h.

std::function<std::pair<double, double>)> arcs::aubo_scope::DoubleRangeValidator::range_func_
private

Definition at line 301 of file input_validator.h.

std::function<std::tuple<double, double, bool, bool>)> arcs::aubo_scope::DoubleRangeValidator::range_func_with_flags_
private

Definition at line 303 of file input_validator.h.


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