You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
//----------------------------------------------------------------------------
|
|
// Dr.Frucht Systems Ltd.
|
|
// Copyright © 2000-2016. All Rights Reserved.
|
|
// Version 2.0 3/30/2016
|
|
// Last modification: 3/30/2016
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: basicEvtDispatcher.h
|
|
// AUTHOR: gagua
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of basicEvtDispatcher.h
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
|
|
#ifndef __BASICEVTDISPATCHER_H_INCL__
|
|
#define __BASICEVTDISPATCHER_H_INCL__
|
|
|
|
//#include <pthread.h>
|
|
#include "basicMutex.h"
|
|
#include "basicEvent.h"
|
|
|
|
/**
|
|
* TODO: Add class description
|
|
*
|
|
* @author gagua
|
|
*/
|
|
class EventDispatchService{
|
|
public:
|
|
EventDispatchService(){};
|
|
~EventDispatchService(){};
|
|
virtual void dispatch( basicEvent *Evt ){};
|
|
};
|
|
|
|
class basicEventLogger: public EventDispatchService{
|
|
private:
|
|
bool bLogging;
|
|
const char *sLogFileName;
|
|
public:
|
|
basicEventLogger(){ bLogging = false; sLogFileName = NULL; };
|
|
basicEventLogger( const char *FileName );
|
|
~basicEventLogger(){};
|
|
void dispatch( basicEvent *Evt );
|
|
};
|
|
|
|
class basicEventDispatcherCollection{
|
|
private:
|
|
//pthread_mutex_t m_mQueueMutex;
|
|
basicMutex m_mQueueMutex;
|
|
EventQueue *m_pEvtQueue;
|
|
public:
|
|
basicEventDispatcherCollection();
|
|
~basicEventDispatcherCollection();
|
|
void addHandler( EventDispatchService *handler );
|
|
void broadcast( basicEvent *Evt );
|
|
};
|
|
|
|
#endif // __BASICEVTDISPATCHER_H_INCL__
|