diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-14 09:49:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-14 23:53:51 -0500 |
commit | ae79b40f725ac28f8940bc9d97fd137088c20a22 (patch) | |
tree | 0ad551d0f576ba0c2e5bfb9622d32af9d3ee135a /include/svl | |
parent | f076c62d5cce5425d903b861827c83c16a040b86 (diff) |
Optimize SvtBroadcaster for insertion.
This helps file load performance at the slight overhead during editing.
That said, the overhead during editing is only in theory (not measured) and
shouldn't be that much even in theory.
Change-Id: If22ea34acb0cda311575ac3ed8ce1a8eb69ae33a
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/broadcast.hxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx index 80d9568b6392..6a6bc03c6fd6 100644 --- a/include/svl/broadcast.hxx +++ b/include/svl/broadcast.hxx @@ -21,7 +21,7 @@ #include <svl/svldllapi.h> -#include <boost/unordered_set.hpp> +#include <vector> class SvtListener; class SfxHint; @@ -31,11 +31,18 @@ class SVL_DLLPUBLIC SvtBroadcaster public: friend class SvtListener; - typedef boost::unordered_set<SvtListener*> ListenersType; + typedef std::vector<SvtListener*> ListenersType; private: const SvtBroadcaster& operator=(const SvtBroadcaster &); // verboten + /** + * Ensure that the container doesn't contain any duplicated listener + * entries. As a side effect, the listeners get sorted by pointer values + * after this call. + */ + void Normalize(); + void Add( SvtListener* p ); void Remove( SvtListener* p ); @@ -55,7 +62,8 @@ public: private: ListenersType maListeners; - bool mbDying; + bool mbDisposing:1; + bool mbNormalized:1; }; |