#include <iostream>
using namespace std;

#include "CPFcpp.hpp"

class Descend : public StateBase
{
public:
	int stateTimeout;
	
	Descend(string stateid, int32_t timeout = -1) : StateBase{stateid, timeout}
	{
		cout << "\t\tDescend constructor, state ID: " << stateid << ", timeout = " << timeout << endl;
	};
	
private:
	enum SubStates
	{
		firstSubstate	
	};
	
	StateNames nextState = descend;
	
	void doStateEntryActions()
	{
		cout << "\t\tDescend: doing state entry actions; stateTimeout = " << stateTimeout << endl;
		nextState = descend;
	}
	void doStateActions()
	{
		cout << "\t\tDescend: doing state actions" << endl;
	}
	StateNames checkEvents()
	{
		cout << "\t\tDescend: checking events" << endl;
		return (recovery);
	}
	void doStateExit(bool timeout)
	{
		if (timeout)
			cout << "\t\tDescend: doing state exit with timeout" << endl;
		else
			cout << "\t\tDescend: doing state exit no timeout" << endl;
	}	
};