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