#pragma once #include "common.h" #include "LArray.h" class AFX_EXT_CLASS 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; };