Integrated SLAPrint into background processing.

Fixed couple of compiler warnings.
This commit is contained in:
bubnikv 2018-11-08 20:18:40 +01:00
parent 811404d97a
commit bbfbe88a5f
24 changed files with 283 additions and 89 deletions

View file

@ -763,7 +763,7 @@ public:
}
//FIXME this smells, the parent class has the method declared returning (unsigned char&).
bool get_at(size_t i) const { return bool((i < this->values.size()) ? this->values[i] : this->values.front()); }
bool get_at(size_t i) const { return ((i < this->values.size()) ? this->values[i] : this->values.front()) != 0; }
std::string serialize() const override
{
@ -1272,6 +1272,9 @@ public:
int& opt_int(const t_config_option_key &opt_key, unsigned int idx) { return this->option<ConfigOptionInts>(opt_key)->get_at(idx); }
const int opt_int(const t_config_option_key &opt_key, unsigned int idx) const { return dynamic_cast<const ConfigOptionInts*>(this->option(opt_key))->get_at(idx); }
template<typename ENUM>
ENUM opt_enum(const t_config_option_key &opt_key) const { return (ENUM)dynamic_cast<const ConfigOptionEnumGeneric*>(this->option(opt_key))->value; }
bool opt_bool(const t_config_option_key &opt_key) const { return this->option<ConfigOptionBool>(opt_key)->value != 0; }
bool opt_bool(const t_config_option_key &opt_key, unsigned int idx) const { return this->option<ConfigOptionBools>(opt_key)->get_at(idx) != 0; }