#include "PhysicalInterface.h"

namespace cosi {

namespace quantity {

namespace onchipcommunication {

PhysicalInterface::PhysicalInterface() {
	mWidth = 0;
}

PhysicalInterface::~PhysicalInterface() {
}

int PhysicalInterface::GetWidth() const {
	return mWidth ;
}

void PhysicalInterface::SetWidth(int pWidth) {
	mWidth = pWidth ;
}

double PhysicalInterface::GetSpeed() const {
	return mSpeed ;
}

void PhysicalInterface::SetSpeed(double pSpeed) {
	mSpeed = pSpeed ;
}

int PhysicalInterface::GetNumberOfVirtualChannels()const {
	return mNchannels ;
}
void PhysicalInterface::SetNumberOfVirtualChannels(int pNchannels){
	mNchannels = pNchannels ;
}
int PhysicalInterface::GetBufferLength()const {
	return mLength ;
}

void PhysicalInterface::SetBufferLength(int pLength){
	mLength = pLength ;
}

bool PhysicalInterface::operator==(const PhysicalInterface &pIf) {
	if ( mWidth == pIf.GetWidth() &&
			mSpeed == pIf.GetSpeed() &&
			mNchannels == pIf.GetNumberOfVirtualChannels() &&
			mLength == pIf.GetBufferLength()) {
		return true;
	} else {
		return false;
	}
}

std::ostream& operator<<(std::ostream &pOs, const PhysicalInterface &pP) {
	pOs << "Interface Width " << pP.GetWidth() << std::endl;
	pOs << "Interface Speed " << pP.GetSpeed();
	return pOs;
}

}

}

}
