#include "Quantity.h"

namespace cosi {

std::string RealQuantity::sQuantityType = "Real";
std::string RealQuantity::sQuantityName = "Real";
std::string IntQuantity::sQuantityType = "Int";
std::string StringQuantity::sQuantityType = "String";

Quantity::Quantity() {
	mAny = false;
	mBot = true;
	mOrdered = false;
}

Quantity::~Quantity() {
}

bool Quantity::IsAny() const {
	return mAny;
}
void Quantity::IsAny(bool pAny) {
	if (pAny == true) {
		IsBot(false) ;
	}
	mAny = pAny;
}
bool Quantity::IsBot() const {
	return mBot;
}
void Quantity::IsBot(bool pBot) {
	if (pBot == true) {
		IsAny(false) ;
	}
	mBot = pBot;
}
bool Quantity::IsOrdered() const {
	return mOrdered;
}
void Quantity::IsOrdered(bool pOrdered) {
	mOrdered = pOrdered;
}

RealQuantity::RealQuantity() {

}
RealQuantity::RealQuantity(double pValue) {
	mValue = pValue ;
	IsBot(false);
}
std::string RealQuantity::QuantityType() {
	return sQuantityType ;
}

RealQuantity RealQuantity::Get() {
	return (*this);
}

void RealQuantity::Set(RealQuantity pValue) {
	*this = pValue ;
}

double RealQuantity::GetValue() const {
	return mValue ;
}
void RealQuantity::SetValue(double pValue) {
	mValue = pValue ;
	IsBot(false);
}

std::ostream& operator<<(std::ostream &pOs, const RealQuantity &pL) {
	double Val;
	Val = pL.mValue;
	pOs << Val;
	return pOs;
}

IntQuantity::IntQuantity() {

}
IntQuantity::IntQuantity(int pValue) {
	mValue = pValue ;
	IsBot(false);
}
std::string IntQuantity::QuantityType() {
	return sQuantityType ;
}
int IntQuantity::GetValue() const {
	return mValue ;
}
void IntQuantity::SetValue(int pValue) {
	mValue = pValue ;
	IsBot(false);
}

StringQuantity::StringQuantity() {

}
StringQuantity::StringQuantity(std::string pValue) {
	mValue = pValue ;
	IsBot(false);
}
std::string StringQuantity::QuantityType() {
	return sQuantityType ;
}
std::string StringQuantity::GetValue() const {
	return mValue ;
}
void StringQuantity::SetValue(std::string pValue) {
	mValue = pValue ;
	IsBot(false);
}

}
