#ifndef RAW_MDEVENT_H_ #define RAW_MDEVENT_H_ #include #include "MdCounter.h" #define MDIKNOWWHATIMDOING #include "../MdCommon/CommonMdEvent.h" #undef MDIKNOWWHATIMDOING namespace md { inline Event::Event() : fId(-1) { time_t rawtime = time(NULL); struct tm utc = *(gmtime(&rawtime)); fUTCtime = mktime ( &utc ); fUTCdate = ctime( &fUTCtime ); } inline Event::Event( ID id ): fId( id ) { time_t rawtime = time(NULL); struct tm utc = *(gmtime(&rawtime)); fUTCtime = mktime ( &utc ); fUTCdate = ctime( &fUTCtime ); } inline bool Event::HasCounter(ID id) const { return fCtrList.count(id) != 0; } inline Counter & Event::MakeCounter(ID id) { if (!HasCounter(id)) { fCtrList[id] = Counter(id); } return fCtrList[id]; } inline Counter & Event::GetCounter(ID id){ return fCtrList.at(id); } inline void Event::SetUTCtime(Event::UTCTime time) { char buf[51]; struct tm utc; gmtime_r(&time, &utc); fUTCtime = mktime(&utc); fUTCdate = ctime_r(&fUTCtime, buf); } } #endif /*#ifndef RAW_MDEVENT_H_*/