#pragma once
#include "CivAssembly.h"

class CivConnection;

#define INPDLLEXPORT __declspec(dllexport)
/**
   转inp操作数据库类
*/
class INPDLLEXPORT CivInpHelperAbs
{
public:
	explicit CivInpHelperAbs(const std::string& uri);
	virtual ~CivInpHelperAbs();

	// 组件需要重载
	virtual bool getNode(CivNode& node)=0 ;
	virtual bool getPipe(CivPipe& pipe)=0 ;
	virtual bool getTank(CivTank& tank) = 0;
	virtual bool getValve(CivValve& valve) =0;
	virtual bool getPumps(CivPumps& pump) =0;
	virtual bool getReservoirs(CivReservoirs& reservoirs) =0;
	
	virtual bool getCoordinates(CivCoordinates& coord) =0;	
	virtual bool getQuality(CivQuality& quality)=0;
	void getSnToCode(std::map<std::string, std::string>& coord);

	// 不要重载函数
	bool getPatterns(CivPatterns& patterns) ;
	bool getCurves(CivCurves& curves) ;
	bool getDemands(CivDemands& demands) ;
	bool getSources(CivSources& sources) ;
	bool getStatus(CivStatus& status) ;
	bool getLabels(CivLabels& labels) ;
	bool getTags(CivTags& tags) ;
	bool getMixing(CivMixing& mixing);
	bool getParameter(std::vector<CivParameter>& param);
	bool getEmitters(CivEmitters& emitter);

protected:
	CivConnection* mDbConn;
};
