#include <chrono>
#include <iostream>
#include <functional>
#include <string_view>
#include <typeinfo>
#include <unordered_map>
#include <utility>
#include <variant>
#include <vector>
#include "behaviortree_cpp/utils/safe_any.hpp"
#include "behaviortree_cpp/exceptions.h"
#include "behaviortree_cpp/contrib/expected.hpp"
Go to the source code of this file.
Namespaces | |
BT | |
BT::details | |
The SwitchNode is equivalent to a switch statement, where a certain branch (child) is executed according to the value of a blackboard entry. | |
Typedefs | |
using | BT::Duration = std::chrono::high_resolution_clock::duration |
template<typename Predicate > | |
using | BT::enable_if = typename std::enable_if< Predicate::value >::type * |
template<typename Predicate > | |
using | BT::enable_if_not = typename std::enable_if<!Predicate::value >::type * |
template<typename T > | |
using | BT::Expected = nonstd::expected< T, std::string > |
using | BT::KeyValueVector = std::vector< std::pair< std::string, std::string > > |
using | BT::PortsList = std::unordered_map< std::string, PortInfo > |
using | BT::Result = Expected< std::monostate > |
using | BT::StringConverter = std::function< Any(StringView)> |
using | BT::StringConvertersMap = std::unordered_map< const std::type_info *, StringConverter > |
using | BT::StringView = std::string_view |
using | BT::TimePoint = std::chrono::high_resolution_clock::time_point |
Enumerations | |
enum | BT::NodeStatus { BT::NodeStatus::IDLE = 0, BT::NodeStatus::RUNNING = 1, BT::NodeStatus::SUCCESS = 2, BT::NodeStatus::FAILURE = 3, BT::NodeStatus::SKIPPED = 4 } |
enum | BT::NodeType { BT::NodeType::UNDEFINED = 0, BT::NodeType::ACTION, BT::NodeType::CONDITION, BT::NodeType::CONTROL, BT::NodeType::DECORATOR, BT::NodeType::SUBTREE } |
Enumerates the possible types of nodes. More... | |
enum | BT::PortDirection { BT::PortDirection::INPUT, BT::PortDirection::OUTPUT, BT::PortDirection::INOUT } |
Functions | |
template<typename T = AnyTypeAllowed, typename DefaultT = T> | |
std::pair< std::string, PortInfo > | BT::BidirectionalPort (StringView name, const DefaultT &default_value, StringView description) |
template<typename T = AnyTypeAllowed> | |
std::pair< std::string, PortInfo > | BT::BidirectionalPort (StringView name, StringView description={}) |
Any | BT::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. It will work only if the type was previously registered. May throw if it fails. More... | |
template<typename T > | |
T | BT::convertFromJSON (StringView str) |
Same as the non template version, but with automatic casting. More... | |
template<> | |
Point3D | BT::convertFromString (StringView key) |
template<> | |
bool | BT::convertFromString< bool > (StringView str) |
template<> | |
const char * | BT::convertFromString< const char * > (StringView str) |
template<> | |
double | BT::convertFromString< double > (StringView str) |
template<> | |
float | BT::convertFromString< float > (StringView str) |
template<> | |
int16_t | BT::convertFromString< int16_t > (StringView str) |
template<> | |
int32_t | BT::convertFromString< int32_t > (StringView str) |
template<> | |
int64_t | BT::convertFromString< int64_t > (StringView str) |
template<> | |
int8_t | BT::convertFromString< int8_t > (StringView str) |
template<> | |
NodeStatus | BT::convertFromString< NodeStatus > (StringView str) |
template<> | |
NodeType | BT::convertFromString< NodeType > (StringView str) |
template<> | |
PortDirection | BT::convertFromString< PortDirection > (StringView str) |
template<> | |
std::string | BT::convertFromString< std::string > (StringView str) |
template<> | |
std::vector< double > | BT::convertFromString< std::vector< double > > (StringView str) |
template<> | |
std::vector< int > | BT::convertFromString< std::vector< int > > (StringView str) |
template<> | |
std::vector< std::string > | BT::convertFromString< std::vector< std::string > > (StringView str) |
template<> | |
uint16_t | BT::convertFromString< uint16_t > (StringView str) |
template<> | |
uint32_t | BT::convertFromString< uint32_t > (StringView str) |
template<> | |
uint64_t | BT::convertFromString< uint64_t > (StringView str) |
template<> | |
uint8_t | BT::convertFromString< uint8_t > (StringView str) |
template<typename T = AnyTypeAllowed> | |
std::pair< std::string, PortInfo > | BT::CreatePort (PortDirection direction, StringView name, StringView description={}) |
template<typename T > | |
StringConverter | BT::GetAnyFromStringFunctor () |
template<> | |
StringConverter | BT::GetAnyFromStringFunctor< void > () |
template<typename T > | |
PortsList | BT::getProvidedPorts (enable_if< has_static_method_providedPorts< T >>=nullptr) |
template<typename T > | |
PortsList | BT::getProvidedPorts (enable_if_not< has_static_method_providedPorts< T >>=nullptr) |
template<typename T = AnyTypeAllowed, typename DefaultT = T> | |
std::pair< std::string, PortInfo > | BT::InputPort (StringView name, const DefaultT &default_value, StringView description) |
template<typename T = AnyTypeAllowed> | |
std::pair< std::string, PortInfo > | BT::InputPort (StringView name, StringView description={}) |
bool | BT::IsAllowedPortName (StringView str) |
template<typename T > | |
constexpr bool | BT::IsConvertibleToString () |
bool | BT::isStatusActive (const NodeStatus &status) |
bool | BT::isStatusCompleted (const NodeStatus &status) |
std::ostream & | BT::operator<< (std::ostream &os, const BT::NodeStatus &status) |
std::ostream & | BT::operator<< (std::ostream &os, const BT::NodeType &type) |
std::ostream & | BT::operator<< (std::ostream &os, const BT::PortDirection &type) |
template<typename T = AnyTypeAllowed> | |
std::pair< std::string, PortInfo > | BT::OutputPort (StringView name, StringView default_value, StringView description) |
template<typename T = AnyTypeAllowed> | |
std::pair< std::string, PortInfo > | BT::OutputPort (StringView name, StringView description={}) |
template<typename T = AnyTypeAllowed, typename DefaultT = T> | |
std::pair< std::string, PortInfo > | BT::details::PortWithDefault (PortDirection direction, StringView name, const DefaultT &default_value, StringView description) |
std::vector< StringView > | BT::splitString (const StringView &strToSplit, char delimeter) |
bool | BT::StartWith (StringView str, char prefix) |
bool | BT::StartWith (StringView str, StringView prefix) |
Expected< std::string > | BT::toJsonString (const Any &value) |
std::string | BT::toStr (BT::NodeStatus status, bool colored) |
toStr converts NodeStatus to string. Optionally colored. More... | |
template<typename T > | |
std::string | BT::toStr (const T &value) |
toStr is the reverse operation of convertFromString. More... | |
template<> | |
std::string | BT::toStr< bool > (const bool &value) |
template<> | |
std::string | BT::toStr< BT::NodeStatus > (const BT::NodeStatus &status) |
template<> | |
std::string | BT::toStr< BT::NodeType > (const BT::NodeType &type) |
template<> | |
std::string | BT::toStr< BT::PortDirection > (const BT::PortDirection &direction) |
template<> | |
std::string | BT::toStr< std::string > (const std::string &value) |