#ifndef ARCNETBUS_H_
#define ARCNETBUS_H_

#include <string>
#include "libraries/wiredbas/common/Bus.h"
#include "rules/wiredbas/link/WiringRule.h"
#include "rules/wiredbas/node/ArcnetBusRule.h"
#include "models/wiredbas/common/WireCost.h"
#include "models/wiredbas/common/WireDelayModel.h"
#include "models/wiredbas/node/ArcnetBusCost.h"
#include "models/wiredbas/node/ArcnetBusDelay.h"

namespace cosi {

namespace library {

namespace wiredbas {

class ArcnetBus : public Bus {
	//Wiring model
	cosi::rules::wiredbas::WiringRule* mWiringRule;
	//Bus rules
	cosi::rules::wiredbas::ArcnetBusRule* mArcnetBusRule;
	//Cost model
	cosi::models::wiredbas::WireCost* mWireCost;
	cosi::models::wiredbas::ArcnetBusCost* mBusCost;
	//Delay model
	cosi::models::wiredbas::WireDelay* mWireDelay;
	cosi::models::wiredbas::ArcnetBusDelay* mBusDelay;

	double mBusSpeed;
public:

	ArcnetBus(double pBusSpeed, cosi::rules::wiredbas::WiringRule* pWiringRule,
			cosi::models::wiredbas::WireCost* pWireCost,
			cosi::models::wiredbas::WireDelay* pWireDelay);

	virtual ~ArcnetBus();

	void SetWiringRule(cosi::rules::wiredbas::WiringRule* pWiringRule);
	void SetWireCostModel(cosi::models::wiredbas::WireCost* pWireCost);
	void SetWireDelayModel(cosi::models::wiredbas::WireDelay* pWireDealy);

	double BusAccessLatencyValue(
			cosi::commstruct::wiredbas::Implementation* pBus);
	double BusAccessLatencyValue(int pNodeId,
			cosi::commstruct::wiredbas::Implementation* pBus);
	bool Satisfies(cosi::commstruct::wiredbas::Implementation* pBus);

	double
			GetBusBandwidthValue(
					cosi::commstruct::wiredbas::Implementation* pBus);

	double GetCost(cosi::commstruct::wiredbas::Implementation* pBus);

	static std::string ComponentName;
	static std::string ComponentType;
};

}
}
}
#endif /*ARCNET_H_*/
