tesseract 5.2.0
Loading...
Searching...
No Matches
tesseract::DoubleParam Class Reference

#include <params.h>

Inheritance diagram for tesseract::DoubleParam:
tesseract::Param

Public Member Functions

 DoubleParam (double value, const char *name, const char *comment, bool init, ParamsVectors *vec)
 
 ~DoubleParam ()
 
 operator double () const
 
void operator= (double value)
 
void set_value (double value)
 
void ResetToDefault ()
 
void ResetFrom (const ParamsVectors *vec)
 
- Public Member Functions inherited from tesseract::Param
 ~Param ()=default
 
const char * name_str () const
 
const char * info_str () const
 
bool is_init () const
 
bool is_debug () const
 
bool constraint_ok (SetParamConstraint constraint) const
 

Additional Inherited Members

- Protected Member Functions inherited from tesseract::Param
 Param (const char *name, const char *comment, bool init)
 
- Protected Attributes inherited from tesseract::Param
const char * name_
 
const char * info_
 
bool init_
 
bool debug_
 

Detailed Description

Definition at line 286 of file params.h.

Constructor & Destructor Documentation

◆ DoubleParam()

tesseract::DoubleParam::DoubleParam ( double  value,
const char *  name,
const char *  comment,
bool  init,
ParamsVectors vec 
)
inline

Definition at line 288 of file params.h.

289 : Param(name, comment, init) {
290 value_ = value;
291 default_ = value;
292 params_vec_ = &(vec->double_params);
293 vec->double_params.push_back(this);
294 }
Param(const char *name, const char *comment, bool init)
Definition: params.h:136

◆ ~DoubleParam()

tesseract::DoubleParam::~DoubleParam ( )
inline

Definition at line 295 of file params.h.

295 {
296 ParamUtils::RemoveParam<DoubleParam>(this, params_vec_);
297 }

Member Function Documentation

◆ operator double()

tesseract::DoubleParam::operator double ( ) const
inline

Definition at line 298 of file params.h.

298 {
299 return value_;
300 }

◆ operator=()

void tesseract::DoubleParam::operator= ( double  value)
inline

Definition at line 301 of file params.h.

301 {
302 value_ = value;
303 }

◆ ResetFrom()

void tesseract::DoubleParam::ResetFrom ( const ParamsVectors vec)
inline

Definition at line 310 of file params.h.

310 {
311 for (auto *param : vec->double_params) {
312 if (strcmp(param->name_str(), name_) == 0) {
313 // printf("overriding param %s=%f by =%f\n", name_, value_,
314 // *param);
315 value_ = *param;
316 break;
317 }
318 }
319 }
const char * name_
Definition: params.h:141

◆ ResetToDefault()

void tesseract::DoubleParam::ResetToDefault ( )
inline

Definition at line 307 of file params.h.

307 {
308 value_ = default_;
309 }

◆ set_value()

void tesseract::DoubleParam::set_value ( double  value)
inline

Definition at line 304 of file params.h.

304 {
305 value_ = value;
306 }

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