📄 event.cpp
字号:
#include "Event.h"
Event::Event(int mRecId, string mFacility, string mSeverity, int mEventTime, string mCategory) {
this->mRecId = mRecId;
this->mFacility = mFacility;
this->mSeverity = mSeverity;
this->mEventTime = mEventTime;
this->mCategory = mCategory;
}
Event::Event(int mRecId, int mEventTime, string mCategory) {
this->mRecId = mRecId;
this->mEventTime = mEventTime;
this->mCategory = mCategory;
}
bool Event::operator<(const Event& anotherEvent) const {
if (this->getEventTime() == anotherEvent.getEventTime()) {
return (this->getRecId() < anotherEvent.getRecId());
} else {
return (this->getEventTime() < anotherEvent.getEventTime());
}
};
int Event::getRecId() const {
return mRecId;
};
string Event::getFacility() const {
return mFacility;
};
string Event::getSeverity() const {
return mSeverity;
};
int Event::getEventTime() const {
return mEventTime;
};
string Event::getCategory() const {
return mCategory;
};
/*
inline ostream& operator<<(ostream& os, const Event& rec) {
os << "Id: " << rec.getRecId();
os << " Severity: " << rec.getSeverity();
os << " Time: " << rec.getEventTime();
os << " Facility: " << rec.getFacility();
return os;
};
inline bool operator<(const Event& currRecord, const Event& anotherRecord) {
return (currRecord.getEventTime() < anotherRecord.getEventTime());
};
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -