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/Streamer/interface/StreamedProducts.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "DataFormats/Common/interface/WrapperBase.h"

namespace edm {
  StreamedProduct::StreamedProduct(WrapperBase const* prod,
                                   ProductDescription const& desc,
                                   bool present,
                                   std::vector<BranchID> const* parents)
      : prod_(prod), desc_(&desc), present_(present), parents_(parents) {
    if (present_ && prod == nullptr) {
      std::string branchName = desc.branchName();
      if (branchName.empty()) {
        ProductDescription localCopy(desc);
        localCopy.initBranchName();
        branchName = localCopy.branchName();
      }
      throw edm::Exception(edm::errors::LogicError, "StreamedProduct::StreamedProduct\n")
          << "A product with a status of 'present' is not actually present.\n"
          << "The branch name is " << branchName << "\n"
          << "Contact a framework developer.\n";
    }
  }

  void SendJobHeader::initializeTransients() {
    for (ProductDescription& desc : descs_) {
      desc.init();
      desc.setIsProvenanceSetOnRead();
    }
  }
}  // namespace edm