00001 #include "CondFormats/Common/interface/UpdateStamp.h" 00002 #include "CondFormats/Common/interface/TimeConversions.h" 00003 00004 namespace { 00005 std::string sep(". "); 00006 } 00007 00008 namespace cond { 00009 00010 UpdateStamp::UpdateStamp() : 00011 m_revision(-1), m_timestamp(0), m_comment("not stamped"){} 00012 00013 UpdateStamp::UpdateStamp(UpdateStamp const & rhs) { 00014 m_revision = rhs.m_revision; 00015 m_timestamp = rhs.m_timestamp; 00016 m_comment = rhs.m_comment; 00017 } 00018 00019 UpdateStamp::~UpdateStamp(){} 00020 00021 // stamp and return current revision number; 00022 int UpdateStamp::stamp(std::string const & icomment, bool append) { 00023 m_revision++; 00024 m_timestamp = cond::time::now(); 00025 if (append && !icomment.empty()) m_comment += sep + icomment; 00026 else m_comment = icomment; 00027 return m_revision; 00028 } 00029 00030 }