From f7a94956c3bd446121ff8c1eed4d39fe8e2c5ecc Mon Sep 17 00:00:00 2001 From: v4hn Date: Fri, 21 Aug 2020 20:43:07 +0200 Subject: [PATCH] output stream formatting for InterfaceState::Priority --- core/include/moveit/task_constructor/storage.h | 2 ++ core/src/storage.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index fa534c00..fd709e4a 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -135,6 +135,8 @@ private: Interface* owner_ = nullptr; // allow update of priority }; +std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& p); + /** Interface provides a cost-sorted list of InterfaceStates available as input for a stage. */ class Interface : public ordered { diff --git a/core/src/storage.cpp b/core/src/storage.cpp index 4119094a..93a49ded 100644 --- a/core/src/storage.cpp +++ b/core/src/storage.cpp @@ -84,6 +84,10 @@ bool InterfaceState::Priority::operator<(const InterfaceState::Priority& other) return this->depth() > other.depth(); } +std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& p) { + return os << "[depth: " << p.depth() << ", cost: " << p.cost() << "]"; +} + Interface::Interface(const Interface::NotifyFunction& notify) : notify_(notify) {} // Announce a new InterfaceState