// WMEventHandler.h: interface for the WMEventHandler class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000 - 2002 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// WMEventHandler class - a class for finite state machine support.
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WMEVENTHANDLER_H__59245714_1BD2_11D3_9E20_00105AABC815__INCLUDED_)
#define AFX_WMEVENTHANDLER_H__59245714_1BD2_11D3_9E20_00105AABC815__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define NUM_ACTION_FUNCTIONS 128
// null event
#define EV_NULL_EVENT 0

class WMEventHandler  
{
public:
	WMEventHandler();
	virtual ~WMEventHandler();
	int HandleEvent(int nActionIndex);

protected:

	virtual int InitializeStateMachine() = 0;

	typedef int (WMEventHandler::*ActFuncPtr)();
	// array of transition action functions
	ActFuncPtr m_ActionFunctions[NUM_ACTION_FUNCTIONS];
};

#endif // !defined(AFX_WMEVENTHANDLER_H__59245714_1BD2_11D3_9E20_00105AABC815__INCLUDED_)
