Go to the documentation of this file.
36 template <
typename T = Any>
90 return getInput<NodeStatus>(
"if_empty").value();
116 return { BidirectionalPort<SharedQueue<T>>(
"queue"),
118 "Status to return if queue is empty: "
119 "SUCCESS, FAILURE, SKIPPED"),
120 OutputPort<T>(
"value") };
131 output->push_back(convertFromString<int>(part));
161 inline SharedQueue<std::string>
168 output->push_back(convertFromString<std::string>(part));
LoopNode(const std::string &name, const NodeConfig &config)
The LoopNode class is used to pop_front elements from a std::deque. This element is copied into the p...
const NodeConfig & config() const
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
std::string_view StringView
SharedQueue< T > current_queue_
NodeStatus tick() override
Method to be implemented by the user.
std::shared_ptr< std::deque< T > > SharedQueue
std::unordered_map< std::string, PortInfo > PortsList
NodeStatus status() const
void setStatus(NodeStatus new_status)
setStatus changes the status of the node. it will throw if you try to change the status to IDLE,...
LockedPtr< Any > AnyPtrLocked
StringView getRawPortValue(const std::string &key) const
bool convertFromString< bool >(StringView str)
std::vector< StringView > splitString(const StringView &strToSplit, char delimeter)
AnyPtrLocked getLockedPortContent(const std::string &key)
getLockedPortContent should be used when:
The LockedPtr class is used to share a pointer to an object and a mutex that protects the read/write ...
Result setOutput(const std::string &key, const T &value)
setOutput modifies the content of an Output port
const std::string & name() const
Name of the instance, not the type.
static PortsList providedPorts()
bool isStatusCompleted(const NodeStatus &status)
double convertFromString< double >(StringView str)
static bool isBlackboardPointer(StringView str, StringView *stripped_pointer=nullptr)
Check a string and return true if it matches the pattern: {...}.
SharedQueue< T > static_queue_
constexpr T & get() noexcept