Skip to content

Commit 8970f17

Browse files
committed
DPL: add streamer for OutputSpec
Useful for BOOST_TEST(..., ...::per_element());
1 parent 82ec50b commit 8970f17

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Framework/Core/include/Framework/OutputSpec.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ struct OutputSpec {
7373
return origin == that.origin && description == that.description && subSpec == that.subSpec &&
7474
lifetime == that.lifetime;
7575
};
76+
77+
friend std::ostream& operator<<(std::ostream& stream, OutputSpec const& arg);
7678
};
7779

7880
} // namespace framework

Framework/Core/src/StreamOperators.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
#include <ostream>
1211
#include "Framework/InputSpec.h"
12+
#include "Framework/OutputSpec.h"
13+
14+
#include <ostream>
15+
#include <string>
1316

1417
namespace o2
1518
{
@@ -23,5 +26,12 @@ std::ostream& operator<<(std::ostream& stream, o2::framework::InputSpec const& a
2326
return stream;
2427
}
2528

29+
std::ostream& operator<<(std::ostream& stream, o2::framework::OutputSpec const& arg)
30+
{
31+
// FIXME: should have stream operators for the header fields
32+
stream << arg.binding.value << " {" << arg.origin.as<std::string>() << ":" << arg.description.as<std::string>() << ":" << arg.subSpec << "}";
33+
return stream;
34+
}
35+
2636
} // namespace framework
2737
} // namespace o2

0 commit comments

Comments
 (0)