Skip to content

Commit 5310f90

Browse files
committed
operator<< for Interface::Direction
1 parent ca38d11 commit 5310f90

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

core/include/moveit/task_constructor/storage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class Interface : public ordered<InterfaceState*>
248248

249249
std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& prio);
250250
std::ostream& operator<<(std::ostream& os, const Interface& interface);
251+
std::ostream& operator<<(std::ostream& os, Interface::Direction);
251252

252253
/// Find index of the iterator in the container. Counting starts at 1. Zero corresponds to not found.
253254
template <typename T>

core/src/stage.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ ConnectingPrivate::StatePair ConnectingPrivate::make_pair<Interface::FORWARD>(In
737737
return StatePair(second, first);
738738
}
739739

740-
// TODO: bool updated -> uint_8 updated (bitfield of PRIORITY | STATUS)
741740
template <Interface::Direction dir>
742741
void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags updated) {
743742
auto parent_pimpl = parent()->pimpl();
@@ -799,16 +798,15 @@ void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags
799798
#if 0
800799
auto& os = std::cerr;
801800
for (auto d : { Interface::FORWARD, Interface::BACKWARD }) {
802-
bool fw = (d == Interface::FORWARD);
803-
if (fw)
801+
if (d == Interface::FORWARD)
804802
os << " " << std::setw(10) << std::left << this->name();
805803
else
806804
os << std::setw(12) << std::right << "";
807805
if (dir != d)
808806
os << (updated ? " !" : " +");
809807
else
810808
os << " ";
811-
os << (fw ? "↓ " : "↑ ") << this->pullInterface(d) << ": " << *this->pullInterface(d) << std::endl;
809+
os << d << " " << this->pullInterface(d) << ": " << *this->pullInterface(d) << std::endl;
812810
}
813811
os << std::setw(15) << " ";
814812
printPendingPairs(os) << std::endl;

core/src/storage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& prio)
178178
<< InterfaceState::STATUS_COLOR[3];
179179
return os;
180180
}
181+
std::ostream& operator<<(std::ostream& os, Interface::Direction dir) {
182+
os << (dir == Interface::FORWARD ? "" : "");
183+
return os;
184+
}
181185

182186
void SolutionBase::setCreator(Stage* creator) {
183187
assert(creator_ == nullptr || creator_ == creator); // creator must only set once

0 commit comments

Comments
 (0)