PDF
AuboStudio SDK  0.6.3
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
 Validates whether the input value is valid.
std::string getMessage (std::string value) override
 Returns a meaningful message in case the value is not valid.

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_ { nullptr }
std::function< std::tuple< double, double, bool, bool >()> range_func_with_flags_ { nullptr }
bool is_min_inclusive_ { true }
bool is_max_inclusive_ { true }

Detailed Description

Definition at line 118 of file input_validator.h.

Constructor & Destructor Documentation

◆ DoubleRangeValidator() [1/3]

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

◆ DoubleRangeValidator() [2/3]

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

◆ DoubleRangeValidator() [3/3]

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

Member Function Documentation

◆ getMessage()

std::string arcs::aubo_scope::DoubleRangeValidator::getMessage ( std::string value)
overridevirtual

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.

◆ isValid()

bool arcs::aubo_scope::DoubleRangeValidator::isValid ( std::string value)
overridevirtual

Validates whether the input value is valid.

Parameters
valueto be validated.
Returns
true if value is valid.

Implements arcs::aubo_scope::InputValidator.

◆ updateValue()

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

Member Data Documentation

◆ is_max_inclusive_

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

Definition at line 143 of file input_validator.h.

◆ is_min_inclusive_

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

Definition at line 142 of file input_validator.h.

◆ max_value_

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

Definition at line 138 of file input_validator.h.

◆ min_value_

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

Definition at line 137 of file input_validator.h.

◆ range_func_

std::function<std::pair<double, double>()> arcs::aubo_scope::DoubleRangeValidator::range_func_ { nullptr }
private

Definition at line 139 of file input_validator.h.

◆ range_func_with_flags_

std::function<std::tuple<double, double, bool, bool>()> arcs::aubo_scope::DoubleRangeValidator::range_func_with_flags_ { nullptr }
private

Definition at line 141 of file input_validator.h.


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