Skip to content

Commit

Permalink
DPL: add streamer for OutputSpec
Browse files Browse the repository at this point in the history
Useful for BOOST_TEST(..., ...::per_element());
  • Loading branch information
ktf committed Oct 13, 2018
1 parent 82ec50b commit 8970f17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Framework/Core/include/Framework/OutputSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ struct OutputSpec {
return origin == that.origin && description == that.description && subSpec == that.subSpec &&
lifetime == that.lifetime;
};

friend std::ostream& operator<<(std::ostream& stream, OutputSpec const& arg);
};

} // namespace framework
Expand Down
12 changes: 11 additions & 1 deletion Framework/Core/src/StreamOperators.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <ostream>
#include "Framework/InputSpec.h"
#include "Framework/OutputSpec.h"

#include <ostream>
#include <string>

namespace o2
{
Expand All @@ -23,5 +26,12 @@ std::ostream& operator<<(std::ostream& stream, o2::framework::InputSpec const& a
return stream;
}

std::ostream& operator<<(std::ostream& stream, o2::framework::OutputSpec const& arg)
{
// FIXME: should have stream operators for the header fields
stream << arg.binding.value << " {" << arg.origin.as<std::string>() << ":" << arg.description.as<std::string>() << ":" << arg.subSpec << "}";
return stream;
}

} // namespace framework
} // namespace o2

0 comments on commit 8970f17

Please sign in to comment.