event.cpp

来自「用data miming技术进行false prediction」· C++ 代码 · 共 59 行

CPP
59
字号
#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 + =
减小字号Ctrl + -
显示快捷键?