Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#include "DataFormats/Provenance/interface/StableProvenance.h"
#include "DataFormats/Provenance/interface/ProcessConfiguration.h"

#include <algorithm>
#include <cassert>

/*----------------------------------------------------------------------

----------------------------------------------------------------------*/

namespace edm {

  StableProvenance::StableProvenance() : StableProvenance{std::shared_ptr<ProductDescription const>(), ProductID()} {}

  StableProvenance::StableProvenance(std::shared_ptr<ProductDescription const> const& p, ProductID const& pid)
      : productDescription_(p), productID_(pid) {}

  void StableProvenance::write(std::ostream& os) const {
    // This is grossly inadequate, but it is not critical for the first pass.
    productDescription().write(os);
  }

  bool operator==(StableProvenance const& a, StableProvenance const& b) {
    return a.productDescription() == b.productDescription();
  }

  void StableProvenance::swap(StableProvenance& iOther) {
    productDescription_.swap(iOther.productDescription_);
    productID_.swap(iOther.productID_);
  }
}  // namespace edm