#ifndef COMMANDGENERATOR_H_
#define COMMANDGENERATOR_H_

#include <stdint.h>

#define COMMAND_LENGTH 4

typedef void (*stop_cb)(void* opaque);

typedef struct {
	void* opaque;
	stop_cb stop;
} callback;

class command_generator {
	public:

		command_generator();
		~command_generator() { }
		
		char get_character();
		void set_callbacks(callback callbacks);
	
	private:

		callback m_callbacks;
		const char* get_command();
		char get_next_character(const char* command);
		void prepare_next_command();

		int32_t m_command_index;

		int32_t m_operand1;
		int32_t m_operand2;

		char m_command[COMMAND_LENGTH+1];
		char m_operations[5];
		unsigned int m_operation_index;
};

#endif
