21 static uint16_t uid = 1;
26 : name_(
std::move(name)),
29 config_(
std::move(config))
48 if (prev_status != new_status)
106 const auto size = str.size();
107 if( size >= 3 && str.back() ==
'}')
112 if( size >= 4 && str[0] ==
'$' && str[1] ==
'{') {
121 const auto size = str.size();
122 if( size >= 3 && str.back() ==
'}')
125 return str.substr(1, size-2);
127 if( str[0] ==
'$' && str[1] ==
'{') {
128 return str.substr(2, size-3);
136 if( remapping_value ==
"=" )
144 return nonstd::make_unexpected(
"Not a blackboard pointer");
149 for (
const auto& new_it: new_remapping)
154 it->second = new_it.second;
159 it->second = new_it.second;
std::string registration_ID_
std::condition_variable state_condition_variable_
NodeConfiguration config_
StatusChangeSignal::Subscriber StatusChangeSubscriber
const std::string & name() const
Name of the instance, not the type.
const NodeConfiguration & config() const
StatusChangeSignal::CallableFunction StatusChangeCallback
StatusChangeSubscriber subscribeToStatusChange(StatusChangeCallback callback)
subscribeToStatusChange is used to attach a callback to a status change. When StatusChangeSubscriber ...
TreeNode(std::string name, NodeConfiguration config)
TreeNode main constructor.
nonstd::string_view StringView
void notify(CallableArgs...args)
void modifyPortsRemapping(const PortsRemapping &new_remapping)
PortsRemapping output_ports
StatusChangeSignal state_change_signal_
static StringView stripBlackboardPointer(StringView str)
nonstd::expected< T, std::string > Optional
static bool isBlackboardPointer(StringView str)
NodeStatus status() const
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
Subscriber subscribe(CallableFunction func)
BT::NodeStatus waitValidStatus()
const std::string & registrationName() const
registrationName is the ID used by BehaviorTreeFactory to create an instance.
virtual BT::NodeStatus tick()=0
Method to be implemented by the user.
void setStatus(NodeStatus new_status)
PortsRemapping input_ports
static Optional< StringView > getRemappedKey(StringView port_name, StringView remapping_value)
std::unordered_map< std::string, std::string > PortsRemapping