60#ifndef guWhiteboard_SensorsHeadSensors_h
61#define guWhiteboard_SensorsHeadSensors_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_SensorsHeadSensors_DEFINED
73#define guWhiteboard_SensorsHeadSensors_DEFINED
75#undef SensorsHeadSensors_DEFINED
76#define SensorsHeadSensors_DEFINED
90 void init(
bool t_Head_Touch_Front =
true,
bool t_Head_Touch_Middle =
true,
bool t_Head_Touch_Rear =
true) {
101 SensorsHeadSensors(
bool t_Head_Touch_Front =
true,
bool t_Head_Touch_Middle =
true,
bool t_Head_Touch_Rear =
true) {
102 this->init(t_Head_Touch_Front, t_Head_Touch_Middle, t_Head_Touch_Rear);
144 return !(*
this == t_other);
154 return !(*
this == t_other);
202#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
212#ifdef USE_WB_SENSORS_HEAD_SENSORS_C_CONVERSION
215 std::string descr = buffer;
218 std::ostringstream ss;
223 ss <<
"Head_Touch_Rear=" << (this->
Head_Touch_Rear() ?
"true" :
"false");
229#ifdef USE_WB_SENSORS_HEAD_SENSORS_C_CONVERSION
232 std::string toString = buffer;
235 std::ostringstream ss;
245#ifdef USE_WB_SENSORS_HEAD_SENSORS_C_CONVERSION
250 char * str_cstr =
const_cast<char *
>(t_str.c_str());
251 size_t temp_length = strlen(str_cstr);
252 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
257 char* var_str = &var_str_buffer[0];
259 char* key = &key_buffer[0];
266 if (index == 0 && str_cstr[0] ==
'{') {
272 for (
int i = index; i < length; i++) {
274 if (bracecount == 0 && str_cstr[i] ==
'=') {
279 if (bracecount == 0 && isspace(str_cstr[i])) {
286 if (bracecount == 0 && str_cstr[i] ==
',') {
290 if (str_cstr[i] ==
'{') {
294 if (str_cstr[i] ==
'}') {
296 if (bracecount < 0) {
301 if (i == length - 1) {
305 if (endKey >= startKey && endKey - startKey < length) {
306 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
307 key[(endKey - startKey) + 1] = 0;
311 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
312 var_str[(index - startVar) + 1] = 0;
318 if (strlen(key) > 0) {
319 if (0 == strcmp(
"Head_Touch_Front", key)) {
321 }
else if (0 == strcmp(
"Head_Touch_Middle", key)) {
323 }
else if (0 == strcmp(
"Head_Touch_Rear", key)) {
350 }
while(index < length);
Provides a C++ wrapper around wb_sensors_head_sensors.
const bool & Head_Touch_Middle() const
void set_Head_Touch_Middle(const bool &t_newValue)
void from_string(const std::string &t_str)
std::string description()
bool operator!=(const SensorsHeadSensors &t_other) const
bool & Head_Touch_Middle()
const bool & Head_Touch_Rear() const
const bool & Head_Touch_Front() const
bool operator==(const SensorsHeadSensors &t_other) const
SensorsHeadSensors(const struct wb_sensors_head_sensors &t_other)
Copy Constructor.
SensorsHeadSensors & operator=(const SensorsHeadSensors &t_other)
Copy Assignment Operator.
SensorsHeadSensors(bool t_Head_Touch_Front=true, bool t_Head_Touch_Middle=true, bool t_Head_Touch_Rear=true)
Create a new SensorsHeadSensors.
SensorsHeadSensors(const std::string &t_str)
String Constructor.
void set_Head_Touch_Rear(const bool &t_newValue)
SensorsHeadSensors(const SensorsHeadSensors &t_other)
Copy Constructor.
void set_Head_Touch_Front(const bool &t_newValue)
bool & Head_Touch_Front()
WHITEBOARD_POSTER_STRING_CONVERSION.
bool Head_Touch_Rear
state of the back capacitive sensor located on top of the head, on / off.
bool Head_Touch_Front
state of the front capacitive sensor located on top of the head, on / off.
bool Head_Touch_Middle
state of the middle capacitive sensor located on top of the head, on / off.
const char * wb_sensors_head_sensors_description(const struct wb_sensors_head_sensors *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_sensors_head_sensors * wb_sensors_head_sensors_from_string(struct wb_sensors_head_sensors *self, const char *str)
Convert from a string.
const char * wb_sensors_head_sensors_to_string(const struct wb_sensors_head_sensors *self, char *toString, size_t bufferSize)
Convert to a string.
#define SENSORS_HEAD_SENSORS_DESC_BUFFER_SIZE
#define SENSORS_HEAD_SENSORS_TO_STRING_BUFFER_SIZE