From 67b6dcb49b718b682ca235bc36c7c75c094699c0 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Fri, 27 Apr 2018 11:05:42 +0200 Subject: [PATCH] move implementation into cpp file --- core/include/moveit/task_constructor/storage.h | 15 +-------------- core/src/storage.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index 508ec2e4..98adbd9d 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -93,20 +93,7 @@ public: return Priority(this->depth() + other.depth(), this->cost() + other.cost()); } - inline bool operator<(const Priority& other) const { - /* infinite cost should always be last */ - if (std::isinf(this->cost()) && std::isinf(other.cost())) - return this->depth() > other.depth(); - else if (std::isinf(this->cost())) - return false; - else if (std::isinf(other.cost())) - return true; - - if (this->depth() == other.depth()) - return this->cost() < other.cost(); - else - return this->depth() > other.depth(); - } + bool operator<(const Priority& other) const; }; typedef std::deque Solutions; diff --git a/core/src/storage.cpp b/core/src/storage.cpp index 6f0e85e5..a0c4313b 100644 --- a/core/src/storage.cpp +++ b/core/src/storage.cpp @@ -55,6 +55,23 @@ InterfaceState::InterfaceState(const InterfaceState &other) { } + +bool InterfaceState::Priority::operator<(const InterfaceState::Priority& other) const { + // infinite costs go always last + if (std::isinf(this->cost()) && std::isinf(other.cost())) + return this->depth() > other.depth(); + else if (std::isinf(this->cost())) + return false; + else if (std::isinf(other.cost())) + return true; + + if (this->depth() == other.depth()) + return this->cost() < other.cost(); + else + return this->depth() > other.depth(); +} + + Interface::Interface(const Interface::NotifyFunction ¬ify) : notify_(notify) {}