#include "RealLatency.h"

namespace cosi {

std::string RealLatency::sQuantityName = "Latency";

RealLatency::RealLatency() {
	IsOrdered(true);
}

RealLatency::RealLatency(double pValue) :
	RealQuantity(pValue) {
	IsOrdered(true);
	IsBot(false);
}

RealLatency::~RealLatency() {
}

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

void RealLatency::Set(RealLatency pL) {
	IsBot(false) ;
	(*this) = pL ;
}

bool RealLatency::operator <(RealLatency pValue) {
	return ( GetValue() > pValue.GetValue() );
}
bool RealLatency::operator >(RealLatency pValue) {
	return ( GetValue() < pValue.GetValue());
}

bool RealLatency::operator ==(RealLatency pValue) {
	return ( GetValue() == pValue.GetValue() );
}

RealLatency RealLatency::operator+(RealLatency pL) {
	if ( Get() > pL.Get() ) {
		return Get();
	}
	return pL.Get();
}
RealLatency RealLatency::operator-(RealLatency pL) {
	if ( Get() < pL.Get() ) {
		return Get();
	}
	return pL.Get();
}

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

}