60#ifndef guWhiteboard_PixelToRobotRelativeCoord_h
61#define guWhiteboard_PixelToRobotRelativeCoord_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_PixelToRobotRelativeCoord_DEFINED
73#define guWhiteboard_PixelToRobotRelativeCoord_DEFINED
75#undef PixelToRobotRelativeCoord_DEFINED
76#define PixelToRobotRelativeCoord_DEFINED
90 void init(
int t_i = 0) {
107 this->init(t_other.
i());
114 this->init(t_other.
i);
121 this->init(t_other.
i());
129 this->init(t_other.
i);
135 return i() == t_other.
i();
140 return !(*
this == t_other);
150 return !(*
this == t_other);
158 const int &
i()
const
168#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
178#ifdef USE_WB_PIXEL_TO_ROBOT_RELATIVE_COORD_C_CONVERSION
181 std::string descr = buffer;
184 std::ostringstream ss;
185 ss <<
"i=" <<
static_cast<signed>(this->
i());
191#ifdef USE_WB_PIXEL_TO_ROBOT_RELATIVE_COORD_C_CONVERSION
194 std::string toString = buffer;
197 std::ostringstream ss;
198 ss << static_cast<signed>(this->
i());
203#ifdef USE_WB_PIXEL_TO_ROBOT_RELATIVE_COORD_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(
"i", key)) {
287 this->
set_i(
static_cast<int>(atoi(var_str)));
294 }
while(index < length);
Provides a C++ wrapper around wb_pixel_to_robot_relative_coord.
PixelToRobotRelativeCoord(const std::string &t_str)
String Constructor.
PixelToRobotRelativeCoord(int t_i=0)
Create a new PixelToRobotRelativeCoord.
PixelToRobotRelativeCoord & operator=(const PixelToRobotRelativeCoord &t_other)
Copy Assignment Operator.
std::string description()
void from_string(const std::string &t_str)
PixelToRobotRelativeCoord(const struct wb_pixel_to_robot_relative_coord &t_other)
Copy Constructor.
void set_i(const int &t_newValue)
bool operator!=(const PixelToRobotRelativeCoord &t_other) const
PixelToRobotRelativeCoord(const PixelToRobotRelativeCoord &t_other)
Copy Constructor.
bool operator==(const PixelToRobotRelativeCoord &t_other) const
WHITEBOARD_POSTER_STRING_CONVERSION.
const char * wb_pixel_to_robot_relative_coord_to_string(const struct wb_pixel_to_robot_relative_coord *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_pixel_to_robot_relative_coord_description(const struct wb_pixel_to_robot_relative_coord *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_pixel_to_robot_relative_coord * wb_pixel_to_robot_relative_coord_from_string(struct wb_pixel_to_robot_relative_coord *self, const char *str)
Convert from a string.
#define PIXEL_TO_ROBOT_RELATIVE_COORD_TO_STRING_BUFFER_SIZE
#define PIXEL_TO_ROBOT_RELATIVE_COORD_DESC_BUFFER_SIZE