output stream formatting for InterfaceState::Priority

This commit is contained in:
v4hn 2020-08-21 20:43:07 +02:00
parent a6fa45214f
commit f7a94956c3
2 changed files with 6 additions and 0 deletions

View File

@ -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<InterfaceState*>
{

View File

@ -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