record.h

来自「用data miming技术进行false prediction」· C头文件 代码 · 共 84 行

H
84
字号
#ifndef RECORD_H
#define RECORD_H

#include <string>
#include <fstream>

using namespace std;

class Record {
    friend ostream& operator<<(ostream& os, const Record& rec);

    public:
        Record(string mRecId, string mEventType,
               string mFacility, string mSeverity, int mEventTime,
               string mFlags, string mThread, string mJobId, string mProcessor,
               string mNode, string mBlock, string mEntryData, string mLocation);

        Record(string mRecId, string mEventType,
               string mFacility, string mSeverity, int mEventTime,
               string mEntryData, string mLocation, string mJobId);

        virtual ~Record() {};

        bool operator<(const Record& anotherRecord) const;


        string getRecId() const;
        string getEventType() const;
        string getFacility() const;
        string getSeverity() const;
        int getEventTime() const;
        string getFlags() const;
        string getThread() const;
        string getJobId() const;
        string getProcessor() const;
        string getNode() const;
        string getBlock() const;
        string getEntryData() const;
        string getLocation() const;
        string getCategory() const;

        Record(){};

        //string getSize() const;
        //string getFormat() const;
        //string getSerialNumber() const;

    private:
        string mRecId;
        string mEventType;
        string mFacility;
        string mSeverity;
        int mEventTime;
        string mFlags;
        string mThread;
        string mJobId;
        string mProcessor;
        string mNode;
        string mBlock;
        string mEntryData;
        string mLocation;


        //string mSize;
        //string mFormat;
        //string mSerialNumber;

};

inline ostream& operator<<(ostream& os, const Record& rec) {
    //os << "Id: " << rec.getRecId();
    //os << " Severity: " << rec.getSeverity();
    //os << " Time: " << rec.getEventTime();
    //os << " Facility: " << rec.getFacility();
    os << rec.getRecId() << " " << rec.getSeverity() << " " << rec.getEventTime() << " " << rec.getFacility();
    //os << rec.getRecId() << "\t" << rec.getEventType() << "\t" << rec.getFacility();
    //os << "\t" << rec.getSeverity() << "\t" << rec.getEventTime() << "\t" << rec.getJobId();
    //os << "\t" << rec.getNode() << "\t" << rec.getLocation() << "\t" << rec.getEntryData();

    return os;
};

#endif /* RECORD_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?