iteminfo.h

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

H
51
字号
#ifndef ITEMINFO_H
#define ITEMINFO_H

#include <iostream>
#include <string>

#include "AppException.h"
#include "Node.h"

using namespace std;

class ItemInfo {
    friend ostream& operator<<(ostream& os, const ItemInfo& item);

    public:
        ItemInfo(string name);
        ItemInfo(string name, int count);
        ItemInfo() {};

        virtual ~ItemInfo() {};

        bool operator<(const ItemInfo& anotherItemInfo) const;
        bool operator>(const ItemInfo& anotherItemInfo) const;

        string getName() const;
        int getCount() const;
        void incrementCount();
        void incrementCount(int i);
        void resetCount();
        Node* getStartNode();
        Node* getLastNode();
        void setStartNode(Node* node);
        void setLastNode(Node* node);

    private:
        string mName;
        int mCount;
        Node* startNode;
        Node* lastNode;

};

inline ostream& operator<<(ostream& os, const ItemInfo& itemInfo) {
    os << "Name: " << itemInfo.getName();
    os << " Count: " << itemInfo.getCount();

    return os;
};

#endif /* ITEMINFO_H */

⌨️ 快捷键说明

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