diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-25 18:22:00 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-25 18:22:00 +0200 |
commit | d9a33c05e2b3f45cba50fd0f8c48c422541b1ee8 (patch) | |
tree | 1d97192477c4d2eaf51ead0f3c6f5873653b99da /messagebus | |
parent | 575f2d7572ac68f9dfc6c6e0d4ea4240c3aac2e8 (diff) |
Add missing override.
remove virtual on override.
optimize includes.
Diffstat (limited to 'messagebus')
50 files changed, 88 insertions, 205 deletions
diff --git a/messagebus/src/tests/context/context.cpp b/messagebus/src/tests/context/context.cpp index 5ad36df7c72..3ba19e8f858 100644 --- a/messagebus/src/tests/context/context.cpp +++ b/messagebus/src/tests/context/context.cpp @@ -27,7 +27,7 @@ struct Handler : public IMessageHandler ~Handler() { session.reset(); } - virtual void handleMessage(Message::UP msg) override { + void handleMessage(Message::UP msg) override { session->acknowledge(std::move(msg)); } }; diff --git a/messagebus/src/tests/create-test.sh b/messagebus/src/tests/create-test.sh index b5406dd24bd..4a7a559eb08 100755 --- a/messagebus/src/tests/create-test.sh +++ b/messagebus/src/tests/create-test.sh @@ -23,10 +23,10 @@ gen_project_file() { gen_source() { echo "generating '$1' ..." - echo "#include <vespa/log/log.h>" > $1 - echo "LOG_SETUP(\"${test}_test\");" >> $1 - echo "#include <vespa/fastos/fastos.h>" >> $1 echo "#include <vespa/vespalib/testkit/testapp.h>" >> $1 + echo "" >> $1 + echo "#include <vespa/log/log.h>" >> $1 + echo "LOG_SETUP(\"${test}_test\");" >> $1 echo "" >> $1 echo "// using namespace mbus;" >> $1 echo "" >> $1 diff --git a/messagebus/src/tests/loadbalance/loadbalance.cpp b/messagebus/src/tests/loadbalance/loadbalance.cpp index 83ff4c042da..9e2a6e48d24 100644 --- a/messagebus/src/tests/loadbalance/loadbalance.cpp +++ b/messagebus/src/tests/loadbalance/loadbalance.cpp @@ -28,7 +28,7 @@ struct Handler : public IMessageHandler ~Handler() { session.reset(); } - virtual void handleMessage(Message::UP msg) override { + void handleMessage(Message::UP msg) override { ++cnt; session->acknowledge(std::move(msg)); } diff --git a/messagebus/src/tests/messageordering/messageordering.cpp b/messagebus/src/tests/messageordering/messageordering.cpp index e80505b2e89..df6ca38dd0d 100644 --- a/messagebus/src/tests/messageordering/messageordering.cpp +++ b/messagebus/src/tests/messageordering/messageordering.cpp @@ -46,8 +46,8 @@ public: _destinationSession(0), _messageCounter(0) {} - virtual void handleMessage(Message::UP msg) override - { + void handleMessage(Message::UP msg) override + { SimpleMessage& simpleMsg(dynamic_cast<SimpleMessage&>(*msg)); LOG(spam, "Attempting to acquire lock for %s", simpleMsg.getValue().c_str()); diff --git a/messagebus/src/tests/messenger/messenger.cpp b/messagebus/src/tests/messenger/messenger.cpp index 5cf3625523f..7b2b75212ee 100644 --- a/messagebus/src/tests/messenger/messenger.cpp +++ b/messagebus/src/tests/messenger/messenger.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("messagebus_test"); #include <vespa/messagebus/messenger.h> #include <vespa/vespalib/util/barrier.h> diff --git a/messagebus/src/tests/oos/oos.cpp b/messagebus/src/tests/oos/oos.cpp index b19de4a94f8..dc224a1519c 100644 --- a/messagebus/src/tests/oos/oos.cpp +++ b/messagebus/src/tests/oos/oos.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("oos_test"); #include <vespa/messagebus/destinationsession.h> #include <vespa/messagebus/errorcode.h> @@ -31,7 +28,7 @@ struct Handler : public IMessageHandler ~Handler() { session.reset(); } - virtual void handleMessage(Message::UP msg) override { + void handleMessage(Message::UP msg) override { session->acknowledge(std::move(msg)); } }; diff --git a/messagebus/src/tests/protocolrepository/protocolrepository.cpp b/messagebus/src/tests/protocolrepository/protocolrepository.cpp index cf1d77bdc7e..f9c971336c5 100644 --- a/messagebus/src/tests/protocolrepository/protocolrepository.cpp +++ b/messagebus/src/tests/protocolrepository/protocolrepository.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("protocolrepository_test"); #include <vespa/messagebus/protocolrepository.h> #include <vespa/vespalib/testkit/testapp.h> diff --git a/messagebus/src/tests/queue/queue.cpp b/messagebus/src/tests/queue/queue.cpp index 78bf09e2c48..27b31090346 100644 --- a/messagebus/src/tests/queue/queue.cpp +++ b/messagebus/src/tests/queue/queue.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("queue_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/messagebus/queue.h> diff --git a/messagebus/src/tests/replygate/replygate.cpp b/messagebus/src/tests/replygate/replygate.cpp index d190f278be4..8f784495866 100644 --- a/messagebus/src/tests/replygate/replygate.cpp +++ b/messagebus/src/tests/replygate/replygate.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("replygate_test"); #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/imessagehandler.h> @@ -44,7 +41,7 @@ struct MySender : public IMessageHandler { // giving a sync reply here is against the API contract, but it is // ok for testing. - virtual void handleMessage(Message::UP msg) override { + void handleMessage(Message::UP msg) override { Reply::UP reply(new MyReply()); msg->swapState(*reply); IReplyHandler &handler = reply->getCallStack().pop(*reply); diff --git a/messagebus/src/tests/resender/resender.cpp b/messagebus/src/tests/resender/resender.cpp index dad8ef73e68..701ce20737c 100644 --- a/messagebus/src/tests/resender/resender.cpp +++ b/messagebus/src/tests/resender/resender.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routing_test"); #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> diff --git a/messagebus/src/tests/result/result.cpp b/messagebus/src/tests/result/result.cpp index a404135d64c..963e44d1dda 100644 --- a/messagebus/src/tests/result/result.cpp +++ b/messagebus/src/tests/result/result.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("result_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/messagebus/result.h> #include <vespa/messagebus/error.h> diff --git a/messagebus/src/tests/retrypolicy/retrypolicy.cpp b/messagebus/src/tests/retrypolicy/retrypolicy.cpp index 5426a1123cd..8c70eb5888a 100644 --- a/messagebus/src/tests/retrypolicy/retrypolicy.cpp +++ b/messagebus/src/tests/retrypolicy/retrypolicy.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("retrypolicy_test"); #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/routing/retrytransienterrorspolicy.h> diff --git a/messagebus/src/tests/routable/routable.cpp b/messagebus/src/tests/routable/routable.cpp index adde39dc51c..8a388ccbe8d 100644 --- a/messagebus/src/tests/routable/routable.cpp +++ b/messagebus/src/tests/routable/routable.cpp @@ -1,14 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routable_test"); -#include <vespa/messagebus/error.h> -#include <vespa/messagebus/errorcode.h> -#include <vespa/messagebus/message.h> -#include <vespa/messagebus/reply.h> + #include <vespa/messagebus/testlib/receptor.h> #include <vespa/messagebus/testlib/simplemessage.h> #include <vespa/messagebus/testlib/simplereply.h> +#include <vespa/messagebus/message.h> +#include <vespa/messagebus/reply.h> +#include <vespa/messagebus/errorcode.h> +#include <vespa/messagebus/error.h> + #include <vespa/vespalib/testkit/testapp.h> using namespace mbus; diff --git a/messagebus/src/tests/routablequeue/routablequeue.cpp b/messagebus/src/tests/routablequeue/routablequeue.cpp index a6bd66bd5df..3f014236440 100644 --- a/messagebus/src/tests/routablequeue/routablequeue.cpp +++ b/messagebus/src/tests/routablequeue/routablequeue.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routablequeue_test"); #include <vespa/messagebus/routablequeue.h> #include <vespa/messagebus/testlib/simplemessage.h> @@ -16,8 +13,8 @@ private: static uint32_t _cnt; public: TestMessage(uint32_t id) : SimpleMessage(""), _id(id) { ++_cnt; } - virtual ~TestMessage() { --_cnt; } - virtual uint32_t getType() const override { return _id; } + ~TestMessage() { --_cnt; } + uint32_t getType() const override { return _id; } static uint32_t getCnt() { return _cnt; } }; uint32_t TestMessage::_cnt = 0; @@ -28,8 +25,8 @@ private: static uint32_t _cnt; public: TestReply(uint32_t id) : SimpleReply(""), _id(id) { ++_cnt; } - virtual ~TestReply() { --_cnt; } - virtual uint32_t getType() const override { return _id; } + ~TestReply() { --_cnt; } + uint32_t getType() const override { return _id; } static uint32_t getCnt() { return _cnt; } }; uint32_t TestReply::_cnt = 0; diff --git a/messagebus/src/tests/routeparser/routeparser.cpp b/messagebus/src/tests/routeparser/routeparser.cpp index a00cea825ba..fc000fe571b 100644 --- a/messagebus/src/tests/routeparser/routeparser.cpp +++ b/messagebus/src/tests/routeparser/routeparser.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routeparser_test"); #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/routing/errordirective.h> @@ -16,6 +13,9 @@ LOG_SETUP("routeparser_test"); #include <vespa/messagebus/testlib/testserver.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> +LOG_SETUP("routeparser_test"); + using namespace mbus; class Test : public vespalib::TestApp { diff --git a/messagebus/src/tests/routing/routing.cpp b/messagebus/src/tests/routing/routing.cpp index 506d003a8b7..8fd2c3951e4 100644 --- a/messagebus/src/tests/routing/routing.cpp +++ b/messagebus/src/tests/routing/routing.cpp @@ -1,5 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/messagebus.h> @@ -15,8 +14,8 @@ #include <vespa/messagebus/testlib/testserver.h> #include <vespa/vespalib/component/vtag.h> #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> +#include <vespa/log/log.h> LOG_SETUP("routing_test"); using namespace mbus; @@ -414,12 +413,9 @@ private: public: MyPolicy(const MyPolicyFactory &parent) : _parent(parent) - { - // empty - } + {} - virtual void - select(RoutingContext &ctx) override + void select(RoutingContext &ctx) override { if (!_parent._selectRoute.empty()) { ctx.addChild(Route::parse(_parent._selectRoute)); @@ -433,9 +429,8 @@ public: throw TestException(); } } - - virtual void - merge(RoutingContext &ctx) override + + void merge(RoutingContext &ctx) override { if (_parent._mergeError != ErrorCode::NONE) { Reply::UP reply(new EmptyReply()); diff --git a/messagebus/src/tests/routingcontext/routingcontext.cpp b/messagebus/src/tests/routingcontext/routingcontext.cpp index 6ee62b4d697..281cf782a6b 100644 --- a/messagebus/src/tests/routingcontext/routingcontext.cpp +++ b/messagebus/src/tests/routingcontext/routingcontext.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("routingcontext_test"); #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> diff --git a/messagebus/src/tests/rpcserviceaddress/rpcserviceaddress.cpp b/messagebus/src/tests/rpcserviceaddress/rpcserviceaddress.cpp index d5a002adf89..bd5cfa3d8cf 100644 --- a/messagebus/src/tests/rpcserviceaddress/rpcserviceaddress.cpp +++ b/messagebus/src/tests/rpcserviceaddress/rpcserviceaddress.cpp @@ -1,9 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("rpcserviceaddress_test"); -#include <vespa/vespalib/testkit/testapp.h> + #include <vespa/messagebus/network/rpcserviceaddress.h> +#include <vespa/vespalib/testkit/testapp.h> using namespace mbus; diff --git a/messagebus/src/tests/sendadapter/sendadapter.cpp b/messagebus/src/tests/sendadapter/sendadapter.cpp index bcac60d800a..5ab1e57f0d4 100644 --- a/messagebus/src/tests/sendadapter/sendadapter.cpp +++ b/messagebus/src/tests/sendadapter/sendadapter.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("sendadapter_test"); #include <vespa/messagebus/messagebus.h> #include <vespa/messagebus/testlib/receptor.h> @@ -12,6 +9,9 @@ LOG_SETUP("sendadapter_test"); #include <vespa/messagebus/testlib/testserver.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> +LOG_SETUP("sendadapter_test"); + using namespace mbus; //////////////////////////////////////////////////////////////////////////////// diff --git a/messagebus/src/tests/sequencer/sequencer.cpp b/messagebus/src/tests/sequencer/sequencer.cpp index 6db2455c4a8..4a8018a53b4 100644 --- a/messagebus/src/tests/sequencer/sequencer.cpp +++ b/messagebus/src/tests/sequencer/sequencer.cpp @@ -1,14 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("sequencer_test"); +#include <vespa/messagebus/testlib/simplemessage.h> #include <vespa/messagebus/sequencer.h> -#include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/routablequeue.h> -#include <vespa/messagebus/testlib/simplemessage.h> +#include <vespa/messagebus/emptyreply.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> +LOG_SETUP("sequencer_test"); + using namespace mbus; // -------------------------------------------------------------------------------- diff --git a/messagebus/src/tests/serviceaddress/serviceaddress.cpp b/messagebus/src/tests/serviceaddress/serviceaddress.cpp index ec2d1374e9b..ea6261f0169 100644 --- a/messagebus/src/tests/serviceaddress/serviceaddress.cpp +++ b/messagebus/src/tests/serviceaddress/serviceaddress.cpp @@ -1,10 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("serviceaddress_test"); #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/vstringfmt.h> +#include <vespa/messagebus/testlib/slobrok.h> +#include <vespa/messagebus/testlib/testserver.h> +#include <vespa/messagebus/testlib/receptor.h> +#include <vespa/messagebus/testlib/simplemessage.h> +#include <vespa/messagebus/testlib/simplereply.h> +#include <vespa/messagebus/testlib/simpleprotocol.h> #include <vespa/messagebus/messagebus.h> #include <vespa/messagebus/sourcesession.h> #include <vespa/messagebus/intermediatesession.h> @@ -15,12 +17,7 @@ LOG_SETUP("serviceaddress_test"); #include <vespa/messagebus/routing/routingspec.h> #include <vespa/messagebus/network/rpcservice.h> #include <vespa/messagebus/sourcesessionparams.h> -#include <vespa/messagebus/testlib/slobrok.h> -#include <vespa/messagebus/testlib/testserver.h> -#include <vespa/messagebus/testlib/receptor.h> -#include <vespa/messagebus/testlib/simplemessage.h> -#include <vespa/messagebus/testlib/simplereply.h> -#include <vespa/messagebus/testlib/simpleprotocol.h> +#include <vespa/vespalib/util/vstringfmt.h> using namespace mbus; diff --git a/messagebus/src/tests/servicepool/servicepool.cpp b/messagebus/src/tests/servicepool/servicepool.cpp index 8601cfa8fee..76c366930d9 100644 --- a/messagebus/src/tests/servicepool/servicepool.cpp +++ b/messagebus/src/tests/servicepool/servicepool.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("servicepool_test"); #include <vespa/messagebus/network/rpcnetwork.h> #include <vespa/messagebus/testlib/slobrok.h> diff --git a/messagebus/src/tests/shutdown/shutdown.cpp b/messagebus/src/tests/shutdown/shutdown.cpp index 5f5fe847f57..1f6944adb9e 100644 --- a/messagebus/src/tests/shutdown/shutdown.cpp +++ b/messagebus/src/tests/shutdown/shutdown.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("shutdown_test"); #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> diff --git a/messagebus/src/tests/simple-roundtrip/simple-roundtrip.cpp b/messagebus/src/tests/simple-roundtrip/simple-roundtrip.cpp index c59f072bd09..6e5b50a7469 100644 --- a/messagebus/src/tests/simple-roundtrip/simple-roundtrip.cpp +++ b/messagebus/src/tests/simple-roundtrip/simple-roundtrip.cpp @@ -1,21 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("simple-roundtrip_test"); -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/messagebus/messagebus.h> -#include <vespa/messagebus/sourcesession.h> -#include <vespa/messagebus/intermediatesession.h> -#include <vespa/messagebus/destinationsession.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> -#include <vespa/messagebus/routing/routingspec.h> #include <vespa/messagebus/testlib/receptor.h> -#include <vespa/messagebus/sourcesessionparams.h> #include <vespa/messagebus/testlib/simplemessage.h> #include <vespa/messagebus/testlib/simplereply.h> #include <vespa/messagebus/testlib/simpleprotocol.h> +#include <vespa/messagebus/messagebus.h> +#include <vespa/vespalib/testkit/testapp.h> using namespace mbus; diff --git a/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp b/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp index c4268e5108d..23f604ecced 100644 --- a/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp +++ b/messagebus/src/tests/simpleprotocol/simpleprotocol.cpp @@ -1,20 +1,17 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/component/vtag.h> -#include <vespa/messagebus/errorcode.h> -#include <vespa/messagebus/ireplyhandler.h> -#include <vespa/messagebus/network/identity.h> -#include <vespa/messagebus/routing/routingcontext.h> + #include <vespa/messagebus/testlib/receptor.h> #include <vespa/messagebus/testlib/simpleprotocol.h> #include <vespa/messagebus/testlib/simplemessage.h> #include <vespa/messagebus/testlib/simplereply.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> -#include <vespa/log/log.h> - -LOG_SETUP("simpleprotocol_test"); +#include <vespa/messagebus/errorcode.h> +#include <vespa/messagebus/ireplyhandler.h> +#include <vespa/messagebus/network/identity.h> +#include <vespa/messagebus/routing/routingcontext.h> +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/component/vtag.h> using namespace mbus; diff --git a/messagebus/src/tests/sourcesession/sourcesession.cpp b/messagebus/src/tests/sourcesession/sourcesession.cpp index 24d99f5d44f..a7fde7f28e0 100644 --- a/messagebus/src/tests/sourcesession/sourcesession.cpp +++ b/messagebus/src/tests/sourcesession/sourcesession.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("sourcesession_test"); #include <vespa/messagebus/destinationsession.h> #include <vespa/messagebus/error.h> @@ -34,7 +31,7 @@ struct DelayedHandler : public IMessageHandler ~DelayedHandler() { session.reset(); } - virtual void handleMessage(Message::UP msg) override { + void handleMessage(Message::UP msg) override { // this will block the transport thread in the server messagebus, // but that should be ok, as we only want to test the timing in the // client messagebus... diff --git a/messagebus/src/tests/targetpool/targetpool.cpp b/messagebus/src/tests/targetpool/targetpool.cpp index 30744e74202..dda44765ba6 100644 --- a/messagebus/src/tests/targetpool/targetpool.cpp +++ b/messagebus/src/tests/targetpool/targetpool.cpp @@ -1,11 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/messagebus/network/rpctargetpool.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/messagebus/testlib/testserver.h> #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> +#include <vespa/log/log.h> LOG_SETUP("targetpool_test"); using namespace mbus; diff --git a/messagebus/src/tests/throttling/throttling.cpp b/messagebus/src/tests/throttling/throttling.cpp index acc5b2ddc4d..a1065c44487 100644 --- a/messagebus/src/tests/throttling/throttling.cpp +++ b/messagebus/src/tests/throttling/throttling.cpp @@ -1,7 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("throttling_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/messagebus/destinationsession.h> diff --git a/messagebus/src/tests/timeout/timeout.cpp b/messagebus/src/tests/timeout/timeout.cpp index d51ee34a08b..a14176cb1ef 100644 --- a/messagebus/src/tests/timeout/timeout.cpp +++ b/messagebus/src/tests/timeout/timeout.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("timeout_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/emptyreply.h> diff --git a/messagebus/src/tests/trace-roundtrip/trace-roundtrip.cpp b/messagebus/src/tests/trace-roundtrip/trace-roundtrip.cpp index 5a9324257b5..effe461c5a8 100644 --- a/messagebus/src/tests/trace-roundtrip/trace-roundtrip.cpp +++ b/messagebus/src/tests/trace-roundtrip/trace-roundtrip.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("simple-roundtrip_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/messagebus.h> diff --git a/messagebus/src/vespa/messagebus/dynamicthrottlepolicy.h b/messagebus/src/vespa/messagebus/dynamicthrottlepolicy.h index d552c3c48e9..ff49f15b416 100644 --- a/messagebus/src/vespa/messagebus/dynamicthrottlepolicy.h +++ b/messagebus/src/vespa/messagebus/dynamicthrottlepolicy.h @@ -164,13 +164,8 @@ public: */ uint32_t getMaxPendingCount() const { return (uint32_t)_windowSize; } - // Implements IThrottlePolicy. bool canSend(const Message &msg, uint32_t pendingCount) override; - - // Implements IThrottlePolicy. void processMessage(Message &msg) override; - - // Implements IThrottlePolicy. void processReply(Reply &reply) override; }; diff --git a/messagebus/src/vespa/messagebus/emptyreply.h b/messagebus/src/vespa/messagebus/emptyreply.h index f2d431c8ada..db8beb33b9b 100644 --- a/messagebus/src/vespa/messagebus/emptyreply.h +++ b/messagebus/src/vespa/messagebus/emptyreply.h @@ -26,24 +26,23 @@ public: * * @return "" */ - virtual const string & getProtocol() const override; + const string & getProtocol() const override; /** * This method returns the message type id reserved for empty replies: 0 * * @return 0 */ - virtual uint32_t getType() const override; + uint32_t getType() const override; /** * Encodes this reply into an empty blob. * * @return empty blob */ - virtual Blob encode() const; + Blob encode() const; uint8_t priority() const override { return 8; } }; } // namespace mbus - diff --git a/messagebus/src/vespa/messagebus/error.h b/messagebus/src/vespa/messagebus/error.h index d67442c054c..e3d62bf6bbe 100644 --- a/messagebus/src/vespa/messagebus/error.h +++ b/messagebus/src/vespa/messagebus/error.h @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <stdint.h> #include <vespa/messagebus/common.h> #ifdef Error diff --git a/messagebus/src/vespa/messagebus/errorcode.h b/messagebus/src/vespa/messagebus/errorcode.h index 7667c75725e..a452329a341 100644 --- a/messagebus/src/vespa/messagebus/errorcode.h +++ b/messagebus/src/vespa/messagebus/errorcode.h @@ -2,7 +2,6 @@ #pragma once -#include <stdint.h> #include <vespa/messagebus/common.h> namespace mbus { diff --git a/messagebus/src/vespa/messagebus/intermediatesession.h b/messagebus/src/vespa/messagebus/intermediatesession.h index 064b223707f..b4832d5069a 100644 --- a/messagebus/src/vespa/messagebus/intermediatesession.h +++ b/messagebus/src/vespa/messagebus/intermediatesession.h @@ -87,10 +87,7 @@ public: */ const string getConnectionSpec() const; - // Implements IMessageHandler. void handleMessage(Message::UP message) override; - - // Implements IReplyHandler. void handleReply(Reply::UP reply) override; }; diff --git a/messagebus/src/vespa/messagebus/message.h b/messagebus/src/vespa/messagebus/message.h index 6fc72af0055..cea0aaa91fb 100644 --- a/messagebus/src/vespa/messagebus/message.h +++ b/messagebus/src/vespa/messagebus/message.h @@ -35,10 +35,9 @@ public: * will log an error and generate an auto-reply to avoid having the sender * wait indefinetly for a reply. */ - virtual ~Message(); + ~Message(); - // Overrides Routable. - virtual void swapState(Routable &rhs) override; + void swapState(Routable &rhs) override; /** * Returns the timestamp for when this message was last seen by message @@ -139,7 +138,7 @@ public: * * @return false */ - virtual bool isReply() const override { return false; } + bool isReply() const override { return false; } /** * Returns whether or not this message contains a sequence identifier that diff --git a/messagebus/src/vespa/messagebus/messenger.h b/messagebus/src/vespa/messagebus/messenger.h index fe76513eef9..70207029e19 100644 --- a/messagebus/src/vespa/messagebus/messenger.h +++ b/messagebus/src/vespa/messagebus/messenger.h @@ -47,7 +47,6 @@ private: bool _closed; protected: - // Implements FastOS_Runnable. void Run(FastOS_ThreadInterface *thread, void *arg) override; public: diff --git a/messagebus/src/vespa/messagebus/reply.h b/messagebus/src/vespa/messagebus/reply.h index 8bc4f5921e0..f352d442931 100644 --- a/messagebus/src/vespa/messagebus/reply.h +++ b/messagebus/src/vespa/messagebus/reply.h @@ -39,17 +39,10 @@ public: * will log an error and generate an auto-reply to avoid having the sender * wait indefinetly for a reply. */ - virtual ~Reply(); + ~Reply(); - // Inherit doc from Routable. - virtual void swapState(Routable &rhs) override; - - /** - * Inherited from Routable. Classifies this object as 'a reply'. - * - * @return true - */ - virtual bool isReply() const override; + void swapState(Routable &rhs) override; + bool isReply() const override; /** * Add an Error to this Reply diff --git a/messagebus/src/vespa/messagebus/routablequeue.h b/messagebus/src/vespa/messagebus/routablequeue.h index ea2b14b64f6..acb99d7269a 100644 --- a/messagebus/src/vespa/messagebus/routablequeue.h +++ b/messagebus/src/vespa/messagebus/routablequeue.h @@ -76,14 +76,14 @@ public: * * @param msg the Message to handle **/ - virtual void handleMessage(Message::UP msg) override; + void handleMessage(Message::UP msg) override; /** * Handle a Reply by enqueuing it. * * @param reply the Reply to handle **/ - virtual void handleReply(Reply::UP reply) override; + void handleReply(Reply::UP reply) override; }; } // namespace mbus diff --git a/messagebus/src/vespa/messagebus/routing/errordirective.cpp b/messagebus/src/vespa/messagebus/routing/errordirective.cpp index 2cc5d5da392..6bfbf6fad30 100644 --- a/messagebus/src/vespa/messagebus/routing/errordirective.cpp +++ b/messagebus/src/vespa/messagebus/routing/errordirective.cpp @@ -11,13 +11,13 @@ ErrorDirective::ErrorDirective(const vespalib::stringref &msg) : string ErrorDirective::toString() const { - return vespalib::make_vespa_string("(%s)", _msg.c_str()); + return vespalib::make_string("(%s)", _msg.c_str()); } string ErrorDirective::toDebugString() const { - return vespalib::make_vespa_string("ErrorDirective(msg = '%s')", _msg.c_str()); + return vespalib::make_string("ErrorDirective(msg = '%s')", _msg.c_str()); } } // mbus diff --git a/messagebus/src/vespa/messagebus/sendproxy.h b/messagebus/src/vespa/messagebus/sendproxy.h index ca0c3f39661..e0212c4c222 100644 --- a/messagebus/src/vespa/messagebus/sendproxy.h +++ b/messagebus/src/vespa/messagebus/sendproxy.h @@ -34,13 +34,8 @@ public: */ SendProxy(MessageBus &mbus, INetwork &net, Resender *resender); - // Implements IDiscardHandler. void handleDiscard(Context ctx) override; - - // Implements IMessageHandler. void handleMessage(Message::UP msg) override; - - // Implements IReplyHandler. void handleReply(Reply::UP reply) override; }; diff --git a/messagebus/src/vespa/messagebus/staticthrottlepolicy.h b/messagebus/src/vespa/messagebus/staticthrottlepolicy.h index b7cc6bdfe99..586451ea83a 100644 --- a/messagebus/src/vespa/messagebus/staticthrottlepolicy.h +++ b/messagebus/src/vespa/messagebus/staticthrottlepolicy.h @@ -70,13 +70,8 @@ public: */ uint64_t getPendingSize() const; - // Implements IThrottlePolicy. bool canSend(const Message &msg, uint32_t pendingCount) override; - - // Implements IThrottlePolicy. void processMessage(Message &msg) override; - - // Implements IThrottlePolicy. void processReply(Reply &reply) override; }; diff --git a/messagebus/src/vespa/messagebus/systemtimer.h b/messagebus/src/vespa/messagebus/systemtimer.h index 14156253067..4a83add0732 100644 --- a/messagebus/src/vespa/messagebus/systemtimer.h +++ b/messagebus/src/vespa/messagebus/systemtimer.h @@ -12,7 +12,6 @@ namespace mbus { */ class SystemTimer : public ITimer { public: - // Implements ITimer. uint64_t getMilliTime() const override; }; diff --git a/messagebus/src/vespa/messagebus/testlib/custompolicy.h b/messagebus/src/vespa/messagebus/testlib/custompolicy.h index 953f4f3c92e..4fec4efe7c2 100644 --- a/messagebus/src/vespa/messagebus/testlib/custompolicy.h +++ b/messagebus/src/vespa/messagebus/testlib/custompolicy.h @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/messagebus/routing/iroutingpolicy.h> #include "simpleprotocol.h" +#include <vespa/messagebus/routing/iroutingpolicy.h> namespace mbus { @@ -17,8 +17,8 @@ public: const std::vector<uint32_t> consumableErrors, const std::vector<Route> &routes); - virtual void select(RoutingContext &context) override; - virtual void merge(RoutingContext &context) override; + void select(RoutingContext &context) override; + void merge(RoutingContext &context) override; }; class CustomPolicyFactory : public SimpleProtocol::IPolicyFactory { @@ -37,4 +37,3 @@ public: }; } // namespace mbus - diff --git a/messagebus/src/vespa/messagebus/testlib/receptor.h b/messagebus/src/vespa/messagebus/testlib/receptor.h index c64e60eb6de..2e9a424b481 100644 --- a/messagebus/src/vespa/messagebus/testlib/receptor.h +++ b/messagebus/src/vespa/messagebus/testlib/receptor.h @@ -20,11 +20,10 @@ private: Receptor &operator=(const Receptor &); public: Receptor(); - virtual void handleMessage(Message::UP msg) override; - virtual void handleReply(Reply::UP reply) override; + void handleMessage(Message::UP msg) override; + void handleReply(Reply::UP reply) override; Message::UP getMessage(double maxWait = 120.0); Reply::UP getReply(double maxWait = 120.0); }; } // namespace mbus - diff --git a/messagebus/src/vespa/messagebus/testlib/simplemessage.h b/messagebus/src/vespa/messagebus/testlib/simplemessage.h index cb14c48dd9f..aeee34045ff 100644 --- a/messagebus/src/vespa/messagebus/testlib/simplemessage.h +++ b/messagebus/src/vespa/messagebus/testlib/simplemessage.h @@ -8,9 +8,9 @@ namespace mbus { class SimpleMessage : public Message { private: - string _value; - bool _hasSeqId; - uint64_t _seqId; + string _value; + bool _hasSeqId; + uint64_t _seqId; public: SimpleMessage(const string &str); @@ -25,9 +25,7 @@ public: bool hasSequenceId() const override; uint64_t getSequenceId() const override; uint32_t getApproxSize() const override; - uint8_t priority() const override { return 8; } - string toString() const override { return _value; } }; diff --git a/messagebus/src/vespa/messagebus/testlib/simpleprotocol.h b/messagebus/src/vespa/messagebus/testlib/simpleprotocol.h index 843b7675b96..0551d177898 100644 --- a/messagebus/src/vespa/messagebus/testlib/simpleprotocol.h +++ b/messagebus/src/vespa/messagebus/testlib/simpleprotocol.h @@ -2,9 +2,8 @@ #pragma once -#include <map> -#include <string> #include <vespa/messagebus/iprotocol.h> +#include <map> namespace mbus { @@ -49,10 +48,7 @@ public: */ SimpleProtocol(); - /** - * Frees up any allocated resources. - */ - virtual ~SimpleProtocol(); + ~SimpleProtocol(); /** * Registers a policy factory with this protocol under a given name. Whenever a policy is requested that @@ -72,19 +68,10 @@ public: */ static void simpleMerge(RoutingContext &ctx); - // Implements IProtocol. const string & getName() const override; - - // Implements IProtocol. - IRoutingPolicy::UP createPolicy(const string &name, - const string ¶m) const override; - - // Implements IProtocol. + IRoutingPolicy::UP createPolicy(const string &name, const string ¶m) const override; Blob encode(const vespalib::Version &version, const Routable &routable) const override; - - // Implements IProtocol. Routable::UP decode(const vespalib::Version &version, BlobRef data) const override; }; } // namespace mbus - diff --git a/messagebus/src/vespa/messagebus/testlib/simplereply.h b/messagebus/src/vespa/messagebus/testlib/simplereply.h index 8016a517453..3b9ac7fe21e 100644 --- a/messagebus/src/vespa/messagebus/testlib/simplereply.h +++ b/messagebus/src/vespa/messagebus/testlib/simplereply.h @@ -2,9 +2,8 @@ #pragma once -#include <string> -#include <vespa/messagebus/reply.h> #include "simplemessage.h" +#include <vespa/messagebus/reply.h> namespace mbus { @@ -19,11 +18,10 @@ public: virtual ~SimpleReply(); void setValue(const string &value); const string &getValue() const; - virtual const string & getProtocol() const override; - virtual uint32_t getType() const override; + const string & getProtocol() const override; + uint32_t getType() const override; uint8_t priority() const override { return 8; } }; } // namespace mbus - diff --git a/messagebus/src/vespa/messagebus/testlib/slobrok.cpp b/messagebus/src/vespa/messagebus/testlib/slobrok.cpp index b3f02b1ad58..fa71cb9f9ad 100644 --- a/messagebus/src/vespa/messagebus/testlib/slobrok.cpp +++ b/messagebus/src/vespa/messagebus/testlib/slobrok.cpp @@ -20,7 +20,8 @@ public: guard.wait(); } } - virtual void PerformTask() override { + + void PerformTask() override { vespalib::MonitorGuard guard(_mon); _done = true; guard.signal(); diff --git a/messagebus/src/vespa/messagebus/testlib/slobrok.h b/messagebus/src/vespa/messagebus/testlib/slobrok.h index 2f8d4180ba5..1677f6635f7 100644 --- a/messagebus/src/vespa/messagebus/testlib/slobrok.h +++ b/messagebus/src/vespa/messagebus/testlib/slobrok.h @@ -2,7 +2,6 @@ #pragma once -#include <memory> #include <vespa/messagebus/common.h> #include <vespa/slobrok/cfg.h> |