// lsreventhandler.cpp: implementation of the LrsEventHandler class.
//
//////////////////////////////////////////////////////////////////////
#include "lrsapp.h"
#include "lrseventhandler.h"
#include "debug.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

LrsEventHandler::LrsEventHandler(const char *name, LrsApp *pApp)
	:MicroEventHandler (name, pApp->_taskSync),
	_pSupplier(pApp->_pSupplier)
{
	_pApp = pApp;	
	addEventMonitor(&_pApp->_ih.shutdown_);
}

LrsEventHandler::~LrsEventHandler()
{
}
int LrsEventHandler::processEvents()
{

	DPRINTF_L3("LrsEventHandler::processEvents() start \n");
		
	if(_pApp->_ih.shutdown_.isSet()) { // start shutdown
		_pApp->shutdown();
	}

	DPRINTF_L3("LrsEventHandler::processEvents() end \n");
	return 0;
}

MBool LrsEventHandler::shutdown()
{
	DPRINTF_L3("LrsEventHandler::shutdown()\n");

	return TRUE; //TODO: return status
}

