basic_types.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <chrono>
4 #include <iostream>
5 #include <functional>
6 #include <string_view>
7 #include <typeinfo>
8 #include <unordered_map>
9 #include <utility>
10 #include <variant>
11 #include <vector>
12 
16 
17 namespace BT
18 {
20 enum class NodeType
21 {
22  UNDEFINED = 0,
23  ACTION,
24  CONDITION,
25  CONTROL,
26  DECORATOR,
27  SUBTREE
28 };
29 
33 enum class NodeStatus
34 {
35  IDLE = 0,
36  RUNNING = 1,
37  SUCCESS = 2,
38  FAILURE = 3,
39  SKIPPED = 4,
40 };
41 
42 inline bool isStatusActive(const NodeStatus& status)
43 {
44  return status != NodeStatus::IDLE && status != NodeStatus::SKIPPED;
45 }
46 
47 inline bool isStatusCompleted(const NodeStatus& status)
48 {
49  return status == NodeStatus::SUCCESS || status == NodeStatus::FAILURE;
50 }
51 
52 enum class PortDirection
53 {
54  INPUT,
55  OUTPUT,
56  INOUT
57 };
58 
60 
61 bool StartWith(StringView str, StringView prefix);
62 
63 bool StartWith(StringView str, char prefix);
64 
65 // vector of key/value pairs
66 using KeyValueVector = std::vector<std::pair<std::string, std::string>>;
67 
84 template <typename T>
85 using Expected = nonstd::expected<T, std::string>;
86 
88 {
89 };
90 
100 [[nodiscard]] Any convertFromJSON(StringView json_text, std::type_index type);
101 
103 template <typename T>
104 [[nodiscard]] inline T convertFromJSON(StringView str)
105 {
106  return convertFromJSON(str, typeid(T)).cast<T>();
107 }
108 
121 template <typename T>
122 [[nodiscard]] inline T convertFromString(StringView str)
123 {
124  // if string starts with "json:{", try to parse it as json
125  if(StartWith(str, "json:"))
126  {
127  str.remove_prefix(5);
128  return convertFromJSON<T>(str);
129  }
130 
131  auto type_name = BT::demangle(typeid(T));
132 
133  std::cerr << "You (maybe indirectly) called BT::convertFromString() for type ["
134  << type_name << "], but I can't find the template specialization.\n"
135  << std::endl;
136 
137  throw LogicError(std::string("You didn't implement the template specialization of "
138  "convertFromString for this type: ") +
139  type_name);
140 }
141 
142 template <>
143 [[nodiscard]] std::string convertFromString<std::string>(StringView str);
144 
145 template <>
146 [[nodiscard]] const char* convertFromString<const char*>(StringView str);
147 
148 template <>
149 [[nodiscard]] int8_t convertFromString<int8_t>(StringView str);
150 
151 template <>
152 [[nodiscard]] int16_t convertFromString<int16_t>(StringView str);
153 
154 template <>
155 [[nodiscard]] int32_t convertFromString<int32_t>(StringView str);
156 
157 template <>
158 [[nodiscard]] int64_t convertFromString<int64_t>(StringView str);
159 
160 template <>
161 [[nodiscard]] uint8_t convertFromString<uint8_t>(StringView str);
162 
163 template <>
164 [[nodiscard]] uint16_t convertFromString<uint16_t>(StringView str);
165 
166 template <>
167 [[nodiscard]] uint32_t convertFromString<uint32_t>(StringView str);
168 
169 template <>
170 [[nodiscard]] uint64_t convertFromString<uint64_t>(StringView str);
171 
172 template <>
173 [[nodiscard]] float convertFromString<float>(StringView str);
174 
175 template <>
176 [[nodiscard]] double convertFromString<double>(StringView str);
177 
178 // Integer numbers separated by the character ";"
179 template <>
180 [[nodiscard]] std::vector<int> convertFromString<std::vector<int>>(StringView str);
181 
182 // Real numbers separated by the character ";"
183 template <>
184 [[nodiscard]] std::vector<double> convertFromString<std::vector<double>>(StringView str);
185 
186 // Strings separated by the character ";"
187 template <>
188 [[nodiscard]] std::vector<std::string>
189 convertFromString<std::vector<std::string>>(StringView str);
190 
191 // This recognizes either 0/1, true/false, TRUE/FALSE
192 template <>
193 [[nodiscard]] bool convertFromString<bool>(StringView str);
194 
195 // Names with all capital letters
196 template <>
198 
199 // Names with all capital letters
200 template <>
202 
203 template <>
205 
206 using StringConverter = std::function<Any(StringView)>;
207 
208 using StringConvertersMap = std::unordered_map<const std::type_info*, StringConverter>;
209 
210 // helper function
211 template <typename T>
213 {
214  if constexpr(std::is_constructible_v<StringView, T>)
215  {
216  return [](StringView str) { return Any(str); };
217  }
218  else if constexpr(std::is_same_v<BT::AnyTypeAllowed, T> || std::is_enum_v<T>)
219  {
220  return {};
221  }
222  else
223  {
224  return [](StringView str) { return Any(convertFromString<T>(str)); };
225  }
226 }
227 
228 template <>
230 {
231  return {};
232 }
233 
234 //------------------------------------------------------------------
235 
236 template <typename T>
237 constexpr bool IsConvertibleToString()
238 {
239  return std::is_convertible_v<T, std::string> ||
240  std::is_convertible_v<T, std::string_view>;
241 }
242 
243 Expected<std::string> toJsonString(const Any& value);
244 
251 template <typename T>
252 [[nodiscard]] std::string toStr(const T& value)
253 {
254  if constexpr(IsConvertibleToString<T>())
255  {
256  return static_cast<std::string>(value);
257  }
258  else if constexpr(!std::is_arithmetic_v<T>)
259  {
260  if(auto str = toJsonString(Any(value)))
261  {
262  return *str;
263  }
264 
265  throw LogicError(StrCat("Function BT::toStr<T>() not specialized for type [",
266  BT::demangle(typeid(T)), "]"));
267  }
268  else
269  {
270  return std::to_string(value);
271  }
272 }
273 
274 template <>
275 [[nodiscard]] std::string toStr<bool>(const bool& value);
276 
277 template <>
278 [[nodiscard]] std::string toStr<std::string>(const std::string& value);
279 
280 template <>
281 [[nodiscard]] std::string toStr<BT::NodeStatus>(const BT::NodeStatus& status);
282 
286 [[nodiscard]] std::string toStr(BT::NodeStatus status, bool colored);
287 
288 std::ostream& operator<<(std::ostream& os, const BT::NodeStatus& status);
289 
290 template <>
291 [[nodiscard]] std::string toStr<BT::NodeType>(const BT::NodeType& type);
292 
293 std::ostream& operator<<(std::ostream& os, const BT::NodeType& type);
294 
295 template <>
296 [[nodiscard]] std::string toStr<BT::PortDirection>(const BT::PortDirection& direction);
297 
298 std::ostream& operator<<(std::ostream& os, const BT::PortDirection& type);
299 
300 // Small utility, unless you want to use <boost/algorithm/string.hpp>
301 [[nodiscard]] std::vector<StringView> splitString(const StringView& strToSplit,
302  char delimeter);
303 
304 template <typename Predicate>
305 using enable_if = typename std::enable_if<Predicate::value>::type*;
306 
307 template <typename Predicate>
308 using enable_if_not = typename std::enable_if<!Predicate::value>::type*;
309 
310 #ifdef USE_BTCPP3_OLD_NAMES
311 // note: we also use the name Optional instead of expected because it is more intuitive
312 // for users that are not up to date with "modern" C++
313 template <typename T>
314 using Optional = nonstd::expected<T, std::string>;
315 #endif
316 
334 
335 struct Timestamp
336 {
337  // Number being incremented every time a new value is written
338  uint64_t seq = 0;
339  // Last update time. Nanoseconds since epoch
340  std::chrono::nanoseconds time = std::chrono::nanoseconds(0);
341 };
342 
343 [[nodiscard]] bool IsAllowedPortName(StringView str);
344 
345 class TypeInfo
346 {
347 public:
348  template <typename T>
349  static TypeInfo Create()
350  {
351  return TypeInfo{ typeid(T), GetAnyFromStringFunctor<T>() };
352  }
353 
354  TypeInfo() : type_info_(typeid(AnyTypeAllowed)), type_str_("AnyTypeAllowed")
355  {}
356 
357  TypeInfo(std::type_index type_info, StringConverter conv)
358  : type_info_(type_info), converter_(conv), type_str_(BT::demangle(type_info))
359  {}
360 
361  [[nodiscard]] const std::type_index& type() const;
362 
363  [[nodiscard]] const std::string& typeName() const;
364 
365  [[nodiscard]] Any parseString(const char* str) const;
366 
367  [[nodiscard]] Any parseString(const std::string& str) const;
368 
369  template <typename T>
370  [[nodiscard]] Any parseString(const T&) const
371  {
372  // avoid compilation errors
373  return {};
374  }
375 
376  [[nodiscard]] bool isStronglyTyped() const
377  {
378  return type_info_ != typeid(AnyTypeAllowed) && type_info_ != typeid(BT::Any);
379  }
380 
381  [[nodiscard]] const StringConverter& converter() const
382  {
383  return converter_;
384  }
385 
386 private:
387  std::type_index type_info_;
389  std::string type_str_;
390 };
391 
392 class PortInfo : public TypeInfo
393 {
394 public:
397  {}
398 
399  PortInfo(PortDirection direction, std::type_index type_info, StringConverter conv)
400  : TypeInfo(type_info, conv), direction_(direction)
401  {}
402 
403  [[nodiscard]] PortDirection direction() const;
404 
406 
407  template <typename T>
408  void setDefaultValue(const T& default_value)
409  {
410  default_value_ = Any(default_value);
411  try
412  {
413  default_value_str_ = BT::toStr(default_value);
414  }
415  catch(LogicError&)
416  {}
417  }
418 
419  [[nodiscard]] const std::string& description() const;
420 
421  [[nodiscard]] const Any& defaultValue() const;
422 
423  [[nodiscard]] const std::string& defaultValueString() const;
424 
425 private:
427  std::string description_;
429  std::string default_value_str_;
430 };
431 
432 template <typename T = AnyTypeAllowed>
433 [[nodiscard]] std::pair<std::string, PortInfo> CreatePort(PortDirection direction,
434  StringView name,
435  StringView description = {})
436 {
437  auto sname = static_cast<std::string>(name);
438  if(!IsAllowedPortName(sname))
439  {
440  throw RuntimeError("The name of a port must not be `name` or `ID` "
441  "and must start with an alphabetic character. "
442  "Underscore is reserved.");
443  }
444 
445  std::pair<std::string, PortInfo> out;
446 
448  {
449  out = { sname, PortInfo(direction) };
450  }
451  else
452  {
453  out = { sname, PortInfo(direction, typeid(T), GetAnyFromStringFunctor<T>()) };
454  }
455  if(!description.empty())
456  {
457  out.second.setDescription(description);
458  }
459  return out;
460 }
461 
462 //----------
468 template <typename T = AnyTypeAllowed>
469 [[nodiscard]] inline std::pair<std::string, PortInfo>
470 InputPort(StringView name, StringView description = {})
471 {
472  return CreatePort<T>(PortDirection::INPUT, name, description);
473 }
474 
480 template <typename T = AnyTypeAllowed>
481 [[nodiscard]] inline std::pair<std::string, PortInfo>
482 OutputPort(StringView name, StringView description = {})
483 {
484  return CreatePort<T>(PortDirection::OUTPUT, name, description);
485 }
486 
492 template <typename T = AnyTypeAllowed>
493 [[nodiscard]] inline std::pair<std::string, PortInfo>
494 BidirectionalPort(StringView name, StringView description = {})
495 {
496  return CreatePort<T>(PortDirection::INOUT, name, description);
497 }
498 //----------
499 
500 namespace details
501 {
502 
503 template <typename T = AnyTypeAllowed, typename DefaultT = T>
504 [[nodiscard]] inline std::pair<std::string, PortInfo>
505 PortWithDefault(PortDirection direction, StringView name, const DefaultT& default_value,
506  StringView description)
507 {
508  static_assert(IsConvertibleToString<DefaultT>() || std::is_convertible_v<T, DefaultT> ||
509  std::is_constructible_v<T, DefaultT>,
510  "The default value must be either the same of the port or string");
511 
512  auto out = CreatePort<T>(direction, name, description);
513 
514  if constexpr(std::is_constructible_v<T, DefaultT>)
515  {
516  out.second.setDefaultValue(T(default_value));
517  }
518  else if constexpr(IsConvertibleToString<DefaultT>())
519  {
520  out.second.setDefaultValue(std::string(default_value));
521  }
522  else
523  {
524  out.second.setDefaultValue(default_value);
525  }
526  return out;
527 }
528 
529 } // end namespace details
530 
538 template <typename T = AnyTypeAllowed, typename DefaultT = T>
539 [[nodiscard]] inline std::pair<std::string, PortInfo>
540 InputPort(StringView name, const DefaultT& default_value, StringView description)
541 {
542  return details::PortWithDefault<T, DefaultT>(PortDirection::INPUT, name, default_value,
543  description);
544 }
545 
553 template <typename T = AnyTypeAllowed, typename DefaultT = T>
554 [[nodiscard]] inline std::pair<std::string, PortInfo>
555 BidirectionalPort(StringView name, const DefaultT& default_value, StringView description)
556 {
557  return details::PortWithDefault<T, DefaultT>(PortDirection::INOUT, name, default_value,
558  description);
559 }
560 
568 template <typename T = AnyTypeAllowed>
569 [[nodiscard]] inline std::pair<std::string, PortInfo> OutputPort(StringView name,
570  StringView default_value,
571  StringView description)
572 {
573  if(default_value.empty() || default_value.front() != '{' || default_value.back() != '}')
574  {
575  throw LogicError("Output port can only refer to blackboard entries, i.e. use the "
576  "syntax '{port_name}'");
577  }
578  auto out = CreatePort<T>(PortDirection::OUTPUT, name, description);
579  out.second.setDefaultValue(default_value);
580  return out;
581 }
582 
583 //----------
584 
585 using PortsList = std::unordered_map<std::string, PortInfo>;
586 
587 template <typename T, typename = void>
588 struct has_static_method_providedPorts : std::false_type
589 {
590 };
591 
592 template <typename T>
594  T, typename std::enable_if<
595  std::is_same<decltype(T::providedPorts()), PortsList>::value>::type>
596  : std::true_type
597 {
598 };
599 
600 template <typename T, typename = void>
601 struct has_static_method_metadata : std::false_type
602 {
603 };
604 
605 template <typename T>
607  T, typename std::enable_if<
608  std::is_same<decltype(T::metadata()), KeyValueVector>::value>::type>
609  : std::true_type
610 {
611 };
612 
613 template <typename T>
614 [[nodiscard]] inline PortsList
616 {
617  return T::providedPorts();
618 }
619 
620 template <typename T>
621 [[nodiscard]] inline PortsList
623 {
624  return {};
625 }
626 
627 using TimePoint = std::chrono::high_resolution_clock::time_point;
628 using Duration = std::chrono::high_resolution_clock::duration;
629 
630 } // namespace BT
BT::PortInfo
Definition: basic_types.h:392
BT
Definition: ex01_wrap_legacy.cpp:29
BT::PortInfo::setDescription
void setDescription(StringView description)
Definition: basic_types.cpp:401
BT::TypeInfo::typeName
const std::string & typeName() const
Definition: basic_types.cpp:378
BT::enable_if
typename std::enable_if< Predicate::value >::type * enable_if
Definition: basic_types.h:305
BT::convertFromString< int32_t >
int32_t convertFromString< int32_t >(StringView str)
Definition: basic_types.cpp:167
BT::demangle
std::string demangle(char const *name)
Definition: demangle_util.h:74
BT::convertFromString< uint64_t >
uint64_t convertFromString< uint64_t >(StringView str)
Definition: basic_types.cpp:131
BT::IsConvertibleToString
constexpr bool IsConvertibleToString()
Definition: basic_types.h:237
BT::PortDirection::INOUT
@ INOUT
exceptions.h
BT::NodeType
NodeType
Enumerates the possible types of nodes.
Definition: basic_types.h:20
BT::Any
Definition: safe_any.hpp:36
BT::toJsonString
Expected< std::string > toJsonString(const Any &value)
Definition: basic_types.cpp:454
BT::toStr< bool >
std::string toStr< bool >(const bool &value)
Definition: basic_types.cpp:31
BT::PortInfo::defaultValueString
const std::string & defaultValueString() const
Definition: basic_types.cpp:416
BT::PortInfo::defaultValue
const Any & defaultValue() const
Definition: basic_types.cpp:411
BT::NodeType::DECORATOR
@ DECORATOR
BT::NodeType::CONDITION
@ CONDITION
BT::Expected
nonstd::expected< T, std::string > Expected
Definition: basic_types.h:85
BT::StringView
std::string_view StringView
Definition: basic_types.h:59
BT::convertFromString< const char * >
const char * convertFromString< const char * >(StringView str)
BT::InputPort
std::pair< std::string, PortInfo > InputPort(StringView name, StringView description={})
Definition: basic_types.h:470
BT::PortInfo::PortInfo
PortInfo(PortDirection direction, std::type_index type_info, StringConverter conv)
Definition: basic_types.h:399
BT::TypeInfo::parseString
Any parseString(const T &) const
Definition: basic_types.h:370
BT::PortInfo::setDefaultValue
void setDefaultValue(const T &default_value)
Definition: basic_types.h:408
BT::GetAnyFromStringFunctor< void >
StringConverter GetAnyFromStringFunctor< void >()
Definition: basic_types.h:229
BT::enable_if_not
typename std::enable_if<!Predicate::value >::type * enable_if_not
Definition: basic_types.h:308
BT::BidirectionalPort
std::pair< std::string, PortInfo > BidirectionalPort(StringView name, StringView description={})
Definition: basic_types.h:494
BT::NodeType::SUBTREE
@ SUBTREE
BT::details::PortWithDefault
std::pair< std::string, PortInfo > PortWithDefault(PortDirection direction, StringView name, const DefaultT &default_value, StringView description)
Definition: basic_types.h:505
BT::TypeInfo::type_str_
std::string type_str_
Definition: basic_types.h:389
BT::TypeInfo::converter
const StringConverter & converter() const
Definition: basic_types.h:381
BT::TimePoint
std::chrono::high_resolution_clock::time_point TimePoint
Definition: basic_types.h:627
BT::LogicError
Definition: exceptions.h:45
magic_enum::detail::value
constexpr E value(std::size_t i) noexcept
Definition: magic_enum.hpp:664
BT::Duration
std::chrono::high_resolution_clock::duration Duration
Definition: basic_types.h:628
BT::TypeInfo::converter_
StringConverter converter_
Definition: basic_types.h:388
BT::PortDirection::OUTPUT
@ OUTPUT
BT::convertFromString< uint16_t >
uint16_t convertFromString< uint16_t >(StringView str)
Definition: basic_types.cpp:179
BT::TypeInfo::type_info_
std::type_index type_info_
Definition: basic_types.h:387
BT::PortInfo::PortInfo
PortInfo(PortDirection direction=PortDirection::INOUT)
Definition: basic_types.h:395
BT::convertFromString< int64_t >
int64_t convertFromString< int64_t >(StringView str)
Definition: basic_types.cpp:119
BT::PortDirection
PortDirection
Definition: basic_types.h:52
BT::convertFromString< float >
float convertFromString< float >(StringView str)
Definition: basic_types.cpp:204
BT::PortsList
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:585
BT::has_static_method_metadata
Definition: basic_types.h:601
BT::TypeInfo::Create
static TypeInfo Create()
Definition: basic_types.h:349
BT::getProvidedPorts
PortsList getProvidedPorts(enable_if< has_static_method_providedPorts< T >>=nullptr)
Definition: basic_types.h:615
BT::GetAnyFromStringFunctor
StringConverter GetAnyFromStringFunctor()
Definition: basic_types.h:212
BT::StringConvertersMap
std::unordered_map< const std::type_info *, StringConverter > StringConvertersMap
Definition: basic_types.h:208
json_text
static const char * json_text
Definition: gtest_substitution.cpp:6
BT::NodeType::UNDEFINED
@ UNDEFINED
BT::NodeStatus::FAILURE
@ FAILURE
BT::Timestamp
Definition: basic_types.h:335
BT::StringConverter
std::function< Any(StringView)> StringConverter
Definition: basic_types.h:206
BT::convertFromString< int8_t >
int8_t convertFromString< int8_t >(StringView str)
Definition: basic_types.cpp:155
BT::convertFromJSON
Any convertFromJSON(StringView json_text, std::type_index type)
convertFromJSON will parse a json string and use JsonExporter to convert its content to a given type....
Definition: basic_types.cpp:443
BT::NodeStatus::SKIPPED
@ SKIPPED
BT::NodeType::ACTION
@ ACTION
BT::convertFromString
Point3D convertFromString(StringView key)
Definition: ex01_wrap_legacy.cpp:32
BT::PortInfo::description_
std::string description_
Definition: basic_types.h:427
BT::convertFromString< bool >
bool convertFromString< bool >(StringView str)
Definition: basic_types.cpp:253
BT::operator<<
std::ostream & operator<<(std::ostream &os, const BT::NodeStatus &status)
Definition: basic_types.cpp:336
BT::CreatePort
std::pair< std::string, PortInfo > CreatePort(PortDirection direction, StringView name, StringView description={})
Definition: basic_types.h:433
BT::splitString
std::vector< StringView > splitString(const StringView &strToSplit, char delimeter)
Definition: basic_types.cpp:348
BT::convertFromString< NodeType >
NodeType convertFromString< NodeType >(StringView str)
Definition: basic_types.cpp:302
to_string
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Definition: json.hpp:24456
BT::convertFromString< uint32_t >
uint32_t convertFromString< uint32_t >(StringView str)
Definition: basic_types.cpp:185
BT::PortDirection::INPUT
@ INPUT
BT::TypeInfo::type
const std::type_index & type() const
Definition: basic_types.cpp:373
safe_any.hpp
BT::Any::cast
T cast() const
Definition: safe_any.hpp:146
BT::KeyValueVector
std::vector< std::pair< std::string, std::string > > KeyValueVector
Definition: basic_types.h:66
BT::IsAllowedPortName
bool IsAllowedPortName(StringView str)
Definition: basic_types.cpp:421
BT::StrCat
std::string StrCat()
Definition: strcat.hpp:46
BT::PortInfo::direction
PortDirection direction() const
Definition: basic_types.cpp:368
BT::has_static_method_providedPorts
Definition: basic_types.h:588
BT::NodeStatus::SUCCESS
@ SUCCESS
BT::NodeStatus::RUNNING
@ RUNNING
BT::AnyTypeAllowed
Definition: basic_types.h:87
BT::isStatusCompleted
bool isStatusCompleted(const NodeStatus &status)
Definition: basic_types.h:47
BT::PortInfo::default_value_
Any default_value_
Definition: basic_types.h:428
BT::StartWith
bool StartWith(StringView str, StringView prefix)
Definition: basic_types.cpp:464
BT::OutputPort
std::pair< std::string, PortInfo > OutputPort(StringView name, StringView description={})
Definition: basic_types.h:482
BT::NodeType::CONTROL
@ CONTROL
BT::PortInfo::direction_
PortDirection direction_
Definition: basic_types.h:426
BT::TypeInfo
Definition: basic_types.h:345
std
Definition: std.hpp:30
BT::Timestamp::seq
uint64_t seq
Definition: basic_types.h:338
BT::TypeInfo::TypeInfo
TypeInfo(std::type_index type_info, StringConverter conv)
Definition: basic_types.h:357
BT::NodeStatus::IDLE
@ IDLE
BT::convertFromString< double >
double convertFromString< double >(StringView str)
Definition: basic_types.cpp:191
BT::Result
Expected< std::monostate > Result
Definition: basic_types.h:333
BT::PortInfo::default_value_str_
std::string default_value_str_
Definition: basic_types.h:429
expected.hpp
BT::TypeInfo::TypeInfo
TypeInfo()
Definition: basic_types.h:354
BT::convertFromString< PortDirection >
PortDirection convertFromString< PortDirection >(StringView str)
Definition: basic_types.cpp:318
BT::isStatusActive
bool isStatusActive(const NodeStatus &status)
Definition: basic_types.h:42
BT::Timestamp::time
std::chrono::nanoseconds time
Definition: basic_types.h:340
BT::convertFromString< NodeStatus >
NodeStatus convertFromString< NodeStatus >(StringView str)
Definition: basic_types.cpp:284
BT::TypeInfo::parseString
Any parseString(const char *str) const
Definition: basic_types.cpp:383
BT::convertFromString< int16_t >
int16_t convertFromString< int16_t >(StringView str)
Definition: basic_types.cpp:161
BT::PortInfo::description
const std::string & description() const
Definition: basic_types.cpp:406
BT::NodeStatus
NodeStatus
Definition: basic_types.h:33
BT::toStr
std::string toStr(const T &value)
toStr is the reverse operation of convertFromString.
Definition: basic_types.h:252
lexy::_detail::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:184
BT::convertFromString< uint8_t >
uint8_t convertFromString< uint8_t >(StringView str)
Definition: basic_types.cpp:173
BT::TypeInfo::isStronglyTyped
bool isStronglyTyped() const
Definition: basic_types.h:376
lexy::_detail::type_name
constexpr const char * type_name()
Definition: type_name.hpp:96


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:07