Go to the documentation of this file.
10 if (!
ref_count.compare_exchange_strong(expected,
true))
12 throw LogicError(
"Only one instance of StdCoutLogger shall be created");
23 using namespace std::chrono;
25 constexpr
const char* whitespaces =
" ";
26 constexpr
const size_t ws_count = 25;
28 double since_epoch = duration<double>(timestamp).count();
29 printf(
"[%.3f]: %s%s %s -> %s", since_epoch, node.
name().c_str(),
30 &whitespaces[std::min(ws_count, node.
name().size())],
31 toStr(prev_status,
true).c_str(),
toStr(status,
true).c_str());
32 std::cout << std::endl;
37 std::cout << std::flush;
~StdCoutLogger() override
virtual void flush() override
Abstract base class for Behavior Tree Nodes.
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
std::string toStr(T value)
StdCoutLogger(const BT::Tree &tree)
std::chrono::high_resolution_clock::duration Duration
const std::string & name() const
Name of the instance, not the type.
static std::atomic< bool > ref_count
behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Wed Jun 26 2024 02:51:19