summaryrefslogtreecommitdiff
path: root/src/T2DLL/LBroadcaster.h
blob: 77a6f70cbfc6b1b58484283f69bc60a31cdee934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#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;
};