diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-13 20:33:50 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-14 23:53:50 -0500 |
commit | 18d07b2affbbbfb2ff9152d3ad8d1744fe75ab47 (patch) | |
tree | 49e285fe010f073c89f92f321397a495902f78a5 /include/svl/broadcast.hxx | |
parent | d7867b28623e4220f62b8ed9259bed5d8878a3b3 (diff) |
Rework SvtListener and SvtBroadcaster internals.
The old code was simply awkward.
Change-Id: I1a58a9af86c100be238d306570b40f70c5100314
Diffstat (limited to 'include/svl/broadcast.hxx')
-rw-r--r-- | include/svl/broadcast.hxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx index 0b533ba28568..ab62d488cce6 100644 --- a/include/svl/broadcast.hxx +++ b/include/svl/broadcast.hxx @@ -20,36 +20,41 @@ #define INCLUDED_SVL_BROADCAST_HXX #include <svl/svldllapi.h> -#include <tools/rtti.hxx> + +#include <boost/unordered_set.hpp> class SvtListener; class SfxHint; -class SvtListenerBase; - -//------------------------------------------------------------------------- class SVL_DLLPUBLIC SvtBroadcaster { -friend class SvtListener; -friend class SvtListenerBase; -friend class SvtListenerIter; - SvtListenerBase* pRoot; +public: + friend class SvtListener; + + typedef boost::unordered_set<SvtListener*> ListenersType; +private: const SvtBroadcaster& operator=(const SvtBroadcaster &); // verboten + void Add( SvtListener* p ); + void Remove( SvtListener* p ); + protected: virtual void ListenersGone(); public: - TYPEINFO(); - SvtBroadcaster(); SvtBroadcaster( const SvtBroadcaster &rBC ); virtual ~SvtBroadcaster(); void Broadcast( const SfxHint &rHint ); - sal_Bool HasListeners() const { return 0 != pRoot; } + ListenersType& GetAllListeners(); + + bool HasListeners() const; + +private: + ListenersType maListeners; }; |