tesseract v5.3.3.20231005
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 287 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 289 of file params.h.

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

◆ ~DoubleParam()

tesseract::DoubleParam::~DoubleParam ( )
inline

Definition at line 296 of file params.h.

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

Member Function Documentation

◆ operator double()

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

Definition at line 299 of file params.h.

299 {
300 return value_;
301 }

◆ operator=()

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

Definition at line 302 of file params.h.

302 {
303 value_ = value;
304 }

◆ ResetFrom()

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

Definition at line 311 of file params.h.

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

◆ ResetToDefault()

void tesseract::DoubleParam::ResetToDefault ( )
inline

Definition at line 308 of file params.h.

308 {
309 value_ = default_;
310 }

◆ set_value()

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

Definition at line 305 of file params.h.

305 {
306 value_ = value;
307 }

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