Update of /cvsroot/boost/boost/boost/signals/detail
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24250/boost/signals/detail
Modified Files:
named_slot_map.hpp
Log Message:
Improve signal invocation performance, from Robert Zeh
Index: named_slot_map.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/signals/detail/named_slot_map.hpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- named_slot_map.hpp 8 Dec 2005 03:12:53 -0000 1.12
+++ named_slot_map.hpp 30 Sep 2006 13:46:07 -0000 1.13
@@ -60,7 +60,8 @@
typedef const stored_group& first_argument_type;
typedef const stored_group& second_argument_type;
- group_bridge_compare(const Compare& c) : comp(c) {}
+ group_bridge_compare(const Compare& c) : comp(c)
+ { }
bool operator()(const stored_group& k1, const stored_group& k2) const
{
@@ -92,13 +93,39 @@
connection_slot_pair,
forward_traversal_tag> inherited;
public:
- named_slot_map_iterator();
- named_slot_map_iterator(const named_slot_map_iterator&);
- named_slot_map_iterator& operator=(const named_slot_map_iterator&);
-
- connection_slot_pair& dereference() const;
- void increment();
- bool equal(const named_slot_map_iterator& other) const;
+ named_slot_map_iterator() : slot_assigned(false)
+ { }
+ named_slot_map_iterator(const named_slot_map_iterator& other)
+ : group(other.group), last_group(other.last_group),
+ slot_assigned(other.slot_assigned)
+ {
+ if (slot_assigned) slot_ = other.slot_;
+ }
+ named_slot_map_iterator& operator=(const named_slot_map_iterator& other)
+ {
+ slot_assigned = other.slot_assigned;
+ group = other.group;
+ last_group = other.last_group;
+ if (slot_assigned) slot_ = other.slot_;
+ return *this;
+ }
+ connection_slot_pair& dereference() const
+ {
+ return *slot_;
+ }
+ void increment()
+ {
+ ++slot_;
+ if (slot_ == group->second.end()) {
+ ++group;
+ init_next_group();
+ }
+ }
+ bool equal(const named_slot_map_iterator& other) const {
+ return (group == other.group
+ && (group == last_group
+ || slot_ == other.slot_));
+ }
#if BOOST_WORKAROUND(_MSC_VER, <= 1400)
void decrement();
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|