#include "StdAfx.h" #include "LBroadcaster.h" #include "LListener.h" LListener::LListener() { mListening = true; } LListener::LListener(const LListener& other) { mListening = other.mListening; } /*virtual*/ LListener::~LListener() { LBroadcaster *broadcaster; for (int index = mBroadcasters.GetCount(); index > 0; index--) { if (mBroadcasters.FetchItemAt(index, &broadcaster)) broadcaster->RemoveListener(this); } } void LListener::AddBroadcaster(LBroadcaster* broadcaster) { mBroadcasters.Add(&broadcaster); } void LListener::RemoveBroadcaster(LBroadcaster* broadcaster) { mBroadcasters.Remove(&broadcaster); }