60#ifndef guWhiteboard_AdjustPositionConfidence_h
61#define guWhiteboard_AdjustPositionConfidence_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_AdjustPositionConfidence_DEFINED
73#define guWhiteboard_AdjustPositionConfidence_DEFINED
75#undef AdjustPositionConfidence_DEFINED
76#define AdjustPositionConfidence_DEFINED
90 void init(int8_t t_adjustment = 0) {
100 this->init(t_adjustment);
140 return !(*
this == t_other);
150 return !(*
this == t_other);
168#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
178#ifdef USE_WB_ADJUST_POSITION_CONFIDENCE_C_CONVERSION
181 std::string descr = buffer;
184 std::ostringstream ss;
185 ss <<
"adjustment=" <<
static_cast<signed>(this->
adjustment());
191#ifdef USE_WB_ADJUST_POSITION_CONFIDENCE_C_CONVERSION
194 std::string toString = buffer;
197 std::ostringstream ss;
198 ss << static_cast<signed>(this->
adjustment());
203#ifdef USE_WB_ADJUST_POSITION_CONFIDENCE_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(
"adjustment", key)) {
294 }
while(index < length);
Provides a C++ wrapper around wb_adjust_position_confidence.
AdjustPositionConfidence(const std::string &t_str)
String Constructor.
AdjustPositionConfidence & operator=(const AdjustPositionConfidence &t_other)
Copy Assignment Operator.
bool operator!=(const AdjustPositionConfidence &t_other) const
void from_string(const std::string &t_str)
void set_adjustment(const int8_t &t_newValue)
AdjustPositionConfidence(const struct wb_adjust_position_confidence &t_other)
Copy Constructor.
std::string description()
AdjustPositionConfidence(int8_t t_adjustment=0)
Create a new AdjustPositionConfidence.
bool operator==(const AdjustPositionConfidence &t_other) const
const int8_t & adjustment() const
AdjustPositionConfidence(const AdjustPositionConfidence &t_other)
Copy Constructor.
WHITEBOARD_POSTER_STRING_CONVERSION.
int8_t adjustment
Change the confidence as a signed percentage (-100% -> 100%)
const char * wb_adjust_position_confidence_to_string(const struct wb_adjust_position_confidence *self, char *toString, size_t bufferSize)
Convert to a string.
struct wb_adjust_position_confidence * wb_adjust_position_confidence_from_string(struct wb_adjust_position_confidence *self, const char *str)
Convert from a string.
const char * wb_adjust_position_confidence_description(const struct wb_adjust_position_confidence *self, char *descString, size_t bufferSize)
Convert to a description string.
#define ADJUST_POSITION_CONFIDENCE_TO_STRING_BUFFER_SIZE
#define ADJUST_POSITION_CONFIDENCE_DESC_BUFFER_SIZE