diff options
Diffstat (limited to 'cpp/broker/src')
-rw-r--r-- | cpp/broker/src/Broker.cpp | 2 | ||||
-rw-r--r-- | cpp/broker/src/Channel.cpp | 29 | ||||
-rw-r--r-- | cpp/broker/src/Configuration.cpp | 3 | ||||
-rw-r--r-- | cpp/broker/src/DirectExchange.cpp | 6 | ||||
-rw-r--r-- | cpp/broker/src/FanOutExchange.cpp | 6 | ||||
-rw-r--r-- | cpp/broker/src/HeadersExchange.cpp | 41 | ||||
-rw-r--r-- | cpp/broker/src/Message.cpp | 4 | ||||
-rw-r--r-- | cpp/broker/src/Queue.cpp | 21 | ||||
-rw-r--r-- | cpp/broker/src/SessionHandlerImpl.cpp | 93 | ||||
-rw-r--r-- | cpp/broker/src/TopicExchange.cpp | 7 |
10 files changed, 109 insertions, 103 deletions
diff --git a/cpp/broker/src/Broker.cpp b/cpp/broker/src/Broker.cpp index 5d59b63622..99cf8d6ce4 100644 --- a/cpp/broker/src/Broker.cpp +++ b/cpp/broker/src/Broker.cpp @@ -87,6 +87,6 @@ Acceptor* createAcceptor(Configuration& config){ throw Configuration::ParseException("Unrecognised acceptor: " + type); } -void handle_signal(int signal){ +void handle_signal(int /*signal*/){ std::cout << "Shutting down..." << std::endl; } diff --git a/cpp/broker/src/Channel.cpp b/cpp/broker/src/Channel.cpp index ed1125ee76..7bc6d599e9 100644 --- a/cpp/broker/src/Channel.cpp +++ b/cpp/broker/src/Channel.cpp @@ -26,16 +26,17 @@ using namespace qpid::framing; using namespace qpid::concurrent; -Channel::Channel(OutputHandler* _out, int _id, u_int32_t _framesize) : out(_out), - id(_id), - prefetchCount(0), - prefetchSize(0), - outstandingSize(0), - outstandingCount(0), - framesize(_framesize), - transactional(false), - deliveryTag(1), - tagGenerator("sgen"){} +Channel::Channel(OutputHandler* _out, int _id, u_int32_t _framesize) : + id(_id), + out(_out), + deliveryTag(1), + transactional(false), + prefetchSize(0), + prefetchCount(0), + outstandingSize(0), + outstandingCount(0), + framesize(_framesize), + tagGenerator("sgen"){} Channel::~Channel(){ } @@ -156,10 +157,10 @@ void Channel::handlePublish(Message* msg){ message = Message::shared_ptr(msg); } -void Channel::ack(u_int64_t deliveryTag, bool multiple){ +void Channel::ack(u_int64_t _deliveryTag, bool multiple){ Locker locker(deliveryLock);//need to synchronize with possible concurrent delivery - ack_iterator i = find_if(unacknowledged.begin(), unacknowledged.end(), MatchAck(deliveryTag)); + ack_iterator i = find_if(unacknowledged.begin(), unacknowledged.end(), MatchAck(_deliveryTag)); if(i == unacknowledged.end()){ throw InvalidAckException(); }else if(multiple){ @@ -178,8 +179,8 @@ void Channel::ack(u_int64_t deliveryTag, bool multiple){ //if the prefetch limit had previously been reached, there may //be messages that can be now be delivered - for(consumer_iterator i = consumers.begin(); i != consumers.end(); i++){ - i->second->requestDispatch(); + for(consumer_iterator j = consumers.begin(); j != consumers.end(); j++){ + j->second->requestDispatch(); } } diff --git a/cpp/broker/src/Configuration.cpp b/cpp/broker/src/Configuration.cpp index aceb35bc87..11c2d374fe 100644 --- a/cpp/broker/src/Configuration.cpp +++ b/cpp/broker/src/Configuration.cpp @@ -16,6 +16,7 @@ * */ #include "Configuration.h" +#include <string.h> using namespace qpid::broker; using namespace std; @@ -191,5 +192,5 @@ bool Configuration::BoolOption::needsValue() const { } void Configuration::BoolOption::setValue(const std::string& _value){ - value = true; + value = strcasecmp(_value.c_str(), "true") == 0; } diff --git a/cpp/broker/src/DirectExchange.cpp b/cpp/broker/src/DirectExchange.cpp index ca29225bee..94cfbc766d 100644 --- a/cpp/broker/src/DirectExchange.cpp +++ b/cpp/broker/src/DirectExchange.cpp @@ -22,7 +22,7 @@ using namespace qpid::broker; using namespace qpid::framing; -DirectExchange::DirectExchange(const string& name) : Exchange(name) { +DirectExchange::DirectExchange(const string& _name) : Exchange(_name) { } @@ -37,7 +37,7 @@ void DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fie lock.release(); } -void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); std::vector<Queue::shared_ptr>& queues(bindings[routingKey]); @@ -51,7 +51,7 @@ void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, F lock.release(); } -void DirectExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void DirectExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); std::vector<Queue::shared_ptr>& queues(bindings[routingKey]); int count(0); diff --git a/cpp/broker/src/FanOutExchange.cpp b/cpp/broker/src/FanOutExchange.cpp index 4eb75cb920..e8cb8f6315 100644 --- a/cpp/broker/src/FanOutExchange.cpp +++ b/cpp/broker/src/FanOutExchange.cpp @@ -23,7 +23,7 @@ using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::concurrent; -FanOutExchange::FanOutExchange(const std::string& name) : Exchange(name) {} +FanOutExchange::FanOutExchange(const std::string& _name) : Exchange(_name) {} void FanOutExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ Locker locker(lock); @@ -35,7 +35,7 @@ void FanOutExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fie } } -void FanOutExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, FieldTable* /*args*/){ Locker locker(lock); Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue); if (i != bindings.end()) { @@ -44,7 +44,7 @@ void FanOutExchange::unbind(Queue::shared_ptr queue, const string& routingKey, F } } -void FanOutExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void FanOutExchange::route(Message::shared_ptr& msg, const string& /*routingKey*/, FieldTable* /*args*/){ Locker locker(lock); for(Queue::vector::iterator i = bindings.begin(); i != bindings.end(); ++i){ (*i)->deliver(msg); diff --git a/cpp/broker/src/HeadersExchange.cpp b/cpp/broker/src/HeadersExchange.cpp index 03a029ea4d..65204cdb85 100644 --- a/cpp/broker/src/HeadersExchange.cpp +++ b/cpp/broker/src/HeadersExchange.cpp @@ -18,8 +18,10 @@ #include "HeadersExchange.h" #include "ExchangeBinding.h" #include "Value.h" +#include "QpidError.h" #include <algorithm> + using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::concurrent; @@ -28,38 +30,36 @@ using namespace qpid::concurrent; // The current search algorithm really sucks. // Fieldtables are heavy, maybe use shared_ptr to do handle-body. -namespace qpid { -namespace broker { +using namespace qpid::broker; namespace { -const std::string all("all"); -const std::string any("any"); -const std::string x_match("x-match"); + const std::string all("all"); + const std::string any("any"); + const std::string x_match("x-match"); } -HeadersExchange::HeadersExchange(const string& name) : Exchange(name) { } +HeadersExchange::HeadersExchange(const string& _name) : Exchange(_name) { } void HeadersExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ std::cout << "HeadersExchange::bind" << std::endl; Locker locker(lock); std::string what = args->getString("x-match"); - // TODO aconway 2006-09-26: throw an exception for invalid bindings. - if (what != all && what != any) return; // Invalid. + if (what != all && what != any) { + THROW_QPID_ERROR(PROTOCOL_ERROR, "Invalid x-match value binding to headers exchange."); + } bindings.push_back(Binding(*args, queue)); queue->bound(new ExchangeBinding(this, queue, routingKey, args)); } -void HeadersExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ - Locker locker(lock);; - for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) { - if (i->first == *args) { - bindings.erase(i); - } - } +void HeadersExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, FieldTable* args){ + Locker locker(lock); + Bindings::iterator i = + std::find(bindings.begin(),bindings.end(), Binding(*args, queue)); + if (i != bindings.end()) bindings.erase(i); } -void HeadersExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void HeadersExchange::route(Message::shared_ptr& msg, const string& /*routingKey*/, FieldTable* args){ std::cout << "route: " << *args << std::endl; Locker locker(lock);; for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) { @@ -70,12 +70,13 @@ void HeadersExchange::route(Message::shared_ptr& msg, const string& routingKey, HeadersExchange::~HeadersExchange() {} const std::string HeadersExchange::typeName("headers"); + namespace { -bool match_values(const Value& bind, const Value& msg) { - return dynamic_cast<const EmptyValue*>(&bind) || bind == msg; -} + bool match_values(const Value& bind, const Value& msg) { + return dynamic_cast<const EmptyValue*>(&bind) || bind == msg; + } } @@ -115,5 +116,5 @@ bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) { } } -}} + diff --git a/cpp/broker/src/Message.cpp b/cpp/broker/src/Message.cpp index b0e5d16b77..0a8a5f7a4d 100644 --- a/cpp/broker/src/Message.cpp +++ b/cpp/broker/src/Message.cpp @@ -41,8 +41,8 @@ Message::Message(const ConnectionToken* const _publisher, Message::~Message(){ } -void Message::setHeader(AMQHeaderBody::shared_ptr header){ - this->header = header; +void Message::setHeader(AMQHeaderBody::shared_ptr _header){ + this->header = _header; } void Message::addContent(AMQContentBody::shared_ptr data){ diff --git a/cpp/broker/src/Queue.cpp b/cpp/broker/src/Queue.cpp index 1db4454235..eaaa3ffa31 100644 --- a/cpp/broker/src/Queue.cpp +++ b/cpp/broker/src/Queue.cpp @@ -22,16 +22,17 @@ using namespace qpid::broker; using namespace qpid::concurrent; -Queue::Queue(const string& _name, bool _durable, u_int32_t _autodelete, const ConnectionToken* const _owner) : name(_name), - durable(_durable), - autodelete(_autodelete), - owner(_owner), - queueing(false), - dispatching(false), - next(0), - lastUsed(0), - exclusive(0){ - +Queue::Queue(const string& _name, bool _durable, u_int32_t _autodelete, const ConnectionToken* const _owner) : + name(_name), + autodelete(_autodelete), + durable(_durable), + owner(_owner), + queueing(false), + dispatching(false), + next(0), + lastUsed(0), + exclusive(0) +{ if(autodelete) lastUsed = apr_time_as_msec(apr_time_now()); } diff --git a/cpp/broker/src/SessionHandlerImpl.cpp b/cpp/broker/src/SessionHandlerImpl.cpp index ad73c1b23b..0d8539332c 100644 --- a/cpp/broker/src/SessionHandlerImpl.cpp +++ b/cpp/broker/src/SessionHandlerImpl.cpp @@ -33,21 +33,20 @@ SessionHandlerImpl::SessionHandlerImpl(SessionContext* _context, QueueRegistry* _queues, ExchangeRegistry* _exchanges, AutoDelete* _cleaner, - const u_int32_t _timeout) : context(_context), - queues(_queues), - exchanges(_exchanges), - cleaner(_cleaner), - timeout(_timeout), - channelHandler(new ChannelHandlerImpl(this)), - connectionHandler(new ConnectionHandlerImpl(this)), - basicHandler(new BasicHandlerImpl(this)), - exchangeHandler(new ExchangeHandlerImpl(this)), - queueHandler(new QueueHandlerImpl(this)), - client(context), - framemax(65536), - heartbeat(0){ - -} + const u_int32_t _timeout) : + context(_context), + client(context), + queues(_queues), + exchanges(_exchanges), + cleaner(_cleaner), + timeout(_timeout), + connectionHandler(new ConnectionHandlerImpl(this)), + channelHandler(new ChannelHandlerImpl(this)), + basicHandler(new BasicHandlerImpl(this)), + exchangeHandler(new ExchangeHandlerImpl(this)), + queueHandler(new QueueHandlerImpl(this)), + framemax(65536), + heartbeat(0) {} SessionHandlerImpl::~SessionHandlerImpl(){ // TODO aconway 2006-09-07: Should be auto_ptr or plain members. @@ -123,7 +122,7 @@ void SessionHandlerImpl::received(qpid::framing::AMQFrame* frame){ } } -void SessionHandlerImpl::initiated(qpid::framing::ProtocolInitiation* header){ +void SessionHandlerImpl::initiated(qpid::framing::ProtocolInitiation* /*header*/){ //send connection start FieldTable properties; string mechanisms("PLAIN"); @@ -161,51 +160,53 @@ void SessionHandlerImpl::handleContent(u_int16_t channel, AMQContentBody::shared getChannel(channel)->handleContent(body, Router(*exchanges)); } -void SessionHandlerImpl::handleHeartbeat(AMQHeartbeatBody::shared_ptr body){ +void SessionHandlerImpl::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){ std::cout << "SessionHandlerImpl::handleHeartbeat()" << std::endl; } -void SessionHandlerImpl::ConnectionHandlerImpl::startOk(u_int16_t channel, FieldTable& clientProperties, string& mechanism, - string& response, string& locale){ +void SessionHandlerImpl::ConnectionHandlerImpl::startOk( + u_int16_t /*channel*/, FieldTable& /*clientProperties*/, string& /*mechanism*/, + string& /*response*/, string& /*locale*/){ parent->client.getConnection().tune(0, 100, parent->framemax, parent->heartbeat); } -void SessionHandlerImpl::ConnectionHandlerImpl::secureOk(u_int16_t channel, string& response){} +void SessionHandlerImpl::ConnectionHandlerImpl::secureOk(u_int16_t /*channel*/, string& /*response*/){} -void SessionHandlerImpl::ConnectionHandlerImpl::tuneOk(u_int16_t channel, u_int16_t channelmax, u_int32_t framemax, u_int16_t heartbeat){ +void SessionHandlerImpl::ConnectionHandlerImpl::tuneOk(u_int16_t /*channel*/, u_int16_t /*channelmax*/, u_int32_t framemax, u_int16_t heartbeat){ parent->framemax = framemax; parent->heartbeat = heartbeat; } -void SessionHandlerImpl::ConnectionHandlerImpl::open(u_int16_t channel, string& virtualHost, string& capabilities, bool insist){ +void SessionHandlerImpl::ConnectionHandlerImpl::open(u_int16_t /*channel*/, string& /*virtualHost*/, string& /*capabilities*/, bool /*insist*/){ string knownhosts; parent->client.getConnection().openOk(0, knownhosts); } -void SessionHandlerImpl::ConnectionHandlerImpl::close(u_int16_t channel, u_int16_t replyCode, string& replyText, - u_int16_t classId, u_int16_t methodId){ - +void SessionHandlerImpl::ConnectionHandlerImpl::close( + u_int16_t /*channel*/, u_int16_t /*replyCode*/, string& /*replyText*/, + u_int16_t /*classId*/, u_int16_t /*methodId*/) +{ parent->client.getConnection().closeOk(0); parent->context->close(); } -void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t channel){ +void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t /*channel*/){ parent->context->close(); } -void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, string& outOfBand){ +void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, string& /*outOfBand*/){ parent->channels[channel] = new Channel(parent->context, channel, parent->framemax); parent->client.getChannel().openOk(channel); } -void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t channel, bool active){} -void SessionHandlerImpl::ChannelHandlerImpl::flowOk(u_int16_t channel, bool active){} +void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t /*channel*/, bool /*active*/){} +void SessionHandlerImpl::ChannelHandlerImpl::flowOk(u_int16_t /*channel*/, bool /*active*/){} -void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t replyCode, string& replyText, - u_int16_t classId, u_int16_t methodId){ +void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t /*replyCode*/, string& /*replyText*/, + u_int16_t /*classId*/, u_int16_t /*methodId*/){ Channel* c = parent->getChannel(channel); if(c){ parent->channels.erase(channel); @@ -215,13 +216,13 @@ void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t } } -void SessionHandlerImpl::ChannelHandlerImpl::closeOk(u_int16_t channel){} +void SessionHandlerImpl::ChannelHandlerImpl::closeOk(u_int16_t /*channel*/){} -void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16_t ticket, string& exchange, string& type, - bool passive, bool durable, bool autoDelete, bool internal, bool nowait, - FieldTable& arguments){ +void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, string& type, + bool passive, bool /*durable*/, bool /*autoDelete*/, bool /*internal*/, bool nowait, + FieldTable& /*arguments*/){ if(!passive && ( type != TopicExchange::typeName && @@ -252,7 +253,7 @@ void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16 } } -void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16_t ticket, string& exchange, bool ifUnused, bool nowait){ +void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, bool /*ifUnused*/, bool nowait){ //TODO: implement unused parent->exchanges->getLock()->acquire(); parent->exchanges->destroy(exchange); @@ -260,9 +261,9 @@ void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16 if(!nowait) parent->client.getExchange().deleteOk(channel); } -void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t ticket, string& name, +void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, string& name, bool passive, bool durable, bool exclusive, - bool autoDelete, bool nowait, FieldTable& arguments){ + bool autoDelete, bool nowait, FieldTable& /*arguments*/){ Queue::shared_ptr queue; if (passive && !name.empty()) { queue = parent->getQueue(name, channel); @@ -290,7 +291,7 @@ void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t } } -void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t ticket, string& queueName, +void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t /*ticket*/, string& queueName, string& exchangeName, string& routingKey, bool nowait, FieldTable& arguments){ @@ -305,14 +306,14 @@ void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t tic } } -void SessionHandlerImpl::QueueHandlerImpl::purge(u_int16_t channel, u_int16_t ticket, string& queueName, bool nowait){ +void SessionHandlerImpl::QueueHandlerImpl::purge(u_int16_t channel, u_int16_t /*ticket*/, string& queueName, bool nowait){ Queue::shared_ptr queue = parent->getQueue(queueName, channel); int count = queue->purge(); if(!nowait) parent->client.getQueue().purgeOk(channel, count); } -void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t ticket, string& queue, +void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/, string& queue, bool ifUnused, bool ifEmpty, bool nowait){ ChannelException error(0, ""); int count(0); @@ -336,14 +337,14 @@ void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t -void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool global){ +void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool /*global*/){ //TODO: handle global parent->getChannel(channel)->setPrefetchSize(prefetchSize); parent->getChannel(channel)->setPrefetchCount(prefetchCount); parent->client.getBasic().qosOk(channel); } -void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_t ticket, +void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_t /*ticket*/, string& queueName, string& consumerTag, bool noLocal, bool noAck, bool exclusive, bool nowait){ @@ -372,7 +373,7 @@ void SessionHandlerImpl::BasicHandlerImpl::cancel(u_int16_t channel, string& con if(!nowait) parent->client.getBasic().cancelOk(channel, consumerTag); } -void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t ticket, +void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, string& routingKey, bool mandatory, bool immediate){ @@ -380,7 +381,7 @@ void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t parent->getChannel(channel)->handlePublish(msg); } -void SessionHandlerImpl::BasicHandlerImpl::get(u_int16_t channelId, u_int16_t ticket, string& queueName, bool noAck){ +void SessionHandlerImpl::BasicHandlerImpl::get(u_int16_t channelId, u_int16_t /*ticket*/, string& queueName, bool noAck){ Queue::shared_ptr queue = parent->getQueue(queueName, channelId); if(!parent->getChannel(channelId)->get(queue, !noAck)){ string clusterId;//not used, part of an imatix hack @@ -396,7 +397,7 @@ void SessionHandlerImpl::BasicHandlerImpl::ack(u_int16_t channel, u_int64_t deli } } -void SessionHandlerImpl::BasicHandlerImpl::reject(u_int16_t channel, u_int64_t deliveryTag, bool requeue){} +void SessionHandlerImpl::BasicHandlerImpl::reject(u_int16_t /*channel*/, u_int64_t /*deliveryTag*/, bool /*requeue*/){} void SessionHandlerImpl::BasicHandlerImpl::recover(u_int16_t channel, bool requeue){ parent->getChannel(channel)->recover(requeue); diff --git a/cpp/broker/src/TopicExchange.cpp b/cpp/broker/src/TopicExchange.cpp index 287502bc88..53977747c4 100644 --- a/cpp/broker/src/TopicExchange.cpp +++ b/cpp/broker/src/TopicExchange.cpp @@ -47,6 +47,7 @@ size_t Tokens::Hash::operator()(const Tokens& p) const { for (Tokens::const_iterator i = p.begin(); i != p.end(); ++i) { hash += std::tr1::hash<std::string>()(*i); } + return hash; } TopicPattern& TopicPattern::operator=(const Tokens& tokens) { @@ -119,7 +120,7 @@ bool TopicPattern::match(const Tokens& target) const return do_match(begin(), end(), target.begin(), target.end()); } -TopicExchange::TopicExchange(const string& name) : Exchange(name) { } +TopicExchange::TopicExchange(const string& _name) : Exchange(_name) { } void TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ lock.acquire(); @@ -129,7 +130,7 @@ void TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fiel lock.release(); } -void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); BindingMap::iterator bi = bindings.find(TopicPattern(routingKey)); Queue::vector& qv(bi->second); @@ -142,7 +143,7 @@ void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, Fi } -void TopicExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void TopicExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) { if (i->first.match(routingKey)) { |