#ifndef SHSHISTORYDATABASEINFLUXDB_H
#define SHSHISTORYDATABASEINFLUXDB_H

#include "history_database_base.h"


class SHSHistoryDatabaseInfluxDB : public SHSHistoryDatabaseBase
{
	Q_OBJECT
public:
	SHSHistoryDatabaseInfluxDB(const QString address = "127.0.0.1:8086");
	~SHSHistoryDatabaseInfluxDB();

	virtual QPolygonF readHistory(int id) override;

protected:
	virtual bool init(QString filename, const QList<SHSHistoryDatabaseBase::Variable> & vars) override;
	virtual void destroy() override;
	virtual void writeRows(int var_id, const QList<HistoryRow> & rows) override;
	virtual void removeOldRows(int var_id) override;

private:
	std::string server_ip;
	int server_port;
	std::string database_name;
	QMap<int, std::string> var_names;
};

#endif // SHSHISTORYDATABASEINFLUXDB_H
