#ifndef TRACKMANAGER_H
#define TRACKMANAGER_H
#include<complex>
#include<iostream>
#include<fstream>
#include<map>

using namespace std;
typedef std::complex<double> Creal;

class TrackManager{
public:
	ofstream ofs;							// name of stream
	int active = 0;							// stream active? no-0, yes-1
	map<string, const int*> var_int;		// map of integers (variable name + value)
	map<string, const double*> var_double;	// map of doubles (variable name + value)


	// ------ FUNCTIONS ------
	TrackManager();
	~TrackManager();

	// open file at given path and with given filename
	void init(string path, string filename);

	// Add integer to integer-map
	void add_variable_int(string name, int& value);
	// Add double to double-map
	void add_variable_double(string name, double& value);

	// write header, number of variables (int + double), number of timesteps and names of variables
	void write_begin(int number_time_steps);

	// write all variables to file
	void write();

	// close file
	void close();
};


#endif
