summaryrefslogtreecommitdiff
path: root/src/T2DLL/LBroadcaster.h
blob: 0931c58a75dd8f5c6d85ff2c8a59787856022508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef T2DLL_LBROADCASTER_H
#define T2DLL_LBROADCASTER_H
#define DONT_INCLUDE_AFXTEMPL
#include "../common.h"
#include "LArray.h"

class AFX_CLASS_EXPORT LBroadcaster {
public:
	LBroadcaster();
	LBroadcaster(const LBroadcaster& other);
	virtual ~LBroadcaster();
	void AddListener(LListener* listener);
	void RemoveListener(LListener* listener);
	void BroadcastMessage(unsigned int msg, void* data);

	void StartBroadcasting() { mBroadcasting = true; }
	void StopBroadcasting() { mBroadcasting = false; }
	BOOL IsBroadcasting() const { return mBroadcasting; }

private:
	LArray mListeners;
	BOOL mBroadcasting;
};
#endif