60#ifndef guWhiteboard_TemperatureSensors_h
61#define guWhiteboard_TemperatureSensors_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_TemperatureSensors_DEFINED
73#define guWhiteboard_TemperatureSensors_DEFINED
75#undef TemperatureSensors_DEFINED
76#define TemperatureSensors_DEFINED
90 void init(
bool t_LKneePitch =
false,
bool t_LAnklePitch =
false,
bool t_LAnkleRoll =
false,
bool t_RKneePitch =
false,
bool t_RAnklePitch =
false,
bool t_RAnkleRoll =
false) {
104 TemperatureSensors(
bool t_LKneePitch =
false,
bool t_LAnklePitch =
false,
bool t_LAnkleRoll =
false,
bool t_RKneePitch =
false,
bool t_RAnklePitch =
false,
bool t_RAnkleRoll =
false) {
105 this->init(t_LKneePitch, t_LAnklePitch, t_LAnkleRoll, t_RKneePitch, t_RAnklePitch, t_RAnkleRoll);
150 return !(*
this == t_other);
160 return !(*
this == t_other);
253#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
263#ifdef USE_WB_TEMPERATURE_SENSORS_C_CONVERSION
266 std::string descr = buffer;
269 std::ostringstream ss;
270 ss <<
"LKneePitch=" << (this->
LKneePitch() ?
"true" :
"false");
272 ss <<
"LAnklePitch=" << (this->
LAnklePitch() ?
"true" :
"false");
274 ss <<
"LAnkleRoll=" << (this->
LAnkleRoll() ?
"true" :
"false");
276 ss <<
"RKneePitch=" << (this->
RKneePitch() ?
"true" :
"false");
278 ss <<
"RAnklePitch=" << (this->
RAnklePitch() ?
"true" :
"false");
280 ss <<
"RAnkleRoll=" << (this->
RAnkleRoll() ?
"true" :
"false");
286#ifdef USE_WB_TEMPERATURE_SENSORS_C_CONVERSION
289 std::string toString = buffer;
292 std::ostringstream ss;
293 ss << (this->
LKneePitch() ?
"true" :
"false");
297 ss << (this->
LAnkleRoll() ?
"true" :
"false");
299 ss << (this->
RKneePitch() ?
"true" :
"false");
303 ss << (this->
RAnkleRoll() ?
"true" :
"false");
308#ifdef USE_WB_TEMPERATURE_SENSORS_C_CONVERSION
313 char * str_cstr =
const_cast<char *
>(t_str.c_str());
314 size_t temp_length = strlen(str_cstr);
315 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
320 char* var_str = &var_str_buffer[0];
322 char* key = &key_buffer[0];
329 if (index == 0 && str_cstr[0] ==
'{') {
335 for (
int i = index; i < length; i++) {
337 if (bracecount == 0 && str_cstr[i] ==
'=') {
342 if (bracecount == 0 && isspace(str_cstr[i])) {
349 if (bracecount == 0 && str_cstr[i] ==
',') {
353 if (str_cstr[i] ==
'{') {
357 if (str_cstr[i] ==
'}') {
359 if (bracecount < 0) {
364 if (i == length - 1) {
368 if (endKey >= startKey && endKey - startKey < length) {
369 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
370 key[(endKey - startKey) + 1] = 0;
374 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
375 var_str[(index - startVar) + 1] = 0;
381 if (strlen(key) > 0) {
382 if (0 == strcmp(
"LKneePitch", key)) {
384 }
else if (0 == strcmp(
"LAnklePitch", key)) {
386 }
else if (0 == strcmp(
"LAnkleRoll", key)) {
388 }
else if (0 == strcmp(
"RKneePitch", key)) {
390 }
else if (0 == strcmp(
"RAnklePitch", key)) {
392 }
else if (0 == strcmp(
"RAnkleRoll", key)) {
402 this->
set_LKneePitch(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
407 this->
set_LAnklePitch(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
412 this->
set_LAnkleRoll(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
417 this->
set_RKneePitch(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
422 this->
set_RAnklePitch(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
427 this->
set_RAnkleRoll(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
434 }
while(index < length);
Provides a C++ wrapper around wb_temperature_sensors.
TemperatureSensors(bool t_LKneePitch=false, bool t_LAnklePitch=false, bool t_LAnkleRoll=false, bool t_RKneePitch=false, bool t_RAnklePitch=false, bool t_RAnkleRoll=false)
Create a new TemperatureSensors.
std::string description()
void set_RAnkleRoll(const bool &t_newValue)
const bool & RAnklePitch() const
TemperatureSensors & operator=(const TemperatureSensors &t_other)
Copy Assignment Operator.
TemperatureSensors(const struct wb_temperature_sensors &t_other)
Copy Constructor.
void set_LAnklePitch(const bool &t_newValue)
const bool & LAnklePitch() const
const bool & LAnkleRoll() const
const bool & RKneePitch() const
void set_LAnkleRoll(const bool &t_newValue)
const bool & LKneePitch() const
TemperatureSensors(const std::string &t_str)
String Constructor.
const bool & RAnkleRoll() const
void set_LKneePitch(const bool &t_newValue)
bool operator==(const TemperatureSensors &t_other) const
void set_RAnklePitch(const bool &t_newValue)
TemperatureSensors(const TemperatureSensors &t_other)
Copy Constructor.
bool operator!=(const TemperatureSensors &t_other) const
void set_RKneePitch(const bool &t_newValue)
void from_string(const std::string &t_str)
WHITEBOARD_POSTER_STRING_CONVERSION.
bool RAnkleRoll
Is the right ankle roll overheating.
bool LAnklePitch
Is the left ankle pitch overheating.
bool LAnkleRoll
Is the left ankle roll overheating.
bool LKneePitch
Is the left knee pitch overheating.
bool RKneePitch
Is the right knee pitch overheating.
bool RAnklePitch
Is the right ankle pitch overheating.
const char * wb_temperature_sensors_to_string(const struct wb_temperature_sensors *self, char *toString, size_t bufferSize)
Convert to a string.
struct wb_temperature_sensors * wb_temperature_sensors_from_string(struct wb_temperature_sensors *self, const char *str)
Convert from a string.
const char * wb_temperature_sensors_description(const struct wb_temperature_sensors *self, char *descString, size_t bufferSize)
Convert to a description string.
#define TEMPERATURE_SENSORS_TO_STRING_BUFFER_SIZE
#define TEMPERATURE_SENSORS_DESC_BUFFER_SIZE