#ifndef SYNTHESISREPORT_H_
#define SYNTHESISREPORT_H_

#include <string>
#include <fstream>
#include "networks/wiredbas/WiredBasSpecificaion.h"
#include "networks/wiredbas/WiredBasImplementation.h"
#include "platforms/wiredbas/BusPlatform.h"
#include "platforms/wiredbas/NetworkPlatform.h"
#include "algorithms/graph/ConnectedComponents.h"
#include "models/wiredbas/link/EthernetLinkDelay.h"

namespace cosi {

namespace io {

namespace bas {

class SynthesisReport {
public:

	//BUS-BUS
	SynthesisReport(cosi::commstruct::wiredbas::Specification* pSpec,
			std::list<cosi::commstruct::wiredbas::Implementation*> Buses,
			cosi::platforms::wiredbas::BusPlatform* pPlt,
			cosi::commstruct::wiredbas::Implementation* pSecondLevel,
			std::string pFileName);
	//BUS-STAR
	SynthesisReport(cosi::commstruct::wiredbas::Specification* pSpec,
			std::list<cosi::commstruct::wiredbas::Implementation*> Buses,
			cosi::platforms::wiredbas::BusPlatform* pPlt,
			cosi::commstruct::wiredbas::Implementation* pSecondLevel,
			cosi::platforms::wiredbas::NetworkPlatform* pNetPlt,
			std::string pFileName);
	//STAR-STAR
	SynthesisReport(cosi::commstruct::wiredbas::Specification* pSpec,
			std::list<cosi::commstruct::wiredbas::Implementation*> Buses,
			cosi::platforms::wiredbas::NetworkPlatform* pPlt,
			cosi::commstruct::wiredbas::Implementation* pSecondLevel,
			std::string pFileName);

	void Append(std::string pFileName);
	void Run();
	virtual ~SynthesisReport();
private:

	void RunBusBased();
	void RunNetBased();

	cosi::commstruct::wiredbas::Specification* mSpec;
	std::list<cosi::commstruct::wiredbas::Implementation*> mBuses;
	cosi::commstruct::wiredbas::Implementation* mSecondLevel;
	cosi::platforms::wiredbas::BusPlatform* mPlt;
	cosi::platforms::wiredbas::NetworkPlatform* mNetPlt;
	std::string mFileName;
	bool mAppend;
	std::string mAppendFileName;
	std::map<std::string,int> mNcomponents;
	std::map<std::string,double> mCosts;
	double mSecondLevelWiring;

	bool mBusBased;
	bool mBusStar ;

};

}

}

}

#endif /*SYNTHESISREPORT_H_*/
