60#ifndef guWhiteboard_FilteredArrayOneDimObjects_h
61#define guWhiteboard_FilteredArrayOneDimObjects_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_FilteredArrayOneDimObjects_DEFINED
73#define guWhiteboard_FilteredArrayOneDimObjects_DEFINED
75#undef FilteredArrayOneDimObjects_DEFINED
76#define FilteredArrayOneDimObjects_DEFINED
93 if (t_objects != NULLPTR) {
107 this->init(t_objects);
142 for (
int objects_0_index = 0; objects_0_index < 4; objects_0_index++)
151 return !(*
this == t_other);
161 return !(*
this == t_other);
194#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
204#ifdef USE_WB_FILTERED_ARRAYONEDIMOBJECTS_C_CONVERSION
207 std::string descr = buffer;
210 std::ostringstream ss;
211 bool objects_first =
true;
215 objects_first =
false;
223#ifdef USE_WB_FILTERED_ARRAYONEDIMOBJECTS_C_CONVERSION
226 std::string toString = buffer;
229 std::ostringstream ss;
230 bool objects_first =
true;
234 objects_first =
false;
241#ifdef USE_WB_FILTERED_ARRAYONEDIMOBJECTS_C_CONVERSION
246 char * str_cstr =
const_cast<char *
>(t_str.c_str());
247 size_t temp_length = strlen(str_cstr);
248 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
253 char* var_str = &var_str_buffer[0];
255 char* key = &key_buffer[0];
263 if (index == 0 && str_cstr[0] ==
'{') {
269 for (
int i = index; i < length; i++) {
271 if (bracecount == 0 && str_cstr[i] ==
'=') {
276 if (bracecount == 0 && isspace(str_cstr[i])) {
283 if (bracecount == 0 && str_cstr[i] ==
',') {
287 if (str_cstr[i] ==
'{') {
289 if (bracecount == 1) {
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(
"objects", key)) {
329 int restartIndex = index;
330 index = lastBrace + 1;
336 for (
int i = index; i < length; i++) {
338 if (bracecount == 0 && str_cstr[i] ==
'=') {
343 if (bracecount == 0 && isspace(str_cstr[i])) {
350 if (bracecount == 0 && str_cstr[i] ==
',') {
354 if (str_cstr[i] ==
'{') {
358 if (str_cstr[i] ==
'}') {
360 if (bracecount < 0) {
365 if (i == length - 1) {
369 if (endKey >= startKey && endKey - startKey < length) {
370 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
371 key[(endKey - startKey) + 1] = 0;
375 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
376 var_str[(index - startVar) + 1] = 0;
387 index = restartIndex;
394 }
while(index < length);
Provides a C++ wrapper around wb_filtered_arrayonedimobjects.
void set_objects(const FilteredVisionObject *t_newValue)
std::string description()
FilteredArrayOneDimObjects(const std::string &t_str)
String Constructor.
const FilteredVisionObject & objects(int t_i) const
const FilteredVisionObject * objects() const
void set_objects(const FilteredVisionObject &t_newValue, int t_i)
FilteredArrayOneDimObjects(const struct wb_filtered_vision_object t_objects[4]=NULLPTR)
Create a new FilteredArrayOneDimObjects.
bool operator!=(const FilteredArrayOneDimObjects &t_other) const
FilteredArrayOneDimObjects(const struct wb_filtered_arrayonedimobjects &t_other)
Copy Constructor.
FilteredVisionObject & objects(int t_i)
void from_string(const std::string &t_str)
bool operator==(const FilteredArrayOneDimObjects &t_other) const
FilteredArrayOneDimObjects & operator=(const FilteredArrayOneDimObjects &t_other)
Copy Assignment Operator.
FilteredArrayOneDimObjects(const FilteredArrayOneDimObjects &t_other)
Copy Constructor.
size_t objects_size() const
Provides a C++ wrapper around wb_filtered_vision_object.
void from_string(const std::string &t_str)
The class of landmarks filtered regarding goal sightings.
struct wb_filtered_vision_object objects[4]
the array containing various filtered parts of the goals reported by vision FVO_NUM_OBJECTS =4
WHITEBOARD_POSTER_STRING_CONVERSION.
const char * wb_filtered_arrayonedimobjects_description(const struct wb_filtered_arrayonedimobjects *self, char *descString, size_t bufferSize)
Convert to a description string.
const char * wb_filtered_arrayonedimobjects_to_string(const struct wb_filtered_arrayonedimobjects *self, char *toString, size_t bufferSize)
Convert to a string.
struct wb_filtered_arrayonedimobjects * wb_filtered_arrayonedimobjects_from_string(struct wb_filtered_arrayonedimobjects *self, const char *str)
Convert from a string.
#define FILTERED_ARRAYONEDIMOBJECTS_DESC_BUFFER_SIZE
#define FILTERED_ARRAYONEDIMOBJECTS_OBJECTS_ARRAY_SIZE
WHITEBOARD_POSTER_STRING_CONVERSION.
#define FILTERED_ARRAYONEDIMOBJECTS_TO_STRING_BUFFER_SIZE