summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/FanOutExchange.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2009-09-25 18:04:59 +0000
committerKim van der Riet <kpvdr@apache.org>2009-09-25 18:04:59 +0000
commit6214f62e118a83b4cc593298ceb0658e28662845 (patch)
treef4d46eef519ec14cc1de6c3f3600c2ca36de6acd /cpp/src/qpid/broker/FanOutExchange.cpp
parent85be7c43c229fa30e76aaf3acfed3c67d6f1eff6 (diff)
downloadqpid-python-6214f62e118a83b4cc593298ceb0658e28662845.tar.gz
Exchange route() refactorization that eliminates common code in each of the Exchange subclass route() methods.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@818935 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/FanOutExchange.cpp')
-rw-r--r--cpp/src/qpid/broker/FanOutExchange.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/cpp/src/qpid/broker/FanOutExchange.cpp b/cpp/src/qpid/broker/FanOutExchange.cpp
index e9007ba682..b7d46a33fe 100644
--- a/cpp/src/qpid/broker/FanOutExchange.cpp
+++ b/cpp/src/qpid/broker/FanOutExchange.cpp
@@ -106,36 +106,12 @@ bool FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*key*/, cons
return true;
}
-void FanOutExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* /*args*/){
+void FanOutExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* /*args*/)
+{
PreRoute pr(msg, this);
- uint32_t count(0);
-
- BindingsArray::ConstPtr p = bindings.snapshot();
- if (p.get()){
- for(std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); ++i, count++){
- msg.deliverTo((*i)->queue);
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched ();
- }
- }
-
- if (mgmtExchange != 0)
- {
- mgmtExchange->inc_msgReceives ();
- mgmtExchange->inc_byteReceives (msg.contentSize ());
- if (count == 0)
- {
- mgmtExchange->inc_msgDrops ();
- mgmtExchange->inc_byteDrops (msg.contentSize ());
- }
- else
- {
- mgmtExchange->inc_msgRoutes (count);
- mgmtExchange->inc_byteRoutes (count * msg.contentSize ());
- }
- }
+ doRoute(msg, bindings.snapshot());
}
-
+
bool FanOutExchange::isBound(Queue::shared_ptr queue, const string* const, const FieldTable* const)
{
BindingsArray::ConstPtr ptr = bindings.snapshot();