tesseract  4.1.1
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 171 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 173 of file params.h.

175  : Param(name, comment, init) {
176  value_ = value;
177  default_ = value;
178  params_vec_ = &(vec->bool_params);
179  vec->bool_params.push_back(this);
180  }
Param(const char *name, const char *comment, bool init)
Definition: params.h:127

◆ ~BoolParam()

tesseract::BoolParam::~BoolParam ( )
inline

Definition at line 181 of file params.h.

181 { ParamUtils::RemoveParam<BoolParam>(this, params_vec_); }

Member Function Documentation

◆ operator bool()

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

Definition at line 182 of file params.h.

182 { return value_; }

◆ operator=()

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

Definition at line 183 of file params.h.

183 { value_ = value; }

◆ ResetFrom()

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

Definition at line 186 of file params.h.

186  {
187  for (int i = 0; i < vec->bool_params.size(); ++i) {
188  if (strcmp(vec->bool_params[i]->name_str(), name_) == 0) {
189  // printf("overriding param %s=%s by =%s\n", name_, value_ ? "true" :
190  // "false", *vec->bool_params[i] ? "true" : "false");
191  value_ = *vec->bool_params[i];
192  break;
193  }
194  }
195  }
const char * name_
Definition: params.h:132

◆ ResetToDefault()

void tesseract::BoolParam::ResetToDefault ( )
inline

Definition at line 185 of file params.h.

185 { value_ = default_; }

◆ set_value()

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

Definition at line 184 of file params.h.

184 { value_ = value; }

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