⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.cpp

📁 用data miming技术进行false prediction
💻 CPP
字号:
#include "Item.h"

Item::Item(string name) {
    this->mName = name;
    this->mCount = 1;
    this->mSeq = 0;
}

Item::Item(string name, int count, int seq) {
    this->mName = name;
    this->mCount = count;
    this->mSeq = seq;
}

string Item::getName() const {
    return mName;
}

int Item::getCount() const {
    return mCount;
}

int Item::getSeq() const {
    return mSeq;
}

void Item::incrementCount() {
    mCount++;
}

void Item::setCount(int i) {
    mCount = i;
}

bool Item::operator<(const Item& anotherItem) const {
    if (this->getCount() == anotherItem.getCount()) {
        return (this->getSeq() < anotherItem.getSeq());
    } else {
        return (this->getCount() < anotherItem.getCount());
    }
};

bool Item::operator>(const Item& anotherItem) const {
    if (this->getCount() == anotherItem.getCount()) {
        return (this->getSeq() > anotherItem.getSeq());
    } else {
        return (this->getCount() > anotherItem.getCount());
    }
};

⌨️ 快捷键说明

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