60#ifndef guWhiteboard_Overheating_h
61#define guWhiteboard_Overheating_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_Overheating_DEFINED
73#define guWhiteboard_Overheating_DEFINED
75#undef Overheating_DEFINED
76#define Overheating_DEFINED
90 void init(
bool t_overheating =
false) {
100 this->init(t_overheating);
140 return !(*
this == t_other);
150 return !(*
this == t_other);
168#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
178#ifdef USE_WB_OVERHEATING_C_CONVERSION
181 std::string descr = buffer;
184 std::ostringstream ss;
185 ss <<
"overheating=" << (this->
overheating() ?
"true" :
"false");
191#ifdef USE_WB_OVERHEATING_C_CONVERSION
194 std::string toString = buffer;
197 std::ostringstream ss;
203#ifdef USE_WB_OVERHEATING_C_CONVERSION
208 char * str_cstr =
const_cast<char *
>(t_str.c_str());
209 size_t temp_length = strlen(str_cstr);
210 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
215 char* var_str = &var_str_buffer[0];
217 char* key = &key_buffer[0];
224 if (index == 0 && str_cstr[0] ==
'{') {
230 for (
int i = index; i < length; i++) {
232 if (bracecount == 0 && str_cstr[i] ==
'=') {
237 if (bracecount == 0 && isspace(str_cstr[i])) {
244 if (bracecount == 0 && str_cstr[i] ==
',') {
248 if (str_cstr[i] ==
'{') {
252 if (str_cstr[i] ==
'}') {
254 if (bracecount < 0) {
259 if (i == length - 1) {
263 if (endKey >= startKey && endKey - startKey < length) {
264 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
265 key[(endKey - startKey) + 1] = 0;
269 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
270 var_str[(index - startVar) + 1] = 0;
276 if (strlen(key) > 0) {
277 if (0 == strcmp(
"overheating", key)) {
287 this->
set_overheating(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
294 }
while(index < length);
Provides a C++ wrapper around wb_overheating.
bool operator==(const Overheating &t_other) const
Overheating(const struct wb_overheating &t_other)
Copy Constructor.
std::string description()
bool operator!=(const Overheating &t_other) const
Overheating(const std::string &t_str)
String Constructor.
void set_overheating(const bool &t_newValue)
void from_string(const std::string &t_str)
Overheating(bool t_overheating=false)
Create a new Overheating.
Overheating(const Overheating &t_other)
Copy Constructor.
const bool & overheating() const
Overheating & operator=(const Overheating &t_other)
Copy Assignment Operator.
WHITEBOARD_POSTER_STRING_CONVERSION.
bool overheating
Is the leg sensors on the nao overheating?
const char * wb_overheating_to_string(const struct wb_overheating *self, char *toString, size_t bufferSize)
Convert to a string.
struct wb_overheating * wb_overheating_from_string(struct wb_overheating *self, const char *str)
Convert from a string.
const char * wb_overheating_description(const struct wb_overheating *self, char *descString, size_t bufferSize)
Convert to a description string.
#define OVERHEATING_TO_STRING_BUFFER_SIZE
#define OVERHEATING_DESC_BUFFER_SIZE