Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:03

0001 #include "DataFormats/Provenance/interface/EventEntryDescription.h"
0002 #include "FWCore/Utilities/interface/Digest.h"
0003 #include <ostream>
0004 #include <sstream>
0005 
0006 /*----------------------------------------------------------------------
0007 
0008 ----------------------------------------------------------------------*/
0009 
0010 namespace edm {
0011   EventEntryDescription::EventEntryDescription() : parents_() {}
0012 
0013   EntryDescriptionID EventEntryDescription::id() const {
0014     // This implementation is ripe for optimization.
0015     std::ostringstream oss;
0016     oss << moduleDescriptionID_ << ' ';
0017     for (std::vector<BranchID>::const_iterator i = parents_.begin(), e = parents_.end(); i != e; ++i) {
0018       oss << *i << ' ';
0019     }
0020 
0021     std::string stringrep = oss.str();
0022     cms::Digest md5alg(stringrep);
0023     return EntryDescriptionID(md5alg.digest().toString());
0024   }
0025 
0026   void EventEntryDescription::write(std::ostream&) const {
0027     // This is grossly inadequate, but it is not critical for the
0028     // first pass.
0029   }
0030 
0031   bool operator==(EventEntryDescription const& a, EventEntryDescription const& b) { return a.parents() == b.parents(); }
0032 }  // namespace edm