示例#1
0
文件: Bucket.cpp 项目: zdgeorgiev/FMI
bool Bucket::operator>=(const Bucket & rhs) const
{
	for (size_t i = 0; i < this->getElementsCount(); i++)
	{
		if (this->getContainer()[i] >= rhs.getContainer()[i])
			return true;
	}

	return false;
}
示例#2
0
文件: Bucket.cpp 项目: zdgeorgiev/FMI
Bucket Bucket::operator+(const Bucket & rhs) const
{
	Bucket newBucket = *this;

	for (size_t i = 0; i < rhs.getElementsCount(); i++)
	{
		newBucket.addEgg(rhs.getContainer()[i]);
	}

	return newBucket;
}
示例#3
0
文件: Bucket.cpp 项目: zdgeorgiev/FMI
bool Bucket::operator==(const Bucket & rhs) const
{
	if (this->elementsCount != rhs.getSize())
		return false;

	for (size_t i = 0; i < this->elementsCount; i++)
	{
		if (this->getContainer()[i] != rhs.getContainer()[i])
			return false;
	}

	return true;
}
示例#4
0
文件: Bucket.cpp 项目: zdgeorgiev/FMI
Bucket Bucket::operator%(const Bucket & rhs) const
{
	Bucket newBucket;

	for (size_t i = 0; i < this->elementsCount; i++)
	{
		for (size_t j = 0; j < rhs.getElementsCount(); j++)
		{
			if (this->container[i] == rhs.getContainer()[j])
				newBucket.addEgg(this->container[i]);
		}
	}

	return newBucket;
}