tesseract v5.3.3.20231005
tesseract::BoolParam Class Reference

#include <params.h>

Inheritance diagram for tesseract::BoolParam:
tesseract::Param

Public Member Functions

 BoolParam (bool value, const char *name, const char *comment, bool init, ParamsVectors *vec)
 
 ~BoolParam ()
 
 operator bool () const
 
void operator= (bool value)
 
void set_value (bool 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 190 of file params.h.

Constructor & Destructor Documentation

◆ BoolParam()

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

Definition at line 192 of file params.h.

193 : Param(name, comment, init) {
194 value_ = value;
195 default_ = value;
196 params_vec_ = &(vec->bool_params);
197 vec->bool_params.push_back(this);
198 }
int value
Param(const char *name, const char *comment, bool init)
Definition: params.h:137

◆ ~BoolParam()

tesseract::BoolParam::~BoolParam ( )
inline

Definition at line 199 of file params.h.

199 {
200 ParamUtils::RemoveParam<BoolParam>(this, params_vec_);
201 }

Member Function Documentation

◆ operator bool()

tesseract::BoolParam::operator bool ( ) const
inline

Definition at line 202 of file params.h.

202 {
203 return value_;
204 }

◆ operator=()

void tesseract::BoolParam::operator= ( bool  value)
inline

Definition at line 205 of file params.h.

205 {
206 value_ = value;
207 }

◆ ResetFrom()

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

Definition at line 214 of file params.h.

214 {
215 for (auto *param : vec->bool_params) {
216 if (strcmp(param->name_str(), name_) == 0) {
217 // printf("overriding param %s=%s by =%s\n", name_, value_ ? "true" :
218 // "false", *param ? "true" : "false");
219 value_ = *param;
220 break;
221 }
222 }
223 }
const char * name_
Definition: params.h:142

◆ ResetToDefault()

void tesseract::BoolParam::ResetToDefault ( )
inline

Definition at line 211 of file params.h.

211 {
212 value_ = default_;
213 }

◆ set_value()

void tesseract::BoolParam::set_value ( bool  value)
inline

Definition at line 208 of file params.h.

208 {
209 value_ = value;
210 }

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