00001 #include "DataFormats/Provenance/interface/EventEntryDescription.h" 00002 #include "FWCore/Utilities/interface/Digest.h" 00003 #include <ostream> 00004 #include <sstream> 00005 00006 /*---------------------------------------------------------------------- 00007 00008 ----------------------------------------------------------------------*/ 00009 00010 namespace edm { 00011 EventEntryDescription::EventEntryDescription() : 00012 parents_() 00013 { } 00014 00015 EntryDescriptionID 00016 EventEntryDescription::id() const 00017 { 00018 // This implementation is ripe for optimization. 00019 std::ostringstream oss; 00020 oss << moduleDescriptionID_ << ' '; 00021 for (std::vector<BranchID>::const_iterator 00022 i = parents_.begin(), 00023 e = parents_.end(); 00024 i != e; 00025 ++i) 00026 { 00027 oss << *i << ' '; 00028 } 00029 00030 std::string stringrep = oss.str(); 00031 cms::Digest md5alg(stringrep); 00032 return EntryDescriptionID(md5alg.digest().toString()); 00033 } 00034 00035 00036 void 00037 EventEntryDescription::write(std::ostream&) const { 00038 // This is grossly inadequate, but it is not critical for the 00039 // first pass. 00040 } 00041 00042 bool 00043 operator==(EventEntryDescription const& a, EventEntryDescription const& b) { 00044 return 00045 a.parents() == b.parents(); 00046 } 00047 }