/*
 * batchRunner.hpp
 *
 *  Created on: November 15, 2019
 *      Author: vadims
 */

#ifndef BATCHRUNNER_HPP_
#define BATCHRUNNER_HPP_

#include <WinSock2.h>

#include <iostream>
#include <queue>
#include "messagedata.hpp"
#include "../outputAnalyzer/OutputAnalyzer.hpp"

using namespace std;


class batchRunner {
public:
	batchRunner(string, string, string);
	~batchRunner();

	messagedata run(std::shared_ptr<OutputAnalyzer>);
	void stop();

	messagedata readBuffer(HANDLE, std::shared_ptr<OutputAnalyzer>);

private:
	string wDir;  // working directory for running the batch process
	string exec;  // executable to run
	string arguments;  // arguments to pass to executable
	bool stopRequired;
	static int countBatchRunners; // static counter for all batchRunners


};

#endif BATCHRUNNER_HPP_