60#ifndef guWhiteboard_MissionPriorityForObstacles_h
61#define guWhiteboard_MissionPriorityForObstacles_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_MissionPriorityForObstacles_DEFINED
73#define guWhiteboard_MissionPriorityForObstacles_DEFINED
75#undef MissionPriorityForObstacles_DEFINED
76#define MissionPriorityForObstacles_DEFINED
92 void init(
bool t_ignore_obstacles =
true) {
102 this->init(t_ignore_obstacles);
142 return !(*
this == t_other);
152 return !(*
this == t_other);
170#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
180#ifdef USE_WB_MISSION_PRIORITY_FOR_OBSTACLES_C_CONVERSION
183 std::string descr = buffer;
186 std::ostringstream ss;
193#ifdef USE_WB_MISSION_PRIORITY_FOR_OBSTACLES_C_CONVERSION
196 std::string toString = buffer;
199 std::ostringstream ss;
205#ifdef USE_WB_MISSION_PRIORITY_FOR_OBSTACLES_C_CONVERSION
210 char * str_cstr =
const_cast<char *
>(t_str.c_str());
211 size_t temp_length = strlen(str_cstr);
212 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
217 char* var_str = &var_str_buffer[0];
219 char* key = &key_buffer[0];
226 if (index == 0 && str_cstr[0] ==
'{') {
232 for (
int i = index; i < length; i++) {
234 if (bracecount == 0 && str_cstr[i] ==
'=') {
239 if (bracecount == 0 && isspace(str_cstr[i])) {
246 if (bracecount == 0 && str_cstr[i] ==
',') {
250 if (str_cstr[i] ==
'{') {
254 if (str_cstr[i] ==
'}') {
256 if (bracecount < 0) {
261 if (i == length - 1) {
265 if (endKey >= startKey && endKey - startKey < length) {
266 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
267 key[(endKey - startKey) + 1] = 0;
271 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
272 var_str[(index - startVar) + 1] = 0;
278 if (strlen(key) > 0) {
279 if (0 == strcmp(
"ignore_obstacles", key)) {
296 }
while(index < length);
Provides a C++ wrapper around wb_mission_priority_for_obstacles.
void from_string(const std::string &t_str)
bool operator==(const MissionPriorityForObstacles &t_other) const
const bool & ignore_obstacles() const
MissionPriorityForObstacles(const std::string &t_str)
String Constructor.
bool operator!=(const MissionPriorityForObstacles &t_other) const
bool & ignore_obstacles()
MissionPriorityForObstacles(const struct wb_mission_priority_for_obstacles &t_other)
Copy Constructor.
void set_ignore_obstacles(const bool &t_newValue)
MissionPriorityForObstacles(const MissionPriorityForObstacles &t_other)
Copy Constructor.
MissionPriorityForObstacles(bool t_ignore_obstacles=true)
Create a new MissionPriorityForObstacles.
MissionPriorityForObstacles & operator=(const MissionPriorityForObstacles &t_other)
Copy Assignment Operator.
std::string description()
WHITEBOARD_POSTER_STRING_CONVERSION.
bool ignore_obstacles
walk ahead with high priority on target so do not deviate because of obstacles detected by sonar.
const char * wb_mission_priority_for_obstacles_to_string(const struct wb_mission_priority_for_obstacles *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_mission_priority_for_obstacles_description(const struct wb_mission_priority_for_obstacles *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_mission_priority_for_obstacles * wb_mission_priority_for_obstacles_from_string(struct wb_mission_priority_for_obstacles *self, const char *str)
Convert from a string.
#define MISSION_PRIORITY_FOR_OBSTACLES_DESC_BUFFER_SIZE
#define MISSION_PRIORITY_FOR_OBSTACLES_TO_STRING_BUFFER_SIZE