tesseract  5.0.0
tesseract::Param Class Reference

#include <params.h>

Inheritance diagram for tesseract::Param:
tesseract::BoolParam tesseract::DoubleParam tesseract::IntParam tesseract::StringParam

Public Member Functions

 ~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
 

Protected Member Functions

 Param (const char *name, const char *comment, bool init)
 

Protected Attributes

const char * name_
 
const char * info_
 
bool init_
 
bool debug_
 

Detailed Description

Definition at line 112 of file params.h.

Constructor & Destructor Documentation

◆ ~Param()

tesseract::Param::~Param ( )
default

◆ Param()

tesseract::Param::Param ( const char *  name,
const char *  comment,
bool  init 
)
inlineprotected

Definition at line 136 of file params.h.

137  : name_(name), info_(comment), init_(init) {
138  debug_ = (strstr(name, "debug") != nullptr) || (strstr(name, "display"));
139  }
const char * name_
Definition: params.h:141
const char * info_
Definition: params.h:142

Member Function Documentation

◆ constraint_ok()

bool tesseract::Param::constraint_ok ( SetParamConstraint  constraint) const
inline

Definition at line 128 of file params.h.

128  {
129  return (constraint == SET_PARAM_CONSTRAINT_NONE ||
130  (constraint == SET_PARAM_CONSTRAINT_DEBUG_ONLY && this->is_debug()) ||
131  (constraint == SET_PARAM_CONSTRAINT_NON_DEBUG_ONLY && !this->is_debug()) ||
132  (constraint == SET_PARAM_CONSTRAINT_NON_INIT_ONLY && !this->is_init()));
133  }
@ SET_PARAM_CONSTRAINT_NON_DEBUG_ONLY
Definition: params.h:41
@ SET_PARAM_CONSTRAINT_NONE
Definition: params.h:39
@ SET_PARAM_CONSTRAINT_NON_INIT_ONLY
Definition: params.h:42
@ SET_PARAM_CONSTRAINT_DEBUG_ONLY
Definition: params.h:40
bool is_init() const
Definition: params.h:122
bool is_debug() const
Definition: params.h:125

◆ info_str()

const char* tesseract::Param::info_str ( ) const
inline

Definition at line 119 of file params.h.

119  {
120  return info_;
121  }

◆ is_debug()

bool tesseract::Param::is_debug ( ) const
inline

Definition at line 125 of file params.h.

125  {
126  return debug_;
127  }

◆ is_init()

bool tesseract::Param::is_init ( ) const
inline

Definition at line 122 of file params.h.

122  {
123  return init_;
124  }

◆ name_str()

const char* tesseract::Param::name_str ( ) const
inline

Definition at line 116 of file params.h.

116  {
117  return name_;
118  }

Member Data Documentation

◆ debug_

bool tesseract::Param::debug_
protected

Definition at line 144 of file params.h.

◆ info_

const char* tesseract::Param::info_
protected

Definition at line 142 of file params.h.

◆ init_

bool tesseract::Param::init_
protected

Definition at line 143 of file params.h.

◆ name_

const char* tesseract::Param::name_
protected

Definition at line 141 of file params.h.


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