#ifndef TEST_TASK_HPP
#define TEST_TASK_HPP

#include <iostream>
#include <unistd.h>
#include <cstdlib>
#include <ctime>
#include "task.hpp"

class TestTask : public Task {
	private:
		int total_tasks;

	public:
		TestTask(int tasks): total_tasks(tasks) {}
		void execute_task(int worker_id , int worker_count) override {
		srand(time(0) ^ getpid());

		for (int i=0; i<total_tasks; i++) {
			if(i%worker_count==worker_id%worker_count) {
//				int delay = 1+rand()%3;

				std::cout << "PID " << getpid()
					  <<" PPID " << getppid()
					  <<" task " << i << "\n";
//				sleep(delay);
			}
		}
	}
};

#endif
