/*
 * batch_manager.h
 *
 */

#ifndef BATCH_MANAGER_H_
#define BATCH_MANAGER_H_

#include <stdint.h>

class BatchHandler
{
public:
	virtual ~BatchHandler();

	virtual void batchExec(unsigned int time_us);
};

class BatchManager
{
public:
	static void initialize();

	static void registerHandler(BatchHandler& handler);

	static void batchEnd();

	static void fire();

	static void setMaster(bool i_am_the_master);

	static void degradedTimetagSync(unsigned long tt64us);

	static bool broadcastExternalSynch();

	static bool broadcastExternalSynchFrom(const void* memory);

	static bool broadcastSynchDecode(uint64_t& time_us, uint32_t& time_64us, const void* pkt, unsigned int pkt_len);

	static void batchSimulation();

	static void setSlaveTimetag(bool i_am_a_slave);
};

#endif /* BATCH_MANAGER_H_ */


