#ifndef IPPARSER_H_
#define IPPARSER_H_

#include <vector>
#include <string>
#include <iostream>
#include "../../environment/onchipcommunication/IpCore.h"
#include "../../environment/onchipcommunication/PlacedIpCore.h"
#include "tinyxml.h"

namespace cosi {

namespace io {

namespace onchipcommunication {

using namespace std ;
using namespace cosi::environment::onchipcommunication ;

using namespace std ;

class IpParser
{
public:

    IpParser( string Fname ) ;

    void Parse( ) ;

    vector< IpCore > GetIpCores( ) ;

	vector< PlacedIpCore > GetPlacedIpCores( ) ;

	bool IsPlaced( ) ;

private:

	void ParseNode( TiXmlNode* Parent ) ;

	void AddIpCore( TiXmlNode* Parent ) ;

	void SetFileType( TiXmlNode* Parent ) ;

	void AddPlacedIpCore( TiXmlNode* Parent ) ;


	string mFname ;

	vector< IpCore > mIp ;

	vector< PlacedIpCore > mPlacedIp ;

	bool mPlaced ;


} ;
}
}
}

#endif /*IPPARSER_H_*/
