#include "EthernetController.h"

namespace cosi {

namespace library {

namespace wiredbas {

EthernetController::EthernetController() {
	ComponentName = "Ethernet-Controller";
	ComponentType = "Controller";
	mPorts.AddPort("P1", "Eth", cosi::PortInterface::INOUT) ;
}

EthernetController::~EthernetController() {
}

cosi::commstruct::wiredbas::PlatformInstance* EthernetController::GetPlatformInstance(
		int V, Position pP) {
	cosi::commstruct::wiredbas::PlatformInstance * RetVal =
			new cosi::commstruct::wiredbas::PlatformInstance("");
	RetVal->AddVertex(V) ;
	(*RetVal)[V].PRJ(Name)SetValue(ComponentName);
	(*RetVal)[V].PRJ(Type)SetValue(ComponentType);
	(*RetVal)[V].PRJ(Position)Set(pP);
	(*RetVal)[V].PRJ(Ports)Set(mPorts);
	return RetVal;
}
cosi::commstruct::wiredbas::Implementation* EthernetController::GetImplementationInstance(
		int V, Position pP, ThreadSet pThreads, TransferTable pT) {
	cosi::commstruct::wiredbas::Implementation
				* RetVal = new cosi::commstruct::wiredbas::Implementation("");
	RetVal->AddVertex(V) ;
	(*RetVal)[V].PRJ(Name)SetValue(ComponentName);
	(*RetVal)[V].PRJ(Type)SetValue(ComponentType);
	(*RetVal)[V].PRJ(Position)Set(pP);
	(*RetVal)[V].PRJ(Ports)Set(mPorts);
	(*RetVal)[V].PRJ(ThreadSet)Set(pThreads);
	(*RetVal)[V].PRJ(TransferTable)Set(pT);
	return RetVal;
}

double EthernetController::GetCost() {
	return mCostModel->GetValue(ComponentName, ComponentType, mPorts) ;
}
RealDelay
EthernetController::GetDelay(Vertex NodeId,
				cosi::commstruct::wiredbas::Implementation* pI, Vertex Src,
				Vertex Dest){
	return RealDelay(0);
}
double
EthernetController::GetDelayValue(Vertex NodeId,
				cosi::commstruct::wiredbas::Implementation* pI, Vertex Src,
				Vertex Dest){
	return 0 ;
}

}

}

}
