Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include "DataFormats/Provenance/interface/ProductID.h"
#include <ostream>
#include <algorithm>

namespace edm {
  std::ostream& operator<<(std::ostream& os, ProductID const& id) {
    os << id.processIndex() << ":" << id.productIndex();
    return os;
  }

  bool operator<(ProductID const& lh, ProductID const& rh) {
    return lh.processIndex() < rh.processIndex() ||
           (lh.processIndex() == rh.processIndex() && lh.productIndex() < rh.productIndex());
  }

  void ProductID::swap(ProductID& other) {
    std::swap(processIndex_, other.processIndex_);
    std::swap(productIndex_, other.productIndex_);
  }
}  // namespace edm