22 template <
typename _Clock = std::chrono::steady_clock,
23 typename _Duration = std::chrono::steady_clock::duration>
54 return {InputPort<unsigned>(
"msec",
"After a certain amount of time, " 55 "halt() the child if it is still running.")};
67 throw RuntimeError(
"Missing parameter [msec] in TimeoutNode");
const NodeConfiguration & config() const
The TimeoutNode will halt() a running child if the latter has been RUNNING for more than a give time...
NodeStatus status() const
size_t cancel(uint64_t id)
Cancels the specified timer.
static pthread_mutex_t mutex
TimeoutNode(const std::string &name, unsigned milliseconds)
bool StatusCompleted(const NodeStatus &status)
const std::string & name() const
Name of the instance, not the type.
void haltChild()
Same as resetChild()
TimerQueue< _Clock, _Duration > timer_
std::mutex timeout_mutex_
Result getInput(const std::string &key, T &destination) const
TimeoutNode(const std::string &name, const NodeConfiguration &config)
std::unordered_map< std::string, PortInfo > PortsList
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
const TreeNode * child() const
void setRegistrationID(StringView ID)
bool read_parameter_from_ports_
std::atomic< bool > child_halted_
uint64_t add(std::chrono::milliseconds milliseconds, std::function< void(bool)> handler)
Adds a new timer.
static PortsList providedPorts()
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
void setStatus(NodeStatus new_status)