#ifndef ARCNETBUSDELAY_H_
#define ARCNETBUSDELAY_H_

#include "networks/wiredbas/WiredBasImplementation.h"
#include "quantities/RealDelay.h"
#include "models/wiredbas/common/BusDelay.h"
#include "models/wiredbas/common/WireDelayModel.h"
#include "float.h"

namespace cosi {

namespace models {

namespace wiredbas {

class ArcnetBusDelay : public BusDelay {

	cosi::models::wiredbas::WireDelay* mWireDelay;

	int ComputeMessageLength(int pLength);

	double mBusSpeed;

	enum tProtocolPhases {IIT,FBE,ACK,SPAC,LPAC};

	map< int , int > mMsgLength;

public:

	ArcnetBusDelay(double pBusSpeed, cosi::models::wiredbas::WireDelay* pWireDelay);

	~ArcnetBusDelay();

	void SetWireDelayModel(cosi::models::wiredbas::WireDelay* pWireDelay);

	RealDelay Get(cosi::commstruct::wiredbas::Implementation pC);

	RealDelay Get(cosi::commstruct::wiredbas::Implementation* pC);

	double GetValue(cosi::commstruct::wiredbas::Implementation pC);

	double GetValue(cosi::commstruct::wiredbas::Implementation* pC);

};

}

}

}

#endif /*ARCNETBUSDELAY_H_*/
