diff options
230 files changed, 940 insertions, 1920 deletions
diff --git a/config/src/apps/configproxy-cmd/main.cpp b/config/src/apps/configproxy-cmd/main.cpp index fcf2a0ca5d7..1d5934f2817 100644 --- a/config/src/apps/configproxy-cmd/main.cpp +++ b/config/src/apps/configproxy-cmd/main.cpp @@ -10,8 +10,8 @@ class Application : public FastOS_Application Flags _flags; bool parseOpts(); public: - void usage(void); - int Main(void) override; + void usage(); + int Main() override; Application() : _flags() {} }; diff --git a/config/src/apps/getvespaconfig/getconfig.cpp b/config/src/apps/getvespaconfig/getconfig.cpp index 23127b79333..df7bbba48b0 100644 --- a/config/src/apps/getvespaconfig/getconfig.cpp +++ b/config/src/apps/getvespaconfig/getconfig.cpp @@ -32,7 +32,7 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; diff --git a/config/src/apps/pingproxy/pingproxy.cpp b/config/src/apps/pingproxy/pingproxy.cpp index 667d5689691..ba35892c03c 100644 --- a/config/src/apps/pingproxy/pingproxy.cpp +++ b/config/src/apps/pingproxy/pingproxy.cpp @@ -24,7 +24,7 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; diff --git a/config/src/tests/configagent/configagent.cpp b/config/src/tests/configagent/configagent.cpp index 91b657b42f2..0693c33467d 100644 --- a/config/src/tests/configagent/configagent.cpp +++ b/config/src/tests/configagent/configagent.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/vespalib/testkit/test_kit.h> #include <vespa/config/config.h> #include <vespa/config/raw/rawsource.h> @@ -19,25 +18,10 @@ public: : _key(key) { } - const ConfigKey & getKey() const override - { - return _key; - } - - bool abort() override - { - return false; - } - - bool isAborted() const override - { - return false; - } - - void setError(int errorCode) override - { - (void) errorCode; - } + const ConfigKey & getKey() const override { return _key; } + bool abort() override { return false; } + bool isAborted() const override { return false; } + void setError(int errorCode) override { (void) errorCode; } const ConfigKey _key; }; @@ -57,51 +41,15 @@ public: _isError(iserror) { } - const ConfigKey& getKey() const override - { - return _key; - } - - const ConfigValue & getValue() const override - { - return _value; - } - - const ConfigState & getConfigState() const override - { - return _state; - } - - bool hasValidResponse() const override - { - return _valid; - } - - bool validateResponse() override - { - return _valid; - } - - void fill() override - { - _fillCalled = true; - } - - vespalib::string errorMessage() const override - { - return _errorMessage; - } - - int errorCode() const override - { - return _errorCode; - } - - bool isError() const override - { - return _isError; - } - + const ConfigKey& getKey() const override { return _key; } + const ConfigValue & getValue() const override { return _value; } + const ConfigState & getConfigState() const override { return _state; } + bool hasValidResponse() const override { return _valid; } + bool validateResponse() override { return _valid; } + void fill() override { _fillCalled = true; } + vespalib::string errorMessage() const override { return _errorMessage; } + int errorCode() const override { return _errorCode; } + bool isError() const override { return _isError; } const Trace & getTrace() const override { return _trace; } const ConfigKey _key; diff --git a/config/src/tests/configretriever/configretriever.cpp b/config/src/tests/configretriever/configretriever.cpp index bb4dda0e10e..8273eee2c73 100644 --- a/config/src/tests/configretriever/configretriever.cpp +++ b/config/src/tests/configretriever/configretriever.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("configretriever"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/config/config.h> diff --git a/config/src/tests/frt/frt.cpp b/config/src/tests/frt/frt.cpp index 26f95df8f42..0de1908858f 100644 --- a/config/src/tests/frt/frt.cpp +++ b/config/src/tests/frt/frt.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("frt"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/iconfigholder.h> #include <vespa/config/common/trace.h> diff --git a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp b/config/src/tests/frtconnectionpool/frtconnectionpool.cpp index 96dad86a54d..b563ea1929b 100644 --- a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp +++ b/config/src/tests/frtconnectionpool/frtconnectionpool.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("frtconnectionpool_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/config/frt/frtconnectionpool.h> #include <vespa/fnet/frt/error.h> diff --git a/config/src/tests/subscription/subscription.cpp b/config/src/tests/subscription/subscription.cpp index e47f8b11e60..5974279518a 100644 --- a/config/src/tests/subscription/subscription.cpp +++ b/config/src/tests/subscription/subscription.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/vespalib/testkit/test_kit.h> #include <vespa/config/common/misc.h> #include <vespa/config/common/configholder.h> diff --git a/config/src/tests/trace/trace.cpp b/config/src/tests/trace/trace.cpp index 566077d47e1..195f7d659a9 100644 --- a/config/src/tests/trace/trace.cpp +++ b/config/src/tests/trace/trace.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("frt"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/trace.h> #include <vespa/vespalib/trace/tracenode.h> diff --git a/configd/src/tests/messages/messages.cpp b/configd/src/tests/messages/messages.cpp index 46fa229ff29..a8b2e37af36 100644 --- a/configd/src/tests/messages/messages.cpp +++ b/configd/src/tests/messages/messages.cpp @@ -1,8 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -#include <vespa/vespalib/testkit/testapp.h> -LOG_SETUP("messages_test"); +#include <vespa/vespalib/testkit/testapp.h> class MessagesTest : public vespalib::TestApp { diff --git a/configutil/src/apps/configstatus/main.cpp b/configutil/src/apps/configstatus/main.cpp index f774afa355d..4583af033c2 100644 --- a/configutil/src/apps/configstatus/main.cpp +++ b/configutil/src/apps/configstatus/main.cpp @@ -17,8 +17,8 @@ class Application : public FastOS_Application { vespalib::string getSources(); HostFilter parse_host_set(vespalib::stringref raw_arg) const; public: - void usage(void); - int Main(void) override; + void usage(); + int Main() override; Application(); ~Application(); diff --git a/configutil/src/lib/configstatus.cpp b/configutil/src/lib/configstatus.cpp index 174350c5eca..5a876a30ab5 100644 --- a/configutil/src/lib/configstatus.cpp +++ b/configutil/src/lib/configstatus.cpp @@ -9,9 +9,6 @@ #include <vbench/http/http_client.h> #include <iostream> -#include <vespa/log/log.h> -LOG_SETUP("vespa-config-status"); - using configdefinitions::tagsContain; struct ComponentTraverser : public vespalib::slime::ObjectTraverser @@ -41,8 +38,7 @@ struct ComponentTraverser : public vespalib::slime::ObjectTraverser slime.get()["config"].traverse(traverser); } - virtual void - field(const vespalib::Memory &symbol_name, const vespalib::slime::Inspector &inspector) override { + void field(const vespalib::Memory &symbol_name, const vespalib::slime::Inspector &inspector) override { switch (_state) { case ROOT: _component = symbol_name.make_string(); @@ -87,16 +83,16 @@ public: {} ~MyHttpHandler(); - virtual void handleHeader(const vbench::string &name, const vbench::string &value) override { + void handleHeader(const vbench::string &name, const vbench::string &value) override { (void) name; (void) value; } - virtual void handleContent(const vbench::Memory &data) override { + void handleContent(const vbench::Memory &data) override { _json += std::string(data.data, data.size); } - virtual void handleFailure(const vbench::string &reason) override { + void handleFailure(const vbench::string &reason) override { std::cerr << _configId << ": Failed to fetch json: " << reason << std::endl; _error = reason; } diff --git a/configutil/src/tests/config_status/config_status_test.cpp b/configutil/src/tests/config_status/config_status_test.cpp index 77fcf1b8da8..39442068330 100644 --- a/configutil/src/tests/config_status/config_status_test.cpp +++ b/configutil/src/tests/config_status/config_status_test.cpp @@ -1,14 +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/vespalib/testkit/testapp.h> #include <lib/configstatus.h> -#include <iostream> #include <vespa/fastlib/net/httpserver.h> #include <vespa/config-model.h> #include <vespa/config/config.h> #include <vespa/config/subscription/sourcespec.h> -#include <vector> -#include <string> using namespace config; @@ -17,8 +13,7 @@ private: std::string _reply; bool _fail; - virtual void onGetRequest(const string &, const string &, - Fast_HTTPConnection &conn) override { + void onGetRequest(const string &, const string &, Fast_HTTPConnection &conn) override { if (_fail) { conn.Output(conn.GetHTTPVersion().c_str()); conn.Output(" 500 Error\r\n"); diff --git a/configutil/src/tests/model_inspect/model_inspect_test.cpp b/configutil/src/tests/model_inspect/model_inspect_test.cpp index be45d4d0d46..fe818e8e4e4 100644 --- a/configutil/src/tests/model_inspect/model_inspect_test.cpp +++ b/configutil/src/tests/model_inspect/model_inspect_test.cpp @@ -1,8 +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/vespalib/testkit/test_kit.h> #include <lib/modelinspect.h> -#include <iostream> +#include <sstream> class Model { public: @@ -89,11 +88,11 @@ public: void listServices() override { _listServices = true; }; void listClusters() override { _listClusters = true; }; void listConfigIds() override { _listConfigIds = true; }; - int listHost(const vespalib::string) override { _listHost = true; return 0; }; + int listHost(const vespalib::string) override { _listHost = true; return 0; }; int listAllPorts() override { _listAllPorts = true; return 0; }; - int listCluster(const vespalib::string) override { _listCluster = true; return 0; }; - int listService(const vespalib::string) override { _listService = true; return 0; }; - int listService(const vespalib::string, const vespalib::string) override { _listService2 = true; return 0; }; + int listCluster(const vespalib::string) override { _listCluster = true; return 0; }; + int listService(const vespalib::string) override { _listService = true; return 0; }; + int listService(const vespalib::string, const vespalib::string) override { _listService2 = true; return 0; }; int listConfigId(const vespalib::string) override { _listConfigId = true; return 0; }; int getIndexOf(const vespalib::string, const vespalib::string) override { _getIndexOf = true; return 0; }; diff --git a/document/src/tests/arrayfieldvaluetest.cpp b/document/src/tests/arrayfieldvaluetest.cpp index 85659c0cbb4..7f31e0c3b3a 100644 --- a/document/src/tests/arrayfieldvaluetest.cpp +++ b/document/src/tests/arrayfieldvaluetest.cpp @@ -1,6 +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/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -11,9 +10,6 @@ using vespalib::nbostream; namespace document { struct ArrayFieldValueTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} - void testArray(); CPPUNIT_TEST_SUITE(ArrayFieldValueTest); diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index 8e17dd12e12..6957634cbde 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -1,17 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -//#include <boost/regex/icu.hpp> -#include <vespa/fastos/fastos.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <vespa/document/repo/configbuilder.h> #include <vespa/document/repo/documenttyperepo.h> -#include <iostream> -#include <memory> #include <vespa/document/update/assignvalueupdate.h> #include <vespa/document/base/testdocman.h> -#include <vespa/document/base/testdocrepo.h> #include <vespa/document/select/parser.h> #include <vespa/document/select/visitor.h> #include <vespa/document/select/bodyfielddetector.h> @@ -66,7 +61,6 @@ public: : _bucketIdFactory() {} void setUp() override; - void tearDown() override {} void createDocs(); void testParseTerminals(); @@ -912,32 +906,27 @@ namespace { std::ostringstream data; public: - virtual ~TestVisitor() {} + ~TestVisitor() {} - void visitConstant(const select::Constant& node) override - { + void visitConstant(const select::Constant& node) override { data << "CONSTANT(" << node << ")"; } - virtual void - visitInvalidConstant(const select::InvalidConstant& node) override - { + void + visitInvalidConstant(const select::InvalidConstant& node) override { data << "INVALIDCONSTANT(" << node << ")"; } - void visitDocumentType(const select::DocType& node) override - { + void visitDocumentType(const select::DocType& node) override { data << "DOCTYPE(" << node << ")"; } - void visitComparison(const select::Compare& node) override - { + void visitComparison(const select::Compare& node) override { data << "COMPARE(" << node.getLeft() << " " << node.getOperator() << " " << node.getRight() << ")"; } - void visitAndBranch(const select::And& node) override - { + void visitAndBranch(const select::And& node) override { data << "AND("; node.getLeft().visit(*this); data << ", "; @@ -945,8 +934,7 @@ namespace { data << ")"; } - void visitOrBranch(const select::Or& node) override - { + void visitOrBranch(const select::Or& node) override { data << "OR("; node.getLeft().visit(*this); data << ", "; @@ -954,72 +942,24 @@ namespace { data << ")"; } - void visitNotBranch(const select::Not& node) override - { + void visitNotBranch(const select::Not& node) override { data << "NOT("; node.getChild().visit(*this); data << ")"; } - virtual void - visitArithmeticValueNode(const select::ArithmeticValueNode &) override - { - } - - virtual void - visitFunctionValueNode(const select::FunctionValueNode &) override - { - } - - virtual void - visitIdValueNode(const select::IdValueNode &) override - { - } - - virtual void - visitSearchColumnValueNode(const select::SearchColumnValueNode &) override - { - } - - virtual void - visitFieldValueNode(const select::FieldValueNode &) override - { - } - - virtual void - visitFloatValueNode(const select::FloatValueNode &) override - { - } - - virtual void - visitVariableValueNode(const select::VariableValueNode &) override - { - } - - virtual void - visitIntegerValueNode(const select::IntegerValueNode &) override - { - } - - virtual void - visitCurrentTimeValueNode(const select::CurrentTimeValueNode &) override - { - } - - virtual void - visitStringValueNode(const select::StringValueNode &) override - { - } - - virtual void - visitNullValueNode(const select::NullValueNode &) override - { - } - - virtual void - visitInvalidValueNode(const select::InvalidValueNode &) override - { - } + void visitArithmeticValueNode(const select::ArithmeticValueNode &) override {} + void visitFunctionValueNode(const select::FunctionValueNode &) override {} + void visitIdValueNode(const select::IdValueNode &) override {} + void visitSearchColumnValueNode(const select::SearchColumnValueNode &) override {} + void visitFieldValueNode(const select::FieldValueNode &) override {} + void visitFloatValueNode(const select::FloatValueNode &) override {} + void visitVariableValueNode(const select::VariableValueNode &) override {} + void visitIntegerValueNode(const select::IntegerValueNode &) override {} + void visitCurrentTimeValueNode(const select::CurrentTimeValueNode &) override {} + void visitStringValueNode(const select::StringValueNode &) override {} + void visitNullValueNode(const select::NullValueNode &) override {} + void visitInvalidValueNode(const select::InvalidValueNode &) override {} std::string getVisitString() { return data.str(); } }; diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index 5ac7c48c7ad..baa777ceca1 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -33,8 +33,6 @@ using vespalib::tensor::TensorDimensions; namespace document { struct DocumentUpdateTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} void testSimpleUsage(); void testUpdateApplySingleValue(); diff --git a/document/src/tests/primitivefieldvaluetest.cpp b/document/src/tests/primitivefieldvaluetest.cpp index ba81e0ebbf6..15fd6e00959 100644 --- a/document/src/tests/primitivefieldvaluetest.cpp +++ b/document/src/tests/primitivefieldvaluetest.cpp @@ -1,6 +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/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -11,8 +10,6 @@ using vespalib::nbostream; namespace document { struct PrimitiveFieldValueTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} void testLiterals(); void testRaw(); diff --git a/document/src/tests/serialization/annotationserializer_test.cpp b/document/src/tests/serialization/annotationserializer_test.cpp index 9be0d6d334e..49860df128d 100644 --- a/document/src/tests/serialization/annotationserializer_test.cpp +++ b/document/src/tests/serialization/annotationserializer_test.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. -// Unit tests for annotation serialization. #include <vespa/document/base/testdocrepo.h> #include <vespa/document/annotation/alternatespanlist.h> diff --git a/document/src/tests/structfieldvaluetest.cpp b/document/src/tests/structfieldvaluetest.cpp index 0daf8c97302..d6e585e0987 100644 --- a/document/src/tests/structfieldvaluetest.cpp +++ b/document/src/tests/structfieldvaluetest.cpp @@ -17,8 +17,6 @@ namespace document { struct StructFieldValueTest : public CppUnit::TestFixture { DocumentTypeRepo doc_repo; StructFieldValueTest(); - void setUp() override {} - void tearDown() override {} void testStruct(); void testEmptyStruct(); diff --git a/document/src/tests/testrunner.cpp b/document/src/tests/testrunner.cpp index aabdbb3f605..815476a3f41 100644 --- a/document/src/tests/testrunner.cpp +++ b/document/src/tests/testrunner.cpp @@ -1,13 +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> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("documentcppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/document/src/tests/teststringutil.h b/document/src/tests/teststringutil.h index 355d90367ed..cba15682d7e 100644 --- a/document/src/tests/teststringutil.h +++ b/document/src/tests/teststringutil.h @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* $Id$*/ - #pragma once #include <cppunit/extensions/HelperMacros.h> diff --git a/document/src/tests/weightedsetfieldvaluetest.cpp b/document/src/tests/weightedsetfieldvaluetest.cpp index 100db297b55..81b98da297f 100644 --- a/document/src/tests/weightedsetfieldvaluetest.cpp +++ b/document/src/tests/weightedsetfieldvaluetest.cpp @@ -1,6 +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/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -11,8 +10,6 @@ using vespalib::nbostream; namespace document { struct WeightedSetFieldValueTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} void testWeightedSet(); void testAddIgnoreZeroWeight(); diff --git a/eval/src/tests/eval/function/function_test.cpp b/eval/src/tests/eval/function/function_test.cpp index 773b3e17d2e..964c48b670b 100644 --- a/eval/src/tests/eval/function/function_test.cpp +++ b/eval/src/tests/eval/function/function_test.cpp @@ -374,7 +374,7 @@ TEST("require that Call children can be accessed") { struct MyNodeHandler : public NodeHandler { std::vector<nodes::Node_UP> nodes; - virtual void handle(nodes::Node_UP node) override { + void handle(nodes::Node_UP node) override { if (node.get() != nullptr) { nodes.push_back(std::move(node)); } @@ -657,9 +657,9 @@ struct MySymbolExtractor : SymbolExtractor { } MySymbolExtractor() : extra(), invoke_count() {} explicit MySymbolExtractor(std::initializer_list<char> extra_in) : extra(extra_in), invoke_count() {} - virtual void extract_symbol(const char *pos_in, const char *end_in, - const char *&pos_out, vespalib::string &symbol_out) - const override + + void extract_symbol(const char *pos_in, const char *end_in, + const char *&pos_out, vespalib::string &symbol_out) const override { ++invoke_count; for (; pos_in < end_in; ++pos_in) { diff --git a/fastlib/src/vespa/fastlib/io/fileinputstream.h b/fastlib/src/vespa/fastlib/io/fileinputstream.h index 08806f1d19d..045fc61500f 100644 --- a/fastlib/src/vespa/fastlib/io/fileinputstream.h +++ b/fastlib/src/vespa/fastlib/io/fileinputstream.h @@ -1,39 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** -******************************************************************************* -* -* @author Stein Hardy Danielsen -* @date Creation date: 2000-10-07 -* @version $Id$ -* -* @file -* -* FileInputStream class -* -* Copyright (c) : 1997-2000 Fast Search & Transfer ASA -* ALL RIGHTS RESERVED -* -******************************************************************************/ -#pragma once - -#include <vespa/fastlib/io/inputstream.h> - +#pragma once +#include "inputstream.h" +#include <vespa/fastos/file.h> -/** -******************************************************************************** -* -* FileInputStream class -* @author Stein Hardy Danielsen -* @date Creation date: 2000-10-07 -* @version $Id$ -* -* -* Copyright (c) : 1997-2000 Fast Search & Transfer ASA -* ALL RIGHTS RESERVED -* -******************************************************************************/ class Fast_FileInputStream : public Fast_InputStream { private: @@ -48,21 +19,16 @@ private: /** File opened ok flag */ bool _fileOpenedOk; - public: - - /** Constructor */ Fast_FileInputStream(const char *fileName); - - /** Destructor */ - virtual ~Fast_FileInputStream(void); + ~Fast_FileInputStream(); // Implementation of Fast_InputStream interface - virtual ssize_t Read(void *targetBuffer, size_t bufferSize); - virtual bool Close(); - virtual ssize_t Available(); - virtual ssize_t Skip(size_t); + ssize_t Read(void *targetBuffer, size_t bufferSize) override; + bool Close() override; + ssize_t Available() override; + ssize_t Skip(size_t) override; }; diff --git a/fastlib/src/vespa/fastlib/io/inputstream.h b/fastlib/src/vespa/fastlib/io/inputstream.h index 22f65eb95c3..d7b443d28ee 100644 --- a/fastlib/src/vespa/fastlib/io/inputstream.h +++ b/fastlib/src/vespa/fastlib/io/inputstream.h @@ -6,11 +6,10 @@ class Fast_InputStream { public: - virtual ~Fast_InputStream() { } - virtual ssize_t Available(void) = 0; - virtual bool Close(void) = 0; + virtual ssize_t Available() = 0; + virtual bool Close() = 0; virtual ssize_t Read(void *targetBuffer, size_t bufferSize) = 0; virtual ssize_t Skip(size_t skipNBytes) = 0; }; diff --git a/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp b/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp index 6c355b78aa1..5c8f8d4d8f2 100644 --- a/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp +++ b/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp @@ -1,17 +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/fastos/app.h> #include <vespa/fastlib/net/httpheaderparser.h> #include <vespa/fastlib/io/fileinputstream.h> #include <vespa/fastlib/io/bufferedinputstream.h> - - - class HeaderReaderApp : public FastOS_Application { public: - - int Main(void) override + int Main() override { if (_argc != 2) { diff --git a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h index 36477f6b010..082ab62a75e 100644 --- a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h +++ b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h @@ -4,7 +4,7 @@ #include <vespa/fastlib/testsuite/test.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/stringfmt.h> -#include "../latintokenizer.h" +#include <vespa/fastlib/text/latintokenizer.h> class Mapel_Pucntuation { private: @@ -142,10 +142,9 @@ private: void TestTypeparamObservers(); public: - LatinTokenizerTest(); - virtual ~LatinTokenizerTest(); - - virtual void Run() override; + LatinTokenizerTest(); + ~LatinTokenizerTest(); + void Run() override; }; @@ -459,7 +458,7 @@ void LatinTokenizerTest::Run() class LatinTokenizerTestApp : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp index b3bb709def9..98860410eef 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.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 "unicodeutiltest.h" int UnicodeUtilTestApp::Main() diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h index 28f1323384f..a18728c51a9 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastlib/testsuite/test.h> - -#include "../unicodeutil.h" +#include <vespa/fastlib/text/unicodeutil.h> +#include <vespa/fastos/app.h> class UnicodeUtilTest : public Test { @@ -40,15 +40,15 @@ class UnicodeUtilTest : public Test } public: - virtual void Run() override { - // do the tests - _test(GetUTF8Char_WrongInput()); - _test(IsTerminalPunctuationChar()); - } + void Run() override { + // do the tests + _test(GetUTF8Char_WrongInput()); + _test(IsTerminalPunctuationChar()); + } }; class UnicodeUtilTestApp : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h index 3c18be1d552..dc9ec0eeb4c 100644 --- a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h +++ b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h @@ -1,9 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <memory> #include <vespa/fastlib/testsuite/test.h> - -#include "../wordfolder.h" -#include "../normwordfolder.h" +#include <vespa/fastlib/text/normwordfolder.h> class WordFoldersTest : public Test { @@ -99,9 +96,9 @@ class WordFoldersTest : public Test bool AccentRemovalTest() { auto freefunction = [] (char * ptr) { free(ptr); }; - auto input = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþpþ!"), + auto input = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("����������������������������������������������������������������������������������������������p�!"), freefunction); - auto yelloutput = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿AAAAAEAAAECEEEEIIIIDNOOOOOE×OEUUUUEYTHssaaaaaeaaaeceeeeiiiidnoooooe÷oeuuuueythpth!"), + auto yelloutput = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("�������������������������������AAAAAEAAAECEEEEIIIIDNOOOOOE�OEUUUUEYTHssaaaaaeaaaeceeeeiiiidnoooooe�oeuuuueythpth!"), freefunction); Fast_NormalizeWordFolder wordfolder; int len = wordfolder.FoldedSizeAsUTF8(input.get()); @@ -115,17 +112,18 @@ class WordFoldersTest : public Test public: - virtual void Run() override { - // do the tests - _test(NormalizeWordFolderConstruction()); - _test(TokenizeAnnotatedBuffer()); - _test(TokenizeAnnotatedUCS4Buffer()); - _test(AccentRemovalTest()); - } + + void Run() override { + // do the tests + _test(NormalizeWordFolderConstruction()); + _test(TokenizeAnnotatedBuffer()); + _test(TokenizeAnnotatedUCS4Buffer()); + _test(AccentRemovalTest()); + } }; class WordFoldersTestApp : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/util/tests/bagtest.h b/fastlib/src/vespa/fastlib/util/tests/bagtest.h index 7ca33f318f0..597317bf38e 100644 --- a/fastlib/src/vespa/fastlib/util/tests/bagtest.h +++ b/fastlib/src/vespa/fastlib/util/tests/bagtest.h @@ -1,10 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <iostream> - #include <vespa/fastlib/util/bag.h> - #include <vespa/fastlib/testsuite/test.h> +#include <iostream> /** @@ -527,37 +525,30 @@ public: delete[] _array; } - - - virtual void Run() override { - RunTest(&BagTester::IterPtrInitTest); - RunTest(&BagTester::IterRefInitTest); - RunTest(&BagTester::IterPtrStartTest); - RunTest(&BagTester::IterRefStartTest); - RunTest(&BagTester::IterStartOverTest); - RunTest(&BagTester::IterPPOperTest); - RunTest(&BagTester::GrowTest); - RunTest(&BagTester::AssignTest); - RunTest(&BagTester::CopyConstTest); - RunTest(&BagTester::EqualTest); - RunTest(&BagTester::DeleteEnumTest); - RunTest(&BagTester::RemoveTest); - RunTest(&BagTester::HasElementTest); - RunTest(&BagTester::RemoveAllElementsTest); - RunTest(&BagTester::GetBlocksizeTest); - RunTest(&BagTester::SetBlocksizeTest); - RunTest(&BagTester::NumberOfElementsTest); - } - - + void Run() override { + RunTest(&BagTester::IterPtrInitTest); + RunTest(&BagTester::IterRefInitTest); + RunTest(&BagTester::IterPtrStartTest); + RunTest(&BagTester::IterRefStartTest); + RunTest(&BagTester::IterStartOverTest); + RunTest(&BagTester::IterPPOperTest); + RunTest(&BagTester::GrowTest); + RunTest(&BagTester::AssignTest); + RunTest(&BagTester::CopyConstTest); + RunTest(&BagTester::EqualTest); + RunTest(&BagTester::DeleteEnumTest); + RunTest(&BagTester::RemoveTest); + RunTest(&BagTester::HasElementTest); + RunTest(&BagTester::RemoveAllElementsTest); + RunTest(&BagTester::GetBlocksizeTest); + RunTest(&BagTester::SetBlocksizeTest); + RunTest(&BagTester::NumberOfElementsTest); + } }; class BagTest : public FastOS_Application { public: - - virtual int Main() override; + int Main() override; }; - - diff --git a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp index 970f87831b1..92cc2fee719 100644 --- a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp +++ b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp @@ -1,14 +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 <stdio.h> -#include <assert.h> -#include <memory> +#include <vespa/fastos/app.h> +#include <vespa/fastos/file.h> #include <vespa/vespalib/stllike/string.h> -#include "../base64.h" +#include <vespa/fastlib/util/base64.h> class Base64Test : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp index 56a664ea7e1..9bf96abc1eb 100644 --- a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp +++ b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp @@ -2,7 +2,6 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN -#include <vespa/fastos/fastos.h> #include <vespa/filedistribution/distributor/filedownloader.h> #include <vespa/filedistribution/distributor/filedistributortrackerimpl.h> @@ -12,12 +11,7 @@ #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> -#include <libtorrent/session.hpp> -#include <libtorrent/tracker_manager.hpp> -#include <libtorrent/torrent.hpp> - #include <vespa/filedistribution/manager/createtorrent.h> -#include <vespa/filedistribution/model/filedistributionmodel.h> #include <vespa/filedistribution/common/componentsdeleter.h> namespace fs = boost::filesystem; @@ -47,16 +41,16 @@ createDownloader(ComponentsDeleter& deleter, } //anonymous namespace class MockFileDistributionModel : public FileDistributionModel { - virtual FileDBModel& getFileDBModel() override { + FileDBModel& getFileDBModel() override { abort(); } - virtual std::set<std::string> getFilesToDownload() override { + std::set<std::string> getFilesToDownload() override { return std::set<std::string>(); } - virtual PeerEntries getPeers(const std::string&, size_t) override { - PeerEntries peers(2); + PeerEntries getPeers(const std::string& , size_t) override { + PeerEntries peers(2); peers[0].ip = localHost; peers[0].port = uploaderPort; @@ -66,9 +60,9 @@ class MockFileDistributionModel : public FileDistributionModel { return peers; } - virtual void addPeer(const std::string&) override {} - virtual void removePeer(const std::string&) override {} - virtual void peerFinished(const std::string&) override {} + void addPeer(const std::string&) override {} + void removePeer(const std::string&) override {} + void peerFinished(const std::string&) override {} }; diff --git a/filedistribution/src/tests/rpc/mockfileprovider.h b/filedistribution/src/tests/rpc/mockfileprovider.h index 33177d939c1..fd66acfb0fc 100644 --- a/filedistribution/src/tests/rpc/mockfileprovider.h +++ b/filedistribution/src/tests/rpc/mockfileprovider.h @@ -32,7 +32,6 @@ public: downloadCompleted()(fileReference, "downloaded/path/" + fileReference); } - //Overrides DownloadCompletedSignal& downloadCompleted() override { return _downloadCompleted; } diff --git a/filedistribution/src/tests/scheduler/test-scheduler.cpp b/filedistribution/src/tests/scheduler/test-scheduler.cpp index 5be60569449..1ce5cbb9bc2 100644 --- a/filedistribution/src/tests/scheduler/test-scheduler.cpp +++ b/filedistribution/src/tests/scheduler/test-scheduler.cpp @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN -#include <vespa/fastos/fastos.h> + #include <boost/test/unit_test.hpp> #include <vespa/filedistribution/distributor/scheduler.h> @@ -9,7 +9,6 @@ #include <iostream> #include <boost/thread/barrier.hpp> -#include <thread> using filedistribution::Scheduler; using namespace std::literals; diff --git a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp index 46db660d452..51a3f0b40e3 100644 --- a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp +++ b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp @@ -2,14 +2,10 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE zkfacade test -#include <vespa/fastos/fastos.h> -#include <boost/test/unit_test.hpp> +#include <boost/test/unit_test.hpp> #include <iostream> - #include <boost/thread/barrier.hpp> -#include <boost/checked_delete.hpp> - #include <vespa/filedistribution/common/componentsdeleter.h> #include <vespa/filedistribution/model/zkfacade.h> diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp index 1db2f7c6e49..9906074afc5 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp @@ -1,13 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "filedistributortrackerimpl.h" -#include <cmath> -#include <libtorrent/tracker_manager.hpp> -#include <libtorrent/torrent.hpp> -#include <vespa/filedistribution/model/filedistributionmodel.h> -#include <vespa/filedistribution/model/zkfacade.h> #include "filedownloader.h" -#include "hostname.h" +#include <vespa/filedistribution/model/zkfacade.h> #include <vespa/log/log.h> LOG_SETUP(".filedistributiontrackerimpl"); diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp index 0288f3082f8..3b4d043a30b 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp @@ -1,22 +1,15 @@ // 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 "filedistributionmodel.h" - -#include <vector> -#include <set> -#include <string> -#include <cstdlib> +#include "filedistributionmodel.h" +#include "zkfiledbmodel.h" +#include "deployedfilestodownload.h" +#include "filedistributionmodelimpl.h" #include <boost/filesystem.hpp> #include <zookeeper/zookeeper.h> #include <vespa/log/log.h> LOG_SETUP(".filedistributionmodel"); -#include "zkfiledbmodel.h" -#include "deployedfilestodownload.h" -#include "filedistributionmodelimpl.h" - namespace fs = boost::filesystem; using filedistribution::ZKFileDBModel; diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h index e132ec8b230..4b2b14ea21f 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h @@ -2,7 +2,7 @@ #pragma once #include "filedistributionmodel.h" -#include <vespa/filedistribution/model/config-filereferences.h> +#include "config-filereferences.h" #include "zkfacade.h" #include "zkfiledbmodel.h" #include <vespa/config/config.h> diff --git a/fnet/src/examples/frt/rpc/echo_client.cpp b/fnet/src/examples/frt/rpc/echo_client.cpp index b5fabb32363..9a5cf7cbd64 100644 --- a/fnet/src/examples/frt/rpc/echo_client.cpp +++ b/fnet/src/examples/frt/rpc/echo_client.cpp @@ -1,13 +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("echo_client"); + #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class EchoClient : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_callback_client.cpp b/fnet/src/examples/frt/rpc/rpc_callback_client.cpp index 3dd936f7fea..2bf740f7b1e 100644 --- a/fnet/src/examples/frt/rpc/rpc_callback_client.cpp +++ b/fnet/src/examples/frt/rpc/rpc_callback_client.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("rpc_callback_client"); -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> struct RPC : public FRT_Invokable { @@ -34,7 +32,7 @@ RPC::Init(FRT_Supervisor *s) class MyApp : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_callback_server.cpp b/fnet/src/examples/frt/rpc/rpc_callback_server.cpp index 419b1266d23..67eac0743d6 100644 --- a/fnet/src/examples/frt/rpc/rpc_callback_server.cpp +++ b/fnet/src/examples/frt/rpc/rpc_callback_server.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("rpc_callback_server"); -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> struct RPC : public FRT_Invokable { @@ -40,7 +38,7 @@ RPC::Init(FRT_Supervisor *s) class MyApp : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_client.cpp b/fnet/src/examples/frt/rpc/rpc_client.cpp index f5e5a9fe1e2..435bfb6f08c 100644 --- a/fnet/src/examples/frt/rpc/rpc_client.cpp +++ b/fnet/src/examples/frt/rpc/rpc_client.cpp @@ -1,14 +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("rpc_client"); -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class RPCClient : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_info.cpp b/fnet/src/examples/frt/rpc/rpc_info.cpp index 5b7aebd6bdd..ae9eafa210d 100644 --- a/fnet/src/examples/frt/rpc/rpc_info.cpp +++ b/fnet/src/examples/frt/rpc/rpc_info.cpp @@ -1,8 +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("rpc_info"); + #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class RPCInfo : public FastOS_Application { @@ -64,7 +63,7 @@ public: printf("\n"); } - virtual int Main() override; + int Main() override; }; diff --git a/fnet/src/examples/frt/rpc/rpc_invoke.cpp b/fnet/src/examples/frt/rpc/rpc_invoke.cpp index 0f64ef9b539..1bb572a6025 100644 --- a/fnet/src/examples/frt/rpc/rpc_invoke.cpp +++ b/fnet/src/examples/frt/rpc/rpc_invoke.cpp @@ -1,8 +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("rpc_invoke"); + #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class RPCClient : public FastOS_Application { @@ -43,7 +42,7 @@ private: int run(); public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_proxy.cpp b/fnet/src/examples/frt/rpc/rpc_proxy.cpp index 6c805d6a173..e73f556b9d8 100644 --- a/fnet/src/examples/frt/rpc/rpc_proxy.cpp +++ b/fnet/src/examples/frt/rpc/rpc_proxy.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("rpc_proxy"); -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> //----------------------------------------------------------------------------- struct Session @@ -68,7 +66,7 @@ private: public: ReqDone(RPCProxy &proxy) : _proxy(proxy) {} - virtual void RequestDone(FRT_RPCRequest *req) override; + void RequestDone(FRT_RPCRequest *req) override; }; void @@ -209,7 +207,7 @@ RPCProxy::HOOK_Fini(FRT_RPCRequest *req) class App : public FastOS_Application { public: - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/frt/rpc/rpc_server.cpp b/fnet/src/examples/frt/rpc/rpc_server.cpp index 823d3c893b1..2b7e16b91b6 100644 --- a/fnet/src/examples/frt/rpc/rpc_server.cpp +++ b/fnet/src/examples/frt/rpc/rpc_server.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("rpc_server"); -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class RPCServer : public FRT_Invokable { @@ -107,7 +105,7 @@ private: public: App() : _server() {} - virtual int Main() override; + int Main() override; }; int diff --git a/fnet/src/examples/ping/packets.h b/fnet/src/examples/ping/packets.h index 68cc27ccb5b..27a06bdaab3 100644 --- a/fnet/src/examples/ping/packets.h +++ b/fnet/src/examples/ping/packets.h @@ -1,36 +1,36 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include <vespa/fnet/packet.h> +#include <vespa/fnet/ipacketfactory.h> enum { PCODE_PING_REQUEST = 1, PCODE_PING_REPLY = 2 }; - class PingRequest : public FNET_Packet { public: - virtual uint32_t GetPCODE() override; - virtual uint32_t GetLength() override; - virtual void Encode(FNET_DataBuffer *) override; - virtual bool Decode(FNET_DataBuffer *src, uint32_t len) override; + uint32_t GetPCODE() override; + uint32_t GetLength() override; + void Encode(FNET_DataBuffer *) override; + bool Decode(FNET_DataBuffer *src, uint32_t len) override; }; - class PingReply : public FNET_Packet { public: - virtual uint32_t GetPCODE() override; - virtual uint32_t GetLength() override; - virtual void Encode(FNET_DataBuffer *) override; - virtual bool Decode(FNET_DataBuffer *src, uint32_t len) override; + uint32_t GetPCODE() override; + uint32_t GetLength() override; + void Encode(FNET_DataBuffer *) override; + bool Decode(FNET_DataBuffer *src, uint32_t len) override; }; class PingPacketFactory : public FNET_IPacketFactory { public: - virtual FNET_Packet *CreatePacket(uint32_t pcode, FNET_Context) override; + FNET_Packet *CreatePacket(uint32_t pcode, FNET_Context) override; }; diff --git a/fnet/src/examples/ping/pingclient.cpp b/fnet/src/examples/ping/pingclient.cpp index fb834b9108b..0b28f118685 100644 --- a/fnet/src/examples/ping/pingclient.cpp +++ b/fnet/src/examples/ping/pingclient.cpp @@ -1,15 +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("pingclient"); + #include <vespa/fnet/fnet.h> #include <examples/ping/packets.h> - +#include <vespa/fastos/app.h> class PingClient : public FastOS_Application { public: - int Main() override; + int Main() override; }; diff --git a/fnet/src/examples/ping/pingserver.cpp b/fnet/src/examples/ping/pingserver.cpp index 173e627ac23..3c76bc951ec 100644 --- a/fnet/src/examples/ping/pingserver.cpp +++ b/fnet/src/examples/ping/pingserver.cpp @@ -1,10 +1,8 @@ // 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("pingserver"); + #include <vespa/fnet/fnet.h> #include <examples/ping/packets.h> - +#include <vespa/fastos/app.h> class PingServer : public FNET_IServerAdapter, public FNET_IPacketHandler, @@ -12,15 +10,13 @@ class PingServer : public FNET_IServerAdapter, { public: bool InitAdminChannel(FNET_Channel *) override { return false; } - bool InitChannel(FNET_Channel *channel, uint32_t) override - { + bool InitChannel(FNET_Channel *channel, uint32_t) override { channel->SetContext(FNET_Context(channel)); channel->SetHandler(this); return true; } - - HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override - { + + HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override { if (packet->GetPCODE() == PCODE_PING_REQUEST) { fprintf(stderr, "Got ping request, sending ping reply\n"); context._value.CHANNEL->Send(new PingReply()); @@ -28,8 +24,8 @@ public: packet->Free(); return FNET_FREE_CHANNEL; } - - int Main() override; + + int Main() override; }; diff --git a/fnet/src/examples/proxy/proxy.cpp b/fnet/src/examples/proxy/proxy.cpp index 40d7a44c7f6..2d1d44174a4 100644 --- a/fnet/src/examples/proxy/proxy.cpp +++ b/fnet/src/examples/proxy/proxy.cpp @@ -1,9 +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/log/log.h> -LOG_SETUP("proxy"); + #include <vespa/fnet/fnet.h> +#include <vespa/fastos/app.h> +#include <vespa/log/log.h> +LOG_SETUP("proxy"); class RawPacket : public FNET_Packet { @@ -12,10 +13,10 @@ private: public: RawPacket() : _data() {} - virtual uint32_t GetPCODE() override; - virtual uint32_t GetLength() override; - virtual void Encode(FNET_DataBuffer *) override; - virtual bool Decode(FNET_DataBuffer *src, uint32_t len) override; + uint32_t GetPCODE() override; + uint32_t GetLength() override; + void Encode(FNET_DataBuffer *) override; + bool Decode(FNET_DataBuffer *src, uint32_t len) override; }; uint32_t @@ -69,7 +70,7 @@ public: _server = server; } - virtual HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override; + HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override; }; @@ -139,14 +140,14 @@ private: public: Proxy() : _transport() {} - virtual bool GetPacketInfo(FNET_DataBuffer *src, uint32_t *plen, uint32_t *pcode, uint32_t *chid, bool *) override; - virtual FNET_Packet *Decode(FNET_DataBuffer *src, uint32_t plen, uint32_t pcode, FNET_Context) override; - virtual void Encode(FNET_Packet *packet, uint32_t chid, FNET_DataBuffer *dst) override; + bool GetPacketInfo(FNET_DataBuffer *src, uint32_t *plen, uint32_t *pcode, uint32_t *chid, bool *) override; + FNET_Packet *Decode(FNET_DataBuffer *src, uint32_t plen, uint32_t pcode, FNET_Context) override; + void Encode(FNET_Packet *packet, uint32_t chid, FNET_DataBuffer *dst) override; // --------------------------------------------- - virtual bool InitAdminChannel(FNET_Channel *channel) override; - virtual bool InitChannel(FNET_Channel *, uint32_t) override; + bool InitAdminChannel(FNET_Channel *channel) override; + bool InitChannel(FNET_Channel *, uint32_t) override; // --------------------------------------------- - virtual int Main() override; + int Main() override; }; diff --git a/fnet/src/examples/timeout/timeout.cpp b/fnet/src/examples/timeout/timeout.cpp index 8a52d769282..7edfbe4fb1c 100644 --- a/fnet/src/examples/timeout/timeout.cpp +++ b/fnet/src/examples/timeout/timeout.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("timeout"); -#include <vespa/fnet/fnet.h> +#include <vespa/fnet/fnet.h> +#include <vespa/fastos/app.h> class Timeout : public FNET_Task { @@ -20,7 +18,7 @@ public: _queue(queue) {} - virtual void PerformTask() override; + void PerformTask() override; }; diff --git a/fnet/src/tests/frt/method_pt/method_pt.cpp b/fnet/src/tests/frt/method_pt/method_pt.cpp index 4b869f6ba9f..98ab9d228a1 100644 --- a/fnet/src/tests/frt/method_pt/method_pt.cpp +++ b/fnet/src/tests/frt/method_pt/method_pt.cpp @@ -112,9 +112,9 @@ class MediumHandler1 : public FRT_Invokable, public MediumB { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -123,9 +123,9 @@ class MediumHandler2 : public MediumA, public MediumB { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -134,9 +134,9 @@ class MediumHandler3 : public MediumA, public FRT_Invokable { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; //------------------------------------------------------------- @@ -146,9 +146,9 @@ class ComplexHandler1 : public FRT_Invokable, public ComplexB { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -157,9 +157,9 @@ class ComplexHandler2 : public ComplexA, public ComplexB { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -168,9 +168,9 @@ class ComplexHandler3 : public ComplexA, public FRT_Invokable { public: - virtual void foo() override {} - virtual void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + void foo() override {} + void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; //------------------------------------------------------------- diff --git a/fnet/src/tests/frt/rpc/invoke.cpp b/fnet/src/tests/frt/rpc/invoke.cpp index 7853c473f5e..d51557e9cfd 100644 --- a/fnet/src/tests/frt/rpc/invoke.cpp +++ b/fnet/src/tests/frt/rpc/invoke.cpp @@ -48,8 +48,7 @@ struct LockedReqWait : public FRT_IRequestWait return ret; } - virtual void RequestDone(FRT_RPCRequest *) override - { + void RequestDone(FRT_RPCRequest *) override { _wasLocked = isLocked(); _cond.Lock(); _done = true; @@ -57,8 +56,7 @@ struct LockedReqWait : public FRT_IRequestWait _cond.Unlock(); } - void waitReq() - { + void waitReq() { _cond.Lock(); while(!_done) { _cond.Wait(); @@ -78,9 +76,7 @@ private: DelayedReturn &operator=(const DelayedReturn &); public: - DelayedReturn(FNET_Scheduler *sched, - FRT_RPCRequest *req, - double delay) + DelayedReturn(FNET_Scheduler *sched, FRT_RPCRequest *req, double delay) : FNET_Task(sched), _req(req) { diff --git a/fnet/src/tests/frt/rpc/sharedblob.cpp b/fnet/src/tests/frt/rpc/sharedblob.cpp index a086584b36a..363a7891cbd 100644 --- a/fnet/src/tests/frt/rpc/sharedblob.cpp +++ b/fnet/src/tests/frt/rpc/sharedblob.cpp @@ -10,10 +10,10 @@ struct MyBlob : FRT_ISharedBlob { int refcnt; MyBlob() : refcnt(1) {} - virtual uint32_t getLen() override { return (strlen("blob_test") + 1); } - virtual const char *getData() override { return "blob_test"; } - virtual void addRef() override { ++refcnt; } - virtual void subRef() override { --refcnt; } + uint32_t getLen() override { return (strlen("blob_test") + 1); } + const char *getData() override { return "blob_test"; } + void addRef() override { ++refcnt; } + void subRef() override { --refcnt; } }; struct Data diff --git a/fnet/src/tests/locking/castspeed.cpp b/fnet/src/tests/locking/castspeed.cpp index 1f57bc4757c..859ec08ec69 100644 --- a/fnet/src/tests/locking/castspeed.cpp +++ b/fnet/src/tests/locking/castspeed.cpp @@ -18,14 +18,14 @@ class C: public A { public: B *otherB; - virtual B* asB() override { return otherB; } + B* asB() override { return otherB; } C() : otherB(nullptr) {} }; class B: public C { public: - virtual B* asB() override { return this; } + B* asB() override { return this; } }; diff --git a/fnet/src/tests/locking/drainpackets.cpp b/fnet/src/tests/locking/drainpackets.cpp index fb86371c9ec..b453793843f 100644 --- a/fnet/src/tests/locking/drainpackets.cpp +++ b/fnet/src/tests/locking/drainpackets.cpp @@ -2,15 +2,13 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/fnet/fnet.h> - class MyPacket : public FNET_Packet { public: - uint32_t GetPCODE() override { return 0; } + uint32_t GetPCODE() override { return 0; } uint32_t GetLength() override { return 0; } void Encode(FNET_DataBuffer *) override {} - bool Decode(FNET_DataBuffer *, uint32_t) override - { return true; } + bool Decode(FNET_DataBuffer *, uint32_t) override { return true; } }; diff --git a/fnet/src/tests/scheduling/sloweventloop.cpp b/fnet/src/tests/scheduling/sloweventloop.cpp index a4b57cfd218..a13205f4b0e 100644 --- a/fnet/src/tests/scheduling/sloweventloop.cpp +++ b/fnet/src/tests/scheduling/sloweventloop.cpp @@ -2,7 +2,6 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/fnet/fnet.h> - class MyTask : public FNET_Task { public: diff --git a/fnet/src/tests/sync_execute/sync_execute.cpp b/fnet/src/tests/sync_execute/sync_execute.cpp index c832ef0330d..ca77ab6f73b 100644 --- a/fnet/src/tests/sync_execute/sync_execute.cpp +++ b/fnet/src/tests/sync_execute/sync_execute.cpp @@ -1,11 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/fnet/fnet.h> -#include <vespa/vespalib/util/sync.h> +#include <vespa/fnet/transport.h> +#include <vespa/fnet/iexecutable.h> struct DoIt : public FNET_IExecutable { vespalib::Gate gate; - virtual void execute() override { + void execute() override { gate.countDown(); } }; diff --git a/jrt_test/src/jrt-test/simpleserver/simpleserver.cpp b/jrt_test/src/jrt-test/simpleserver/simpleserver.cpp index 75defdc3881..19ebdb253a3 100644 --- a/jrt_test/src/jrt-test/simpleserver/simpleserver.cpp +++ b/jrt_test/src/jrt-test/simpleserver/simpleserver.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/log/log.h> -LOG_SETUP("simpleserver"); -#include <vespa/fastos/fastos.h> -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class Server : public FRT_Invokable { diff --git a/jrt_test/src/tests/echo/echo-client.cpp b/jrt_test/src/tests/echo/echo-client.cpp index 2d72cdc937b..14faac3ca9e 100644 --- a/jrt_test/src/tests/echo/echo-client.cpp +++ b/jrt_test/src/tests/echo/echo-client.cpp @@ -1,8 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("echo_client"); -#include <vespa/fastos/fastos.h> + #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class EchoClient : public FastOS_Application { diff --git a/jrt_test/src/tests/mandatory-methods/extract-reflection.cpp b/jrt_test/src/tests/mandatory-methods/extract-reflection.cpp index 98584e9a284..9857ea073c2 100644 --- a/jrt_test/src/tests/mandatory-methods/extract-reflection.cpp +++ b/jrt_test/src/tests/mandatory-methods/extract-reflection.cpp @@ -1,6 +1,6 @@ // 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/fastos/app.h> #include <vespa/fnet/frt/frt.h> class RPCInfo : public FastOS_Application diff --git a/jrt_test/src/tests/mockup-invoke/mockup-server.cpp b/jrt_test/src/tests/mockup-invoke/mockup-server.cpp index 46a1e2bc11a..41624eaf108 100644 --- a/jrt_test/src/tests/mockup-invoke/mockup-server.cpp +++ b/jrt_test/src/tests/mockup-invoke/mockup-server.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/log/log.h> -LOG_SETUP("mockup_server"); -#include <vespa/fastos/fastos.h> -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class MockupServer : public FRT_Invokable { diff --git a/jrt_test/src/tests/rpc-error/test-errors.cpp b/jrt_test/src/tests/rpc-error/test-errors.cpp index 07ff7425f9a..184e733da82 100644 --- a/jrt_test/src/tests/rpc-error/test-errors.cpp +++ b/jrt_test/src/tests/rpc-error/test-errors.cpp @@ -2,7 +2,6 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/fnet/frt/frt.h> - class TestErrors : public vespalib::TestApp { private: diff --git a/juniper/src/test/SrcTestSuite.cpp b/juniper/src/test/SrcTestSuite.cpp index f73e4c8fc3a..4a648e6af19 100644 --- a/juniper/src/test/SrcTestSuite.cpp +++ b/juniper/src/test/SrcTestSuite.cpp @@ -1,29 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Implementation of the test suite application SrcTestSuite. - * - * @file SrcTestSuite.cpp - * - * @author Knut Omang - * - * @date Created 21 Feb 2003 - * - * $Id$ - * - * <pre> - * Copyright (c) : 2003 Fast Search & Transfer ASA - * ALL RIGHTS RESERVED - * </pre> - ****************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/fastlib/testsuite/suite.h> + #include "testenv.h" #include "mcandTest.h" #include "queryparserTest.h" #include "matchobjectTest.h" #include "auxTest.h" - +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/fastlib/testsuite/suite.h> /** * The SrcTestSuite class runs all the unit tests for the src module. * @@ -53,7 +36,7 @@ SrcTestSuite::SrcTestSuite() : */ class SrcTestSuiteApp : public vespalib::TestApp { public: - virtual int Main() override; + int Main() override; }; int SrcTestSuiteApp::Main() { diff --git a/juniper/src/test/auxTest.cpp b/juniper/src/test/auxTest.cpp index 2dc3457e6c3..0ea1a52aeb6 100644 --- a/juniper/src/test/auxTest.cpp +++ b/juniper/src/test/auxTest.cpp @@ -1,9 +1,9 @@ // 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(""); #include "auxTest.h" +#include <vespa/fastos/file.h> +#include <vespa/log/log.h> +LOG_SETUP("auxtest"); // Using separator definitions only from here: @@ -560,7 +560,7 @@ void AuxTest::test_summary(Matcher& m, const char* content, size_t content_len, class DefProps : public IJuniperProperties { public: - virtual const char* GetProperty(const char*, const char* def) override { + const char* GetProperty(const char*, const char* def) override { return def; } }; @@ -626,12 +626,12 @@ public: TokenChecker(Token* output) : _out(output), i(0) { } - virtual void handle_token(Token& token) override { + void handle_token(Token& token) override { _out[i] = token; i++; } - virtual void handle_end(Token&) override {} + void handle_end(Token&) override {} }; @@ -670,13 +670,13 @@ private: std::vector<std::string> _tokens; public: TokenProcessor(const std::string & text) : _text(text), _tokens() {} - virtual void handle_token(Token & t) override { + void handle_token(Token & t) override { _tokens.push_back(std::string(_text.c_str() + t.bytepos, t.bytelen)); //LOG(info, "handle_token(%s): bytepos(%d), wordpos(%d), bytelen(%d), curlen(%d)", //_tokens.back().c_str(), //(int)t.bytepos, (int)t.wordpos, t.bytelen, t.curlen); } - virtual void handle_end(Token & t) override { + void handle_end(Token & t) override { _tokens.push_back(std::string(_text.c_str() + t.bytepos, t.bytelen)); //LOG(info, "handle_end(%s): bytepos(%d), wordpos(%d), bytelen(%d), curlen(%d)", //_tokens.back().c_str(), diff --git a/juniper/src/test/auxTest.h b/juniper/src/test/auxTest.h index 218dcaab6d0..a98adc732f4 100644 --- a/juniper/src/test/auxTest.h +++ b/juniper/src/test/auxTest.h @@ -7,7 +7,6 @@ #include <vespa/fastlib/testsuite/test.h> #include "testenv.h" - class AuxTest : public Test { private: @@ -25,14 +24,14 @@ public: void Run(MethodContainer::iterator &itr); void Run(const char* method); void Run(int argc, char* argv[]); - virtual void Run() override; + void Run() override; protected: /** * Since we are running within Emacs, the default behavior of * print_progress which includes backspace does not work. * We'll use a single '.' instead. */ - virtual void print_progress() override { *m_osptr << '.' << std::flush; } + void print_progress() override { *m_osptr << '.' << std::flush; } private: // tests: void TestPropertyMap(); diff --git a/juniper/src/test/auxTestApp.cpp b/juniper/src/test/auxTestApp.cpp index 3f43c706d35..a9475998aa4 100644 --- a/juniper/src/test/auxTestApp.cpp +++ b/juniper/src/test/auxTestApp.cpp @@ -1,12 +1,11 @@ // 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 "auxTest.h" +#include <vespa/vespalib/testkit/testapp.h> class AuxTestApp : public vespalib::TestApp { public: - virtual int Main() override; + int Main() override; }; diff --git a/juniper/src/test/fakerewriter.h b/juniper/src/test/fakerewriter.h index 0a0554f76fc..cf78fd28255 100644 --- a/juniper/src/test/fakerewriter.h +++ b/juniper/src/test/fakerewriter.h @@ -8,10 +8,10 @@ class FakeRewriter: public juniper::IRewriter { public: FakeRewriter() : _name() {} - virtual const char* Name() const override; - virtual juniper::RewriteHandle* Rewrite(uint32_t langid, const char* term) override; - virtual juniper::RewriteHandle* Rewrite(uint32_t langid, const char* term, size_t length) override; - virtual const char* NextTerm(juniper::RewriteHandle* exp, size_t& length) override; + const char* Name() const override; + juniper::RewriteHandle* Rewrite(uint32_t langid, const char* term) override; + juniper::RewriteHandle* Rewrite(uint32_t langid, const char* term, size_t length) override; + const char* NextTerm(juniper::RewriteHandle* exp, size_t& length) override; private: std::string _name; }; diff --git a/juniper/src/test/matchobjectTest.h b/juniper/src/test/matchobjectTest.h index 9e0828cfa77..0f4a1ace55b 100644 --- a/juniper/src/test/matchobjectTest.h +++ b/juniper/src/test/matchobjectTest.h @@ -17,9 +17,9 @@ ***************************************************************************/ #pragma once -#include <map> -#include <vespa/fastlib/testsuite/test.h> #include "testenv.h" +#include <vespa/fastlib/testsuite/test.h> +#include <map> /** * The MatchObjectTest class holds @@ -98,8 +98,7 @@ protected: * print_progress which includes backspace does not work. * We'll use a single '.' instead. */ - virtual void print_progress() override { *m_osptr << '.' << std::flush; } - + void print_progress() override { *m_osptr << '.' << std::flush; } public: MatchObjectTest() : Test("MatchObject"), test_methods_() { init(); } @@ -109,7 +108,7 @@ public: * main entry points *************************************************************************/ void Run(MethodContainer::iterator &itr); - virtual void Run() override; + void Run() override; void Run(const char *method); void Run(int argc, char* argv[]); }; diff --git a/juniper/src/test/matchobjectTestApp.cpp b/juniper/src/test/matchobjectTestApp.cpp index 065af199589..f755c3e932a 100644 --- a/juniper/src/test/matchobjectTestApp.cpp +++ b/juniper/src/test/matchobjectTestApp.cpp @@ -1,25 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Definition and implementation of the application for running unit tests - * for the MatchObject class in isolation. - * - * @file matchobjectTestApp.cpp - * - * @author Knut Omang - * - * @date Created 21 Feb 2003 - * - * $Id$ - * - * <pre> - * Copyright (c) : 2003 Fast Search & Transfer ASA - * ALL RIGHTS RESERVED - * </pre> - ****************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/testkit/testapp.h> + #include "matchobjectTest.h" #include "testenv.h" +#include <vespa/vespalib/testkit/testapp.h> /** * The MatchObjectTestApp class is the main routine for running the unit @@ -29,7 +12,7 @@ */ class MatchObjectTestApp : public vespalib::TestApp { public: - virtual int Main() override { + int Main() override { juniper::TestEnv te(this, TEST_PATH("../rpclient/testclient.rc").c_str()); MatchObjectTest test; test.SetStream(&std::cout); diff --git a/juniper/src/test/mcandTest.cpp b/juniper/src/test/mcandTest.cpp index b185707c1be..0dc198864fe 100644 --- a/juniper/src/test/mcandTest.cpp +++ b/juniper/src/test/mcandTest.cpp @@ -16,11 +16,11 @@ * ALL RIGHTS RESERVED * </pre> ***************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(""); + #include "mcandTest.h" -#include "testenv.h" + +#include <vespa/log/log.h> +LOG_SETUP("mcandtest"); // Comment out cerr below to ignore unimplemented tests #define NOTEST(name) \ @@ -405,13 +405,13 @@ struct MyTokenProcessor : public ITokenProcessor Matcher &_m; std::vector<size_t> _cands; MyTokenProcessor(Matcher &m) : _m(m), _cands() {} - virtual void handle_token(Token &token) override { + void handle_token(Token &token) override { _m.handle_token(token); const match_sequence *ms = _m.GetWorkSet(); _cands.push_back(ms[0].size()); LOG(info, "match_sequence[0].size(%zu)", _cands.back()); } - virtual void handle_end(Token &token) override { + void handle_end(Token &token) override { _m.handle_end(token); } }; diff --git a/juniper/src/test/mcandTest.h b/juniper/src/test/mcandTest.h index 754c18ee9dd..3fc32ee9f5d 100644 --- a/juniper/src/test/mcandTest.h +++ b/juniper/src/test/mcandTest.h @@ -196,7 +196,7 @@ protected: * print_progress which includes backspace does not work. * We'll use a single '.' instead. */ - virtual void print_progress() override { *m_osptr << '.' << std::flush; } + void print_progress() override { *m_osptr << '.' << std::flush; } public: @@ -207,7 +207,7 @@ public: * main entry points *************************************************************************/ void Run(MethodContainer::iterator &itr); - virtual void Run() override; + void Run() override; void Run(const char *method); void Run(int argc, char* argv[]); }; diff --git a/juniper/src/test/mcandTestApp.cpp b/juniper/src/test/mcandTestApp.cpp index 8a93c14cfc9..cb33e503bb5 100644 --- a/juniper/src/test/mcandTestApp.cpp +++ b/juniper/src/test/mcandTestApp.cpp @@ -1,25 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Definition and implementation of the application for running unit tests - * for the MatchCandidate class in isolation. - * - * @file mcandTestApp.cpp - * - * @author Knut Omang - * - * @date Created 27 Feb 2003 - * - * $Id$ - * - * <pre> - * Copyright (c) : 2003 Fast Search & Transfer ASA - * ALL RIGHTS RESERVED - * </pre> - ****************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/testkit/testapp.h> + #include "mcandTest.h" -#include "testenv.h" +#include <vespa/vespalib/testkit/testapp.h> /** * The MatchCandidateTestApp class is the main routine for running the unit @@ -29,7 +11,7 @@ */ class MatchCandidateTestApp : public vespalib::TestApp { public: - virtual int Main() override { + int Main() override { juniper::TestEnv te(this, TEST_PATH("../rpclient/testclient.rc").c_str()); MatchCandidateTest test; test.SetStream(&std::cout); diff --git a/juniper/src/test/queryparserTest.h b/juniper/src/test/queryparserTest.h index b4f464f7592..d868fca659e 100644 --- a/juniper/src/test/queryparserTest.h +++ b/juniper/src/test/queryparserTest.h @@ -17,11 +17,11 @@ ***************************************************************************/ #pragma once -#include <map> -#include <vespa/fastlib/testsuite/test.h> #include "testenv.h" #include <vespa/juniper/queryparser.h> #include <vespa/juniper/rewriter.h> +#include <vespa/fastlib/testsuite/test.h> +#include <map> /** * The QueryParserTest class holds @@ -97,7 +97,7 @@ protected: * print_progress which includes backspace does not work. * We'll use a single '.' instead. */ - virtual void print_progress() override { *m_osptr << '.' << std::flush; } + void print_progress() override { *m_osptr << '.' << std::flush; } public: @@ -108,7 +108,7 @@ public: * main entry points *************************************************************************/ void Run(MethodContainer::iterator &itr); - virtual void Run() override; + void Run() override; void Run(const char *method); void Run(int argc, char* argv[]); }; diff --git a/juniper/src/test/queryparserTestApp.cpp b/juniper/src/test/queryparserTestApp.cpp index 3559b0177b6..7b3151a2314 100644 --- a/juniper/src/test/queryparserTestApp.cpp +++ b/juniper/src/test/queryparserTestApp.cpp @@ -1,25 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Definition and implementation of the application for running unit tests - * for the QueryParser class in isolation. - * - * @file queryparserTestApp.cpp - * - * @author Knut Omang - * - * @date Created 24 Feb 2003 - * - * $Id$ - * - * <pre> - * Copyright (c) : 2003 Fast Search & Transfer ASA - * ALL RIGHTS RESERVED - * </pre> - ****************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/testkit/testapp.h> + #include "queryparserTest.h" #include "testenv.h" +#include <vespa/vespalib/testkit/testapp.h> /** * The QueryParserTestApp class is the main routine for running the unit @@ -29,7 +12,7 @@ */ class QueryParserTestApp : public vespalib::TestApp { public: - virtual int Main() override { + int Main() override { juniper::TestEnv te(this, TEST_PATH("../rpclient/testclient.rc").c_str()); QueryParserTest test; test.SetStream(&std::cout); diff --git a/juniper/src/test/testenv.h b/juniper/src/test/testenv.h index 88d250767fc..cc126f3f3a5 100644 --- a/juniper/src/test/testenv.h +++ b/juniper/src/test/testenv.h @@ -20,6 +20,7 @@ #include <vespa/juniper/mcand.h> #include <vespa/juniper/propreader.h> #include <vespa/juniper/specialtokenregistry.h> +#include <vespa/fastos/app.h> namespace juniper { @@ -55,9 +56,9 @@ private: std::map<std::string, std::string> _map; public: PropertyMap(); - virtual ~PropertyMap(); + ~PropertyMap(); PropertyMap &set(const char *name, const char *value); - virtual const char* GetProperty(const char* name, const char* def = NULL) override; + const char* GetProperty(const char* name, const char* def = NULL) override; }; diff --git a/memfilepersistence/src/tests/testrunner.cpp b/memfilepersistence/src/tests/testrunner.cpp index 16027870c47..5baa0f60b6e 100644 --- a/memfilepersistence/src/tests/testrunner.cpp +++ b/memfilepersistence/src/tests/testrunner.cpp @@ -1,14 +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 <iostream> -#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("persistencecppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h b/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h index 23e4857fdb3..cc2145444a5 100644 --- a/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h +++ b/memfilepersistence/src/vespa/memfilepersistence/common/filespecification.h @@ -37,8 +37,7 @@ public: const String& getPath() const { return _path; } FileVersion getWantedFileVersion() const { return _wantedVersion; } - virtual void print(std::ostream& out, bool verbose, - const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; bool operator==(const FileSpecification& o) const { return (_bucketId == o._bucketId && _dir == o._dir @@ -48,4 +47,3 @@ public: } // storage } // memfile - diff --git a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp index b483d4691c4..b0fa6cf6667 100644 --- a/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp +++ b/memfilepersistence/src/vespa/memfilepersistence/device/partitionmonitor.cpp @@ -26,8 +26,7 @@ namespace { } struct RealStatter : public PartitionMonitor::Statter { - virtual void statFileSystem(const std::string& file, struct statvfs& info) override - { + void statFileSystem(const std::string& file, struct statvfs& info) override { if (statvfs(file.c_str(), &info) != 0) { vespalib::asciistream ost; ost << "Failed to run statvfs to find data on disk containing " 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/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/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> diff --git a/metrics/src/tests/metricmanagertest.cpp b/metrics/src/tests/metricmanagertest.cpp index 362cad83a66..0ba6bdfbd2f 100644 --- a/metrics/src/tests/metricmanagertest.cpp +++ b/metrics/src/tests/metricmanagertest.cpp @@ -9,8 +9,6 @@ #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/data/slime/slime.h> -#include <fstream> -#include <sstream> #include <vespa/log/log.h> LOG_SETUP(".test.metricmanager"); @@ -143,22 +141,20 @@ struct MetricNameVisitor : public MetricVisitor { MetricNameVisitor(bool debug_ = false) : debug(debug_) {} - virtual bool visitMetricSet(const MetricSet& metricSet, - bool autoGenerated) override - { + bool visitMetricSet(const MetricSet& metricSet, bool autoGenerated) override { if (debug) { ost << "<" << (autoGenerated ? "*" : "") << metricSet.getPath() << ">\n"; } return true; } - virtual void doneVisitingMetricSet(const MetricSet& metricSet) override { + void doneVisitingMetricSet(const MetricSet& metricSet) override { if (debug) { ost << "</" << metricSet.getPath() << ">\n"; } } - virtual bool visitMetric(const Metric& m, bool autoGenerated) override { + bool visitMetric(const Metric& m, bool autoGenerated) override { ost << (autoGenerated ? "*" : "") << m.getPath() << "\n"; return true; } @@ -390,7 +386,7 @@ namespace { struct FakeTimer : public MetricManager::Timer { time_t _time; FakeTimer(time_t startTime = 0) : _time(startTime) {} - virtual time_t getTime() const override { return _time; } + time_t getTime() const override { return _time; } }; struct BriefValuePrinter : public MetricVisitor { @@ -399,7 +395,7 @@ namespace { BriefValuePrinter() : count(0), ost() {} - virtual bool visitMetric(const Metric& metric, bool) override { + bool visitMetric(const Metric& metric, bool) override { if (++count > 1) ost << ","; //ost << metric.getPath() << ":"; ost << metric.getDoubleValue("value"); diff --git a/metrics/src/tests/metricsettest.cpp b/metrics/src/tests/metricsettest.cpp index 176572acbd4..2b45bd049e0 100644 --- a/metrics/src/tests/metricsettest.cpp +++ b/metrics/src/tests/metricsettest.cpp @@ -1,5 +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/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/objects/floatingpointtype.h> #include <vespa/metrics/metrics.h> @@ -28,7 +28,7 @@ namespace { TestMetricVisitor(uint32_t setsToVisit_ = 100) : ost(), setsToVisit(setsToVisit_) {} - virtual bool visitMetricSet(const MetricSet& set, bool autoGenerated) override { + bool visitMetricSet(const MetricSet& set, bool autoGenerated) override { ost << "[" << (autoGenerated ? "*" : "") << set.getName() << "]\n"; if (setsToVisit > 0) { --setsToVisit; @@ -36,7 +36,7 @@ namespace { } return false; } - virtual bool visitMetric(const Metric& m, bool autoGenerated) override { + bool visitMetric(const Metric& m, bool autoGenerated) override { ost << (autoGenerated ? "*" : "") << m.getName() << "\n"; return true; } diff --git a/metrics/src/tests/snapshottest.cpp b/metrics/src/tests/snapshottest.cpp index bee3e910fb3..5c13a0f82b6 100644 --- a/metrics/src/tests/snapshottest.cpp +++ b/metrics/src/tests/snapshottest.cpp @@ -1,6 +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/metrics/metrics.h> #include <vespa/metrics/loadmetric.hpp> #include <vespa/metrics/summetric.hpp> @@ -40,8 +39,8 @@ struct SubSubMetricSet : public MetricSet { SubSubMetricSet(vespalib::stringref name, const LoadTypeSet& loadTypes_, MetricSet* owner = 0); ~SubSubMetricSet(); - virtual MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType, - metrics::MetricSet* owner, bool includeUnused) const override; + MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType, + metrics::MetricSet* owner, bool includeUnused) const override; void incValues(); }; @@ -191,10 +190,8 @@ TestMetricSet::incValues() { struct FakeTimer : public MetricManager::Timer { uint32_t _timeInSecs; - FakeTimer() : _timeInSecs(1) {} - - virtual time_t getTime() const override { return _timeInSecs; } + time_t getTime() const override { return _timeInSecs; } }; } // End of anonymous namespace diff --git a/metrics/src/tests/stresstest.cpp b/metrics/src/tests/stresstest.cpp index 5a2a736e9ba..70194ecd861 100644 --- a/metrics/src/tests/stresstest.cpp +++ b/metrics/src/tests/stresstest.cpp @@ -1,5 +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/metrics/metrics.h> #include <vespa/metrics/loadmetric.hpp> #include <vespa/metrics/summetric.hpp> @@ -108,7 +108,7 @@ OuterMetricSet::~OuterMetricSet() { } //std::cerr << "Loadgiver thread joined\n"; } - virtual void run() override { + void run() override { uint64_t i = 0; while (running()) { ++i; diff --git a/metrics/src/tests/testrunner.cpp b/metrics/src/tests/testrunner.cpp index 5d8dc8d4c1f..9bf86e3276a 100644 --- a/metrics/src/tests/testrunner.cpp +++ b/metrics/src/tests/testrunner.cpp @@ -1,14 +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 <iostream> -#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("storagecppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/persistence/src/tests/proxy/mockprovider.h b/persistence/src/tests/proxy/mockprovider.h index b7019239847..a90b4cc27f7 100644 --- a/persistence/src/tests/proxy/mockprovider.h +++ b/persistence/src/tests/proxy/mockprovider.h @@ -20,34 +20,34 @@ struct MockProvider : PersistenceProvider { MockProvider() : last_called(NONE) {} - virtual Result initialize() override { + Result initialize() override { last_called = INITIALIZE; return Result(); } - virtual PartitionStateListResult getPartitionStates() const override { + PartitionStateListResult getPartitionStates() const override { last_called = GET_PARTITION_STATES; return PartitionStateListResult(PartitionStateList(1u)); } - virtual BucketIdListResult listBuckets(PartitionId id) const override { + BucketIdListResult listBuckets(PartitionId id) const override { last_called = LIST_BUCKETS; BucketIdListResult::List result; result.push_back(document::BucketId(id)); return BucketIdListResult(result); } - virtual Result setClusterState(const ClusterState &) override { + Result setClusterState(const ClusterState &) override { last_called = SET_CLUSTER_STATE; return Result(); } - virtual Result setActiveState(const Bucket &, BucketInfo::ActiveState) override { + Result setActiveState(const Bucket &, BucketInfo::ActiveState) override { last_called = SET_ACTIVE_STATE; return Result(); } - virtual BucketInfoResult getBucketInfo(const Bucket &bucket) const override { + BucketInfoResult getBucketInfo(const Bucket &bucket) const override { last_called = GET_BUCKET_INFO; return BucketInfoResult(BucketInfo(BucketChecksum(1), 2, 3, bucket.getBucketId().getRawId(), @@ -56,17 +56,17 @@ struct MockProvider : PersistenceProvider { BucketInfo::ACTIVE)); } - virtual Result put(const Bucket &, Timestamp, const DocumentSP&, Context&) override { + Result put(const Bucket &, Timestamp, const DocumentSP&, Context&) override { last_called = PUT; return Result(); } - virtual RemoveResult remove(const Bucket &, Timestamp, const DocumentId &, Context&) override { + RemoveResult remove(const Bucket &, Timestamp, const DocumentId &, Context&) override { last_called = REMOVE_BY_ID; return RemoveResult(true); } - virtual RemoveResult removeIfFound(const Bucket &, Timestamp, const DocumentId &, Context&) override { + RemoveResult removeIfFound(const Bucket &, Timestamp, const DocumentId &, Context&) override { last_called = REMOVE_IF_FOUND; return RemoveResult(true); } @@ -77,54 +77,54 @@ struct MockProvider : PersistenceProvider { return RemoveResult(true); } - virtual UpdateResult update(const Bucket &, Timestamp timestamp, const DocumentUpdateSP&, Context&) override { + UpdateResult update(const Bucket &, Timestamp timestamp, const DocumentUpdateSP&, Context&) override { last_called = UPDATE; return UpdateResult(Timestamp(timestamp - 10)); } - virtual Result flush(const Bucket&, Context&) override { + Result flush(const Bucket&, Context&) override { last_called = FLUSH; return Result(); } - virtual GetResult get(const Bucket &, const document::FieldSet&, const DocumentId&, Context&) const override { + GetResult get(const Bucket &, const document::FieldSet&, const DocumentId&, Context&) const override { last_called = GET; return GetResult(Document::UP(new Document), Timestamp(6u)); } - virtual CreateIteratorResult createIterator(const Bucket& bucket, - const document::FieldSet&, - const Selection&, - IncludedVersions, - Context&) override + CreateIteratorResult createIterator(const Bucket& bucket, + const document::FieldSet&, + const Selection&, + IncludedVersions, + Context&) override { last_called = CREATE_ITERATOR; return CreateIteratorResult(IteratorId(bucket.getPartition())); } - virtual IterateResult iterate(IteratorId, uint64_t, Context&) const override { + IterateResult iterate(IteratorId, uint64_t, Context&) const override { last_called = ITERATE; IterateResult::List result; result.push_back(DocEntry::UP(new DocEntry(Timestamp(1), 0))); return IterateResult(std::move(result), true); } - virtual Result destroyIterator(IteratorId, Context&) override { + Result destroyIterator(IteratorId, Context&) override { last_called = DESTROY_ITERATOR; return Result(); } - virtual Result createBucket(const Bucket&, Context&) override { + Result createBucket(const Bucket&, Context&) override { last_called = CREATE_BUCKET; return Result(); } - virtual Result deleteBucket(const Bucket&, Context&) override { + Result deleteBucket(const Bucket&, Context&) override { last_called = DELETE_BUCKET; return Result(); } - virtual BucketIdListResult getModifiedBuckets() const override { + BucketIdListResult getModifiedBuckets() const override { last_called = GET_MODIFIED_BUCKETS; BucketIdListResult::List list; list.push_back(document::BucketId(2)); @@ -132,30 +132,28 @@ struct MockProvider : PersistenceProvider { return BucketIdListResult(list); } - virtual Result split(const Bucket &, const Bucket &, const Bucket &, Context&) override - { + Result split(const Bucket &, const Bucket &, const Bucket &, Context&) override { last_called = SPLIT; return Result(); } - virtual Result join(const Bucket &, const Bucket &, const Bucket &, Context&) override - { + Result join(const Bucket &, const Bucket &, const Bucket &, Context&) override { last_called = JOIN; return Result(); } - virtual Result move(const Bucket &, PartitionId, Context&) override { + Result move(const Bucket &, PartitionId, Context&) override { last_called = MOVE; return Result(); } - virtual Result maintain(const Bucket &, MaintenanceLevel) override { + Result maintain(const Bucket &, MaintenanceLevel) override { last_called = MAINTAIN; return Result(); } - virtual Result removeEntry(const Bucket &, Timestamp, Context&) override { + Result removeEntry(const Bucket &, Timestamp, Context&) override { last_called = REMOVE_ENTRY; return Result(); } @@ -163,4 +161,3 @@ struct MockProvider : PersistenceProvider { } // namespace spi } // namespace storage - diff --git a/persistence/src/tests/proxy/providerproxy_conformancetest.cpp b/persistence/src/tests/proxy/providerproxy_conformancetest.cpp index a33b736a12d..cadcd3c224a 100644 --- a/persistence/src/tests/proxy/providerproxy_conformancetest.cpp +++ b/persistence/src/tests/proxy/providerproxy_conformancetest.cpp @@ -1,6 +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/vespalib/testkit/test_kit.h> #include <vespa/document/repo/documenttyperepo.h> #include <vespa/persistence/conformancetest/conformancetest.h> @@ -21,9 +20,7 @@ struct DummyFactory : Factory { return PersistenceProvider::UP(new dummy::DummyPersistence(repo, 4)); } - virtual bool - supportsActiveState() const override - { + bool supportsActiveState() const override { return true; } }; diff --git a/persistence/src/tests/proxy/proxy_factory_wrapper.h b/persistence/src/tests/proxy/proxy_factory_wrapper.h index 5d7899e7ff9..415d43e8033 100644 --- a/persistence/src/tests/proxy/proxy_factory_wrapper.h +++ b/persistence/src/tests/proxy/proxy_factory_wrapper.h @@ -2,7 +2,7 @@ #pragma once -#include <vespa/vespalib/util/vstringfmt.h> +#include <vespa/vespalib/util/stringfmt.h> #include <vespa/persistence/conformancetest/conformancetest.h> #include <vespa/persistence/proxy/providerstub.h> #include <vespa/persistence/proxy/providerproxy.h> @@ -33,7 +33,7 @@ struct ProxyFactoryWrapper : ConformanceTest::PersistenceFactory DummyProviderFactory::UP provider; Server::UP server; Wrapper(DummyProviderFactory::UP p, Server::UP s, const Repo &repo) - : Client(vespalib::make_vespa_string("tcp/localhost:%u", s->getPort()), repo), + : Client(vespalib::make_string("tcp/localhost:%u", s->getPort()), repo), provider(std::move(p)), server(std::move(s)) {} @@ -47,9 +47,7 @@ struct ProxyFactoryWrapper : ConformanceTest::PersistenceFactory return Provider::UP(new Wrapper(std::move(provider), std::move(server), *repo)); } - virtual bool - supportsActiveState() const override - { + bool supportsActiveState() const override { return factory->supportsActiveState(); } }; diff --git a/persistence/src/tests/testrunner.cpp b/persistence/src/tests/testrunner.cpp index 16027870c47..5baa0f60b6e 100644 --- a/persistence/src/tests/testrunner.cpp +++ b/persistence/src/tests/testrunner.cpp @@ -1,14 +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 <iostream> -#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("persistencecppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h index 1dee3fb60c3..a1656ce7ce1 100644 --- a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h +++ b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h @@ -144,14 +144,9 @@ public: BucketIdListResult getModifiedBuckets() const override; Result setClusterState(const ClusterState& newState) override; - - Result setActiveState(const Bucket& bucket, - BucketInfo::ActiveState newState) override; - + Result setActiveState(const Bucket& bucket, BucketInfo::ActiveState newState) override; BucketInfoResult getBucketInfo(const Bucket&) const override; - Result put(const Bucket&, Timestamp, const DocumentSP&, Context&) override; - GetResult get(const Bucket&, const document::FieldSet& fieldSet, const DocumentId&, @@ -185,7 +180,6 @@ public: Context&) override; Result revert(const Bucket&, Timestamp, Context&); - Result maintain(const Bucket& bucket, MaintenanceLevel level) override; /** @@ -242,4 +236,3 @@ private: } // dummy } // spi } // storage - diff --git a/persistence/src/vespa/persistence/proxy/providerstub.h b/persistence/src/vespa/persistence/proxy/providerstub.h index 27e726ca538..ce831547ef9 100644 --- a/persistence/src/vespa/persistence/proxy/providerstub.h +++ b/persistence/src/vespa/persistence/proxy/providerstub.h @@ -29,7 +29,7 @@ private: vespalib::ThreadStackExecutor &e, std::unique_ptr<PersistenceProvider> &p) : FNET_Task(s), executor(e), provider(p) {} - virtual void PerformTask() override { + void PerformTask() override { executor.sync(); assert(provider.get() != 0); provider.reset(); diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.h b/searchlib/src/vespa/searchlib/attribute/enumattribute.h index 94e5da62967..8cc383d4abf 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.h @@ -2,9 +2,9 @@ #pragma once -#include <vespa/searchlib/attribute/enumstore.h> #include "attributevector.h" #include "loadedenumvalue.h" +#include <vespa/searchlib/attribute/enumstore.h> #include <set> namespace search { @@ -61,18 +61,10 @@ protected: virtual EnumType getFromEnum(EnumHandle e) const { return _enumStore.getValue(e); } virtual void fillPostings(LoadedVector & loaded) { (void) loaded; } - virtual void fillEnum(LoadedVector & loaded) override; - - virtual void - fillEnum0(const void *src, - size_t srcLen, - EnumIndexVector &eidxs) override; - - virtual void - fixupEnumRefCounts(const EnumVector &enumHist) override; - - virtual uint64_t - getUniqueValueCount(void) const override; + void fillEnum(LoadedVector & loaded); + void fillEnum0(const void *src, size_t srcLen, EnumIndexVector &eidxs) override; + void fixupEnumRefCounts(const EnumVector &enumHist) override; + uint64_t getUniqueValueCount(void) const override; static EnumType getDefaultEnumTypeValue() { return B::defaultValue(); } @@ -90,9 +82,8 @@ public: EnumAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & cfg); - virtual ~EnumAttribute(); + ~EnumAttribute(); virtual bool findEnum(EnumType v, EnumHandle & e) const { return _enumStore.findEnum(v, e); } }; } // namespace search - diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.h b/searchlib/src/vespa/searchlib/attribute/flagattribute.h index ea73ecb7c51..3fe2424b97d 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.h @@ -40,8 +40,7 @@ public: void setNewBVValue(DocId doc, typename B::WType::ValueType value); private: - virtual bool onAddDoc(DocId doc) override; - + bool onAddDoc(DocId doc) override; void onAddDocs(DocId docIdLimit) override; void ensureGuardBit(BitVector & bv); void ensureGuardBit(); diff --git a/searchlib/src/vespa/searchlib/attribute/multistringattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multistringattribute.cpp index 737f464206e..6e9eaae7c09 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multistringattribute.cpp @@ -1,11 +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 "multistringattribute.h" -#include "multistringattribute.hpp" -#include <vespa/log/log.h> -LOG_SETUP(".searchlib.attribute.multistringattribute"); namespace search { template class MultiValueStringAttributeT<EnumAttribute<StringAttribute>, multivalue::Value<EnumStoreBase::Index> >; diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h index 4a30c0ecb1b..b94d1717ed1 100644 --- a/searchlib/src/vespa/searchlib/features/dotproductfeature.h +++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.h @@ -156,8 +156,8 @@ public: protected: const A * _attribute; private: - virtual size_t getAttributeValues(uint32_t docid, const AT * & count) override; -public: + size_t getAttributeValues(uint32_t docid, const AT * & count) override; + public: DotProductExecutor(const A * attribute, const V & queryVector); ~DotProductExecutor(); }; diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.h b/searchlib/src/vespa/searchlib/features/raw_score_feature.h index ddae8848052..2e37c43c8f7 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.h +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.h @@ -8,39 +8,37 @@ namespace search { namespace features { -class RawScoreExecutor : public search::fef::FeatureExecutor +class RawScoreExecutor : public fef::FeatureExecutor { private: - std::vector<search::fef::TermFieldHandle> _handles; + std::vector<fef::TermFieldHandle> _handles; const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(fef::MatchData &md) override; public: - RawScoreExecutor(const search::fef::IQueryEnvironment &env, uint32_t fieldId); - virtual void execute(uint32_t docId) override; + RawScoreExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); + void execute(uint32_t docId) override; }; //----------------------------------------------------------------------------- -class RawScoreBlueprint : public search::fef::Blueprint +class RawScoreBlueprint : public fef::Blueprint { private: - const search::fef::FieldInfo *_field; + const fef::FieldInfo *_field; public: RawScoreBlueprint() : Blueprint("rawScore"), _field(0) {} - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &, - search::fef::IDumpFeatureVisitor &) const override {} - virtual search::fef::Blueprint::UP createInstance() const override { + void visitDumpFeatures(const fef::IIndexEnvironment &, + fef::IDumpFeatureVisitor &) const override {} + fef::Blueprint::UP createInstance() const override { return Blueprint::UP(new RawScoreBlueprint()); } - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().field(); + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().field(); } - virtual bool setup(const search::fef::IIndexEnvironment &env, - const search::fef::ParameterList ¶ms) override; - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment &env, const fef::ParameterList ¶ms) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; } // namespace features } // namespace search - diff --git a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h index 7dad54e65d5..020cc25a2f9 100644 --- a/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/reverseproximityfeature.h @@ -1,8 +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 <string> -#include <vector> #include <vespa/searchlib/fef/blueprint.h> #include <vespa/searchlib/fef/featureexecutor.h> @@ -23,7 +21,7 @@ struct ReverseProximityConfig { /** * Implements the executor for reverse proximity. */ -class ReverseProximityExecutor : public search::fef::FeatureExecutor { +class ReverseProximityExecutor : public fef::FeatureExecutor { public: /** * Constructs an executor for reverse proximity. @@ -31,48 +29,32 @@ public: * @param env The query environment. * @param config The completeness config. */ - ReverseProximityExecutor(const search::fef::IQueryEnvironment &env, + ReverseProximityExecutor(const fef::IQueryEnvironment &env, const ReverseProximityConfig &config); - virtual void execute(uint32_t docId) override; + void execute(uint32_t docId) override; private: const ReverseProximityConfig &_config; // The proximity config. - search::fef::TermFieldHandle _termA; // Handle to the first query term. - search::fef::TermFieldHandle _termB; // Handle to the second query term. + fef::TermFieldHandle _termA; // Handle to the first query term. + fef::TermFieldHandle _termB; // Handle to the second query term. const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(fef::MatchData &md) override; }; /** * Implements the blueprint for proximity. */ -class ReverseProximityBlueprint : public search::fef::Blueprint { +class ReverseProximityBlueprint : public fef::Blueprint { public: - /** - * Constructs a blueprint for reverse proximity. - */ ReverseProximityBlueprint(); - - // Inherit doc from Blueprint. - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &env, - search::fef::IDumpFeatureVisitor &visitor) const override; - - // Inherit doc from Blueprint. - virtual search::fef::Blueprint::UP createInstance() const override; - - // Inherit doc from Blueprint. - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().indexField(search::fef::ParameterCollection::ANY).number().number(); + void visitDumpFeatures(const fef::IIndexEnvironment &env, fef::IDumpFeatureVisitor &visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::ANY).number().number(); } - - // Inherit doc from Blueprint. - virtual bool setup(const search::fef::IIndexEnvironment & env, - const search::fef::ParameterList & params) override; - - // Inherit doc from Blueprint. - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; - + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; private: ReverseProximityConfig _config; }; diff --git a/searchlib/src/vespa/searchlib/features/subqueries_feature.h b/searchlib/src/vespa/searchlib/features/subqueries_feature.h index 217548b3e96..0c882a9b24a 100644 --- a/searchlib/src/vespa/searchlib/features/subqueries_feature.h +++ b/searchlib/src/vespa/searchlib/features/subqueries_feature.h @@ -8,37 +8,33 @@ namespace search { namespace features { -class SubqueriesExecutor : public search::fef::FeatureExecutor { - std::vector<search::fef::TermFieldHandle> _handles; - const fef::MatchData *_md; - - virtual void handle_bind_match_data(fef::MatchData &md) override; +class SubqueriesExecutor : public fef::FeatureExecutor { + std::vector<fef::TermFieldHandle> _handles; + const fef::MatchData *_md; + void handle_bind_match_data(fef::MatchData &md) override; public: - SubqueriesExecutor(const search::fef::IQueryEnvironment &env, - uint32_t fieldId); - virtual void execute(uint32_t docId) override; + SubqueriesExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); + void execute(uint32_t docId) override; }; //----------------------------------------------------------------------------- -class SubqueriesBlueprint : public search::fef::Blueprint +class SubqueriesBlueprint : public fef::Blueprint { private: - const search::fef::FieldInfo *_field; + const fef::FieldInfo *_field; public: SubqueriesBlueprint() : Blueprint("subqueries"), _field(nullptr) {} - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &, - search::fef::IDumpFeatureVisitor &) const override {} - virtual search::fef::Blueprint::UP createInstance() const override { + void visitDumpFeatures(const fef::IIndexEnvironment &, fef::IDumpFeatureVisitor &) const override {} + fef::Blueprint::UP createInstance() const override { return Blueprint::UP(new SubqueriesBlueprint); } - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().field(); + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().field(); } - virtual bool setup(const search::fef::IIndexEnvironment &env, - const search::fef::ParameterList ¶ms) override; - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment &env, const fef::ParameterList ¶ms) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; } // namespace features diff --git a/searchlib/src/vespa/searchlib/features/tensor_from_attribute_executor.h b/searchlib/src/vespa/searchlib/features/tensor_from_attribute_executor.h index eba2a9f44ae..4f368a9e188 100644 --- a/searchlib/src/vespa/searchlib/features/tensor_from_attribute_executor.h +++ b/searchlib/src/vespa/searchlib/features/tensor_from_attribute_executor.h @@ -34,7 +34,7 @@ public: { _attrBuffer.allocate(_attribute->getMaxValueCount()); } - virtual void execute(uint32_t docId) override; + void execute(uint32_t docId) override; }; template <typename WeightedBufferType> diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h index ef3d83de98d..6c574aa90b4 100644 --- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h +++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h @@ -16,16 +16,14 @@ namespace features { **/ class TermFieldMdExecutor : public fef::FeatureExecutor { - typedef std::pair<search::fef::TermFieldHandle, query::Weight> Element; + typedef std::pair<fef::TermFieldHandle, query::Weight> Element; std::vector<Element> _terms; const fef::MatchData *_md; - virtual void execute(uint32_t docId) override; - virtual void handle_bind_match_data(fef::MatchData &md) override; - + void execute(uint32_t docId) override; + void handle_bind_match_data(fef::MatchData &md) override; public: - TermFieldMdExecutor(const search::fef::IQueryEnvironment &env, - uint32_t fieldId); + TermFieldMdExecutor(const fef::IQueryEnvironment &env, uint32_t fieldId); }; @@ -33,31 +31,18 @@ public: * Implements the blueprint for the term field md executor. **/ class TermFieldMdBlueprint : public fef::Blueprint { - const search::fef::FieldInfo * _field; + const fef::FieldInfo * _field; public: TermFieldMdBlueprint(); - - // Inherit doc from Blueprint. - virtual void visitDumpFeatures(const fef::IIndexEnvironment & env, - fef::IDumpFeatureVisitor & visitor) const override; - - // Inherit doc from Blueprint. - virtual fef::Blueprint::UP createInstance() const override; - - // Inherit doc from Blueprint. - virtual fef::ParameterDescriptions getDescriptions() const override { + void visitDumpFeatures(const fef::IIndexEnvironment & env, fef::IDumpFeatureVisitor & visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::ParameterDescriptions getDescriptions() const override { return fef::ParameterDescriptions().desc().field(); } - - // Inherit doc from Blueprint. - virtual bool setup(const fef::IIndexEnvironment & env, - const fef::ParameterList & params) override; - - // Inherit doc from Blueprint. - virtual fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment & env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment & env, vespalib::Stash &stash) const override; }; } // namespace features } // namespace search - diff --git a/searchlib/src/vespa/searchlib/features/termdistancefeature.h b/searchlib/src/vespa/searchlib/features/termdistancefeature.h index ed79a51c199..609ea6d1b63 100644 --- a/searchlib/src/vespa/searchlib/features/termdistancefeature.h +++ b/searchlib/src/vespa/searchlib/features/termdistancefeature.h @@ -23,7 +23,7 @@ struct TermDistanceParams { /** * Implements the executor for calculating min term distance (forward and reverse). **/ -class TermDistanceExecutor : public search::fef::FeatureExecutor +class TermDistanceExecutor : public fef::FeatureExecutor { private: const TermDistanceParams & _params; @@ -34,44 +34,31 @@ private: virtual void handle_bind_match_data(fef::MatchData &md) override; public: - TermDistanceExecutor(const search::fef::IQueryEnvironment & env, + TermDistanceExecutor(const fef::IQueryEnvironment & env, const TermDistanceParams & params); - virtual void execute(uint32_t docId) override; - bool valid() const; + void execute(uint32_t docId) override; + bool valid() const; }; /** * Implements the blueprint for the term distance executor. **/ -class TermDistanceBlueprint : public search::fef::Blueprint { +class TermDistanceBlueprint : public fef::Blueprint { private: TermDistanceParams _params; public: TermDistanceBlueprint(); - - // Inherit doc from Blueprint. - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment & env, - search::fef::IDumpFeatureVisitor & visitor) const override; - - // Inherit doc from Blueprint. - virtual search::fef::Blueprint::UP createInstance() const override; - - // Inherit doc from Blueprint. - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().indexField(search::fef::ParameterCollection::ANY).number().number(); + void visitDumpFeatures(const fef::IIndexEnvironment & env, fef::IDumpFeatureVisitor & visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::ANY).number().number(); } - - // Inherit doc from Blueprint. - virtual bool setup(const search::fef::IIndexEnvironment & env, - const search::fef::ParameterList & params) override; - - // Inherit doc from Blueprint. - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; } // namespace features } // namespace search - diff --git a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h index 26faaae4b93..c7ef3d672fd 100644 --- a/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h +++ b/searchlib/src/vespa/searchlib/features/termeditdistancefeature.h @@ -1,8 +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 <string> -#include <vector> #include <vespa/searchlib/fef/blueprint.h> #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/common/feature.h> @@ -45,14 +43,14 @@ struct TermEditDistanceConfig { /** * Implements the executor for the term edit distance calculator. */ -class TermEditDistanceExecutor : public search::fef::FeatureExecutor { +class TermEditDistanceExecutor : public fef::FeatureExecutor { public: /** * Constructs a new executor for the term edit distance calculator. * * @param config The config for this executor. */ - TermEditDistanceExecutor(const search::fef::IQueryEnvironment &env, + TermEditDistanceExecutor(const fef::IQueryEnvironment &env, const TermEditDistanceConfig &config); @@ -80,7 +78,7 @@ public: * * @param docid local document id to be evaluated */ - virtual void execute(uint32_t docId) override; + void execute(uint32_t docId) override; private: /** @@ -91,11 +89,11 @@ private: */ void logRow(const std::vector<TedCell> &row, size_t numCols); - virtual void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(fef::MatchData &md) override; private: const TermEditDistanceConfig &_config; // The config for this executor. - std::vector<search::fef::TermFieldHandle> _fieldHandles; // The handles of all query terms. + std::vector<fef::TermFieldHandle> _fieldHandles; // The handles of all query terms. std::vector<feature_t> _termWeights; // The weights of all query terms. std::vector<TedCell> _prevRow; // Optimized representation of the cost table. std::vector<TedCell> _thisRow; // @@ -105,26 +103,17 @@ private: /** * Implements the blueprint for the term edit distance calculator. */ -class TermEditDistanceBlueprint : public search::fef::Blueprint { +class TermEditDistanceBlueprint : public fef::Blueprint { public: /** * Constructs a new blueprint for the term edit distance calculator. */ TermEditDistanceBlueprint(); - - // Inherit doc from Blueprint. - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &env, - search::fef::IDumpFeatureVisitor &visitor) const override; - - // Inherit doc from Blueprint. - virtual search::fef::Blueprint::UP createInstance() const override; - - // Inherit doc from Blueprint. - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; - - // Inherit doc from Blueprint. - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().indexField(search::fef::ParameterCollection::SINGLE); + void visitDumpFeatures(const fef::IIndexEnvironment &env, fef::IDumpFeatureVisitor &visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::SINGLE); } /** @@ -143,12 +132,10 @@ public: * @param params A list of the parameters mentioned above. * @return Whether or not setup was possible. */ - virtual bool setup(const search::fef::IIndexEnvironment & env, - const search::fef::ParameterList & params) override; + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; private: TermEditDistanceConfig _config; // The config for this blueprint. }; }} - diff --git a/searchlib/src/vespa/searchlib/features/termfeature.h b/searchlib/src/vespa/searchlib/features/termfeature.h index cb4b92dfc11..cd42333f44b 100644 --- a/searchlib/src/vespa/searchlib/features/termfeature.h +++ b/searchlib/src/vespa/searchlib/features/termfeature.h @@ -1,8 +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 <string> -#include <vector> #include <vespa/searchlib/fef/blueprint.h> #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/common/feature.h> @@ -13,7 +11,7 @@ namespace features { /** * Implements the executor for term feature. */ -class TermExecutor : public search::fef::FeatureExecutor { +class TermExecutor : public fef::FeatureExecutor { public: /** * Constructs an executor for term feature. @@ -21,48 +19,32 @@ public: * @param env The query environment. * @param termId The id of the query term to evaluate. */ - TermExecutor(const search::fef::IQueryEnvironment &env, - uint32_t termId); - virtual void execute(uint32_t docId) override; + TermExecutor(const fef::IQueryEnvironment &env, uint32_t termId); + void execute(uint32_t docId) override; private: - const search::fef::ITermData *_termData; - feature_t _connectedness; - feature_t _significance; + const fef::ITermData *_termData; + feature_t _connectedness; + feature_t _significance; }; /** * Implements the blueprint for term feature. */ -class TermBlueprint : public search::fef::Blueprint { +class TermBlueprint : public fef::Blueprint { public: - /** - * Constructs a blueprint for term feature. - */ TermBlueprint(); - // Inherit doc from Blueprint. - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &env, - search::fef::IDumpFeatureVisitor &visitor) const override; - - // Inherit doc from Blueprint. - virtual search::fef::Blueprint::UP createInstance() const override; - - // Inherit doc from Blueprint. - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().number(); + void visitDumpFeatures(const fef::IIndexEnvironment &env, fef::IDumpFeatureVisitor &visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().number(); } - - // Inherit doc from Blueprint. - virtual bool setup(const search::fef::IIndexEnvironment & env, - const search::fef::ParameterList & params) override; - - // Inherit doc from Blueprint. - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; private: uint32_t _termId; }; }} - diff --git a/searchlib/src/vespa/searchlib/features/terminfofeature.h b/searchlib/src/vespa/searchlib/features/terminfofeature.h index 7f1d8b8a6e2..962b35fc936 100644 --- a/searchlib/src/vespa/searchlib/features/terminfofeature.h +++ b/searchlib/src/vespa/searchlib/features/terminfofeature.h @@ -2,30 +2,26 @@ #pragma once -#include <string> -#include <vector> #include <vespa/searchlib/fef/blueprint.h> #include <vespa/searchlib/fef/featureexecutor.h> namespace search { namespace features { -class TermInfoBlueprint : public search::fef::Blueprint +class TermInfoBlueprint : public fef::Blueprint { private: uint32_t _termIdx; public: TermInfoBlueprint(); - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &indexEnv, - search::fef::IDumpFeatureVisitor &visitor) const override; - virtual search::fef::Blueprint::UP createInstance() const override { return search::fef::Blueprint::UP(new TermInfoBlueprint()); } - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().number(); + void visitDumpFeatures(const fef::IIndexEnvironment &indexEnv, fef::IDumpFeatureVisitor &visitor) const override; + fef::Blueprint::UP createInstance() const override { return fef::Blueprint::UP(new TermInfoBlueprint()); } + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().number(); } - virtual bool setup(const search::fef::IIndexEnvironment & env, - const search::fef::ParameterList & params) override; - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &queryEnv, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &queryEnv, vespalib::Stash &stash) const override; }; } // namespace features diff --git a/searchlib/src/vespa/searchlib/features/text_similarity_feature.h b/searchlib/src/vespa/searchlib/features/text_similarity_feature.h index 084d1dd4b1c..b47a7112a0c 100644 --- a/searchlib/src/vespa/searchlib/features/text_similarity_feature.h +++ b/searchlib/src/vespa/searchlib/features/text_similarity_feature.h @@ -2,8 +2,6 @@ #pragma once -#include <string> -#include <vector> #include <vespa/searchlib/fef/fef.h> #include <vespa/vespalib/util/priority_queue.h> @@ -12,7 +10,7 @@ namespace features { //----------------------------------------------------------------------------- -class TextSimilarityExecutor : public search::fef::FeatureExecutor +class TextSimilarityExecutor : public fef::FeatureExecutor { private: std::vector<fef::TermFieldHandle> _handles; @@ -21,11 +19,11 @@ private: struct Item { uint32_t idx; - search::fef::TermFieldMatchData::PositionsIterator pos; - search::fef::TermFieldMatchData::PositionsIterator end; + fef::TermFieldMatchData::PositionsIterator pos; + fef::TermFieldMatchData::PositionsIterator end; Item(uint32_t idx_in, - search::fef::TermFieldMatchData::PositionsIterator pos_in, - search::fef::TermFieldMatchData::PositionsIterator end_in) + fef::TermFieldMatchData::PositionsIterator pos_in, + fef::TermFieldMatchData::PositionsIterator end_in) : idx(idx_in), pos(pos_in), end(end_in) {} bool operator<(const Item &other) const { return (pos->getPosition() == other.pos->getPosition()) @@ -37,17 +35,17 @@ private: vespalib::PriorityQueue<Item> _queue; const fef::MatchData *_md; - virtual void handle_bind_match_data(fef::MatchData &md) override; + void handle_bind_match_data(fef::MatchData &md) override; public: - TextSimilarityExecutor(const search::fef::IQueryEnvironment &env, uint32_t field_id); - virtual bool isPure() override { return _handles.empty(); } - virtual void execute(uint32_t docId) override; + TextSimilarityExecutor(const fef::IQueryEnvironment &env, uint32_t field_id); + bool isPure() override { return _handles.empty(); } + void execute(uint32_t docId) override; }; //----------------------------------------------------------------------------- -class TextSimilarityBlueprint : public search::fef::Blueprint +class TextSimilarityBlueprint : public fef::Blueprint { private: static const vespalib::string score_output; @@ -60,15 +58,13 @@ private: public: TextSimilarityBlueprint(); - virtual void visitDumpFeatures(const search::fef::IIndexEnvironment &env, - search::fef::IDumpFeatureVisitor &visitor) const override; - virtual search::fef::Blueprint::UP createInstance() const override; - virtual search::fef::ParameterDescriptions getDescriptions() const override { - return search::fef::ParameterDescriptions().desc().indexField(search::fef::ParameterCollection::SINGLE); + void visitDumpFeatures(const fef::IIndexEnvironment &env, fef::IDumpFeatureVisitor &visitor) const override; + fef::Blueprint::UP createInstance() const override; + fef::ParameterDescriptions getDescriptions() const override { + return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::SINGLE); } - virtual bool setup(const search::fef::IIndexEnvironment &env, - const search::fef::ParameterList ¶ms) override; - virtual search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; + bool setup(const fef::IIndexEnvironment &env, const fef::ParameterList ¶ms) override; + fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; //----------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h index 8130c35dc2c..3d99b55f414 100644 --- a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h +++ b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h @@ -113,30 +113,30 @@ public: void illegalVisit() {} - virtual void visit(search::query::And &) override { illegalVisit(); } - virtual void visit(search::query::AndNot &) override { illegalVisit(); } - virtual void visit(search::query::Equiv &) override { illegalVisit(); } - virtual void visit(search::query::Near &) override { illegalVisit(); } - virtual void visit(search::query::ONear &) override { illegalVisit(); } - virtual void visit(search::query::Or &) override { illegalVisit(); } - virtual void visit(search::query::Rank &) override { illegalVisit(); } - virtual void visit(search::query::WeakAnd &) override { illegalVisit(); } - - virtual void visit(search::query::Phrase &n) override { + void visit(search::query::And &) override { illegalVisit(); } + void visit(search::query::AndNot &) override { illegalVisit(); } + void visit(search::query::Equiv &) override { illegalVisit(); } + void visit(search::query::Near &) override { illegalVisit(); } + void visit(search::query::ONear &) override { illegalVisit(); } + void visit(search::query::Or &) override { illegalVisit(); } + void visit(search::query::Rank &) override { illegalVisit(); } + void visit(search::query::WeakAnd &) override { illegalVisit(); } + + void visit(search::query::Phrase &n) override { visitPhrase(n); } - virtual void visit(search::query::WeightedSetTerm &n) override { visitWeightedSetTerm(n); } - virtual void visit(search::query::DotProduct &n) override { visitDotProduct(n); } - virtual void visit(search::query::WandTerm &n) override { visitWandTerm(n); } - - virtual void visit(search::query::NumberTerm &n) override = 0; - virtual void visit(search::query::LocationTerm &n) override = 0; - virtual void visit(search::query::PrefixTerm &n) override = 0; - virtual void visit(search::query::RangeTerm &n) override = 0; - virtual void visit(search::query::StringTerm &n) override = 0; - virtual void visit(search::query::SubstringTerm &n) override = 0; - virtual void visit(search::query::SuffixTerm &n) override = 0; - virtual void visit(search::query::RegExpTerm &n) override = 0; + void visit(search::query::WeightedSetTerm &n) override { visitWeightedSetTerm(n); } + void visit(search::query::DotProduct &n) override { visitDotProduct(n); } + void visit(search::query::WandTerm &n) override { visitWandTerm(n); } + + void visit(search::query::NumberTerm &n) override = 0; + void visit(search::query::LocationTerm &n) override = 0; + void visit(search::query::PrefixTerm &n) override = 0; + void visit(search::query::RangeTerm &n) override = 0; + void visit(search::query::StringTerm &n) override = 0; + void visit(search::query::SubstringTerm &n) override = 0; + void visit(search::query::SuffixTerm &n) override = 0; + void visit(search::query::RegExpTerm &n) override = 0; }; } // namespace search::queryeval diff --git a/searchlib/src/vespa/searchlib/queryeval/equivsearch.cpp b/searchlib/src/vespa/searchlib/queryeval/equivsearch.cpp index 6732f37482d..974d7fd1ca5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equivsearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/equivsearch.cpp @@ -1,9 +1,6 @@ // 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 "equivsearch.h" -#include <vespa/vespalib/objects/visit.h> -#include <vespa/searchlib/fef/termmatchdatamerger.h> namespace search { namespace queryeval { @@ -17,7 +14,7 @@ private: bool _valid; protected: - virtual void doUnpack(uint32_t docid) override; + void doUnpack(uint32_t docid) override; public: /** diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_search.h b/searchlib/src/vespa/searchlib/queryeval/fake_search.h index 3ba3d2cf439..020f045f49d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/fake_search.h @@ -34,12 +34,11 @@ public: { assert(_tfmda.size() == 1); } - virtual void doSeek(uint32_t docid) override; - virtual void doUnpack(uint32_t docid) override; - virtual const PostingInfo *getPostingInfo() const override { return _result.postingInfo(); } - virtual void visitMembers(vespalib::ObjectVisitor &visitor) const override; + void doSeek(uint32_t docid) override; + void doUnpack(uint32_t docid) override; + const PostingInfo *getPostingInfo() const override { return _result.postingInfo(); } + void visitMembers(vespalib::ObjectVisitor &visitor) const override; }; } // namespace queryeval } // namespace search - diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.cpp index 9e7e7ed6c9a..6aadb33c035 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.cpp @@ -54,15 +54,15 @@ public: template <class TermNode> void visitTerm(TermNode &n); - virtual void visit(NumberTerm &n) override { visitTerm(n); } - virtual void visit(LocationTerm &n) override { visitTerm(n); } - virtual void visit(PrefixTerm &n) override { visitTerm(n); } - virtual void visit(RangeTerm &n) override { visitTerm(n); } - virtual void visit(StringTerm &n) override { visitTerm(n); } - virtual void visit(SubstringTerm &n) override { visitTerm(n); } - virtual void visit(SuffixTerm &n) override { visitTerm(n); } - virtual void visit(PredicateQuery &n) override { visitTerm(n); } - virtual void visit(RegExpTerm &n) override { visitTerm(n); } + void visit(NumberTerm &n) override { visitTerm(n); } + void visit(LocationTerm &n) override { visitTerm(n); } + void visit(PrefixTerm &n) override { visitTerm(n); } + void visit(RangeTerm &n) override { visitTerm(n); } + void visit(StringTerm &n) override { visitTerm(n); } + void visit(SubstringTerm &n) override { visitTerm(n); } + void visit(SuffixTerm &n) override { visitTerm(n); } + void visit(PredicateQuery &n) override { visitTerm(n); } + void visit(RegExpTerm &n) override { visitTerm(n); } }; template <class Map> diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h index 34b6e250797..822cf439ad6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h +++ b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h @@ -55,12 +55,11 @@ public: const vespalib::string &term, const FakeResult &result); - // inherited from Searchable using Searchable::createBlueprint; - virtual Blueprint::UP createBlueprint(const IRequestContext & requestContext, - const FieldSpec &field, - const search::query::Node &term) override; - virtual ~FakeSearchable(); + Blueprint::UP createBlueprint(const IRequestContext & requestContext, + const FieldSpec &field, + const search::query::Node &term) override; + ~FakeSearchable(); }; } // namespace search::queryeval diff --git a/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp b/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp index 9a91bf6e2b8..95615c8b923 100644 --- a/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp @@ -1,15 +1,9 @@ // 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(".get_weight_from_node"); - #include "get_weight_from_node.h" #include <vespa/searchlib/query/tree/intermediatenodes.h> -#include <vespa/searchlib/query/tree/node.h> #include <vespa/searchlib/query/tree/simplequery.h> #include <vespa/searchlib/query/tree/templatetermvisitor.h> -#include <vespa/searchlib/query/tree/termnodes.h> using search::query::Node; using search::query::SimpleQueryNodeTypes; @@ -31,7 +25,7 @@ struct WeightExtractor : public TemplateTermVisitor<WeightExtractor, } // Treat Equiv nodes as terms. - virtual void visit(search::query::Equiv &n) override { visitTerm(n); } + void visit(search::query::Equiv &n) override { visitTerm(n); } }; } // namespace search::queryeval::<unnamed> diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp index 64776b99f16..65b1257b105 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp @@ -542,7 +542,7 @@ class FindSource : public Blueprint::IPredicate { public: FindSource(uint32_t sourceId) : _sourceId(sourceId) { } - virtual bool check(const Blueprint & bp) const override { return bp.getSourceId() == _sourceId; } + bool check(const Blueprint & bp) const override { return bp.getSourceId() == _sourceId; } private: uint32_t _sourceId; }; diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h index d910499b463..c0b3c9a9ff6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h @@ -81,15 +81,14 @@ public: vespalib::string toString() const { return _str; } - // Overrides ObjectVisitor - virtual void openStruct(const vespalib::string &name, const vespalib::string &type) override; - virtual void closeStruct() override; - virtual void visitBool(const vespalib::string &name, bool value) override; - virtual void visitInt(const vespalib::string &name, int64_t value) override; - virtual void visitFloat(const vespalib::string &name, double value) override; - virtual void visitString(const vespalib::string &name, const vespalib::string &value) override; - virtual void visitNull(const vespalib::string &name) override; - virtual void visitNotImplemented() override; + void openStruct(const vespalib::string &name, const vespalib::string &type) override; + void closeStruct() override; + void visitBool(const vespalib::string &name, bool value) override; + void visitInt(const vespalib::string &name, int64_t value) override; + void visitFloat(const vespalib::string &name, double value) override; + void visitString(const vespalib::string &name, const vespalib::string &value) override; + void visitNull(const vespalib::string &name) override; + void visitNotImplemented() override; }; typedef std::unique_ptr<MonitoringSearchIterator> UP; @@ -115,7 +114,7 @@ public: SearchIterator::initRange(_search->getDocId()+1, _search->getEndId()); } Trinary is_strict() const override { return _search->is_strict(); } - virtual const PostingInfo *getPostingInfo() const override; + const PostingInfo *getPostingInfo() const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; const SearchIterator &getIterator() const { return *_search; } diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h index 6ba631abb16..96dd497fb7c 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h @@ -77,10 +77,8 @@ public: uint32_t window, bool strict); - virtual void visitMembers(vespalib::ObjectVisitor &visitor) const override; - - // Inherit doc from SearchIterator. - virtual void doSeek(uint32_t docId) override; + void visitMembers(vespalib::ObjectVisitor &visitor) const override; + void doSeek(uint32_t docId) override; }; /** @@ -97,9 +95,7 @@ private: }; std::vector<Matcher> _matchers; - - // Inherit doc from NearSearchBase. - virtual bool match(uint32_t docId) override; + bool match(uint32_t docId) override; public: /** @@ -131,9 +127,7 @@ private: }; std::vector<Matcher> _matchers; - - // Inherit doc from NearSearchBase. - virtual bool match(uint32_t docId) override; + bool match(uint32_t docId) override; public: /** diff --git a/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h b/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h index 5a62cc5dedb..b1fae7c0bb2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h @@ -2,8 +2,8 @@ #pragma once -#include <vespa/vespalib/objects/visit.h> #include "orsearch.h" +#include <vespa/vespalib/objects/visit.h> namespace search { namespace queryeval { @@ -52,16 +52,16 @@ public: _unpacker(unpacker) { } private: - virtual void onRemove(size_t index) override { + void onRemove(size_t index) override { _unpacker.onRemove(index); } - virtual void onInsert(size_t index) override { + void onInsert(size_t index) override { _unpacker.onInsert(index); } - virtual void doUnpack(uint32_t docid) override { + void doUnpack(uint32_t docid) override { _unpacker.unpack(docid, *this); } - virtual bool needUnpack(size_t index) const override { + bool needUnpack(size_t index) const override { return _unpacker.needUnpack(index); } Unpack _unpacker; @@ -70,4 +70,3 @@ private: } // namespace queryeval } // namespace search - diff --git a/searchlib/src/vespa/searchlib/queryeval/orsearch.h b/searchlib/src/vespa/searchlib/queryeval/orsearch.h index e75776d7161..bd3d0aa5e3f 100644 --- a/searchlib/src/vespa/searchlib/queryeval/orsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/orsearch.h @@ -27,9 +27,9 @@ public: protected: OrSearch(const Children & children) : MultiSearch(children) { } private: - virtual bool isOr() const override { return true; } + + bool isOr() const override { return true; } }; } // namespace queryeval } // namespace search - diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h index 2d1f09da9c8..46765f40fd6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h @@ -48,10 +48,9 @@ public: const fef::TermFieldMatchDataArray &childMatch, std::vector<uint32_t> eval_order, fef::TermFieldMatchData &tmd, bool strict); - - virtual void doSeek(uint32_t doc_id) override; - virtual void doUnpack(uint32_t doc_id) override; - virtual void visitMembers(vespalib::ObjectVisitor &visitor) const override; + void doSeek(uint32_t doc_id) override; + void doUnpack(uint32_t doc_id) override; + void visitMembers(vespalib::ObjectVisitor &visitor) const override; SimplePhraseSearch & setDoom(const vespalib::Doom * doom) { _doom = doom; return *this; } }; diff --git a/searchlib/src/vespa/searchlib/queryeval/simplesearch.h b/searchlib/src/vespa/searchlib/queryeval/simplesearch.h index 50553541e98..53c22deb237 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simplesearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/simplesearch.h @@ -23,8 +23,8 @@ private: SimpleSearch &operator=(const SimpleSearch &); protected: - virtual void doSeek(uint32_t docid) override; - virtual void doUnpack(uint32_t docid) override; + void doSeek(uint32_t docid) override; + void doUnpack(uint32_t docid) override; public: SimpleSearch(const SimpleResult &result); @@ -32,8 +32,8 @@ public: _tag = t; return *this; } - virtual void visitMembers(vespalib::ObjectVisitor &visitor) const override; - virtual ~SimpleSearch(); + void visitMembers(vespalib::ObjectVisitor &visitor) const override; + ~SimpleSearch(); }; } // namespace queryeval diff --git a/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp b/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp index 07a7763d626..8aa015dc752 100644 --- a/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp @@ -78,29 +78,28 @@ struct TermAsStringVisitor : public QueryVisitor { isSet = false; } - virtual void visit(And &) override { illegalVisit(); } - virtual void visit(AndNot &) override { illegalVisit(); } - virtual void visit(Equiv &) override { illegalVisit(); } - virtual void visit(Near &) override { illegalVisit(); } - virtual void visit(ONear &) override { illegalVisit(); } - virtual void visit(Or &) override { illegalVisit(); } - virtual void visit(Phrase &) override { illegalVisit(); } - virtual void visit(Rank &) override { illegalVisit(); } - virtual void visit(WeakAnd &) override { illegalVisit(); } - virtual void visit(WeightedSetTerm &) override { illegalVisit(); } - virtual void visit(DotProduct &) override { illegalVisit(); } - virtual void visit(WandTerm &) override { illegalVisit(); } - - virtual void visit(NumberTerm &n) override { visitTerm(n); } - virtual void visit(LocationTerm &n) override { visitTerm(n); } - virtual void visit(PrefixTerm &n) override { visitTerm(n); } - virtual void visit(RangeTerm &n) override { visitTerm(n); } - virtual void visit(StringTerm &n) override { visitTerm(n); } - virtual void visit(SubstringTerm &n) override { visitTerm(n); } - virtual void visit(SuffixTerm &n) override { visitTerm(n); } - virtual void visit(RegExpTerm &n) override { visitTerm(n); } - - virtual void visit(PredicateQuery &) override { illegalVisit(); } + void visit(And &) override {illegalVisit(); } + void visit(AndNot &) override {illegalVisit(); } + void visit(Equiv &) override {illegalVisit(); } + void visit(Near &) override {illegalVisit(); } + void visit(ONear &) override {illegalVisit(); } + void visit(Or &) override {illegalVisit(); } + void visit(Phrase &) override {illegalVisit(); } + void visit(Rank &) override {illegalVisit(); } + void visit(WeakAnd &) override {illegalVisit(); } + void visit(WeightedSetTerm &) override {illegalVisit(); } + void visit(DotProduct &) override {illegalVisit(); } + void visit(WandTerm &) override {illegalVisit(); } + + void visit(NumberTerm &n) override {visitTerm(n); } + void visit(LocationTerm &n) override {visitTerm(n); } + void visit(PrefixTerm &n) override {visitTerm(n); } + void visit(RangeTerm &n) override {visitTerm(n); } + void visit(StringTerm &n) override {visitTerm(n); } + void visit(SubstringTerm &n) override {visitTerm(n); } + void visit(SuffixTerm &n) override {visitTerm(n); } + void visit(RegExpTerm &n) override {visitTerm(n); } + void visit(PredicateQuery &) override {illegalVisit(); } }; } // namespace diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h index 1c3059913e8..3c1aba30bf7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h @@ -15,7 +15,7 @@ struct WeakAndSearch : SearchIterator { virtual wand::score_t get_max_score(size_t idx) const = 0; virtual const Terms &getTerms() const = 0; virtual uint32_t getN() const = 0; - virtual void visitMembers(vespalib::ObjectVisitor &visitor) const override; + void visitMembers(vespalib::ObjectVisitor &visitor) const override; static SearchIterator *createArrayWand(const Terms &terms, uint32_t n, bool strict); static SearchIterator *createHeapWand(const Terms &terms, uint32_t n, bool strict); static SearchIterator *create(const Terms &terms, uint32_t n, bool strict); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp index c1f9baedb17..2b7b5398e1e 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp @@ -788,11 +788,8 @@ class FakeEGCompr64SkipFilterOcc : public FakeEGCompr64FilterOcc { public: FakeEGCompr64SkipFilterOcc(const FakeWord &fw); - - ~FakeEGCompr64SkipFilterOcc(void); - - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + ~FakeEGCompr64SkipFilterOcc(); + search::queryeval::SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.h index fb49bd22cda..a2bd1ab1038 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.h @@ -4,11 +4,9 @@ #include "fakeword.h" #include "fakeposting.h" -namespace search -{ +namespace search { -namespace fakedata -{ +namespace fakedata { /* * Old compressed posocc format. @@ -40,70 +38,30 @@ private: void setup(const FakeWord &fw); template <bool bigEndian> - void - setupT(const FakeWord &fw); + void setupT(const FakeWord &fw); public: FakeEGCompr64FilterOcc(const FakeWord &fw); - - FakeEGCompr64FilterOcc(const FakeWord &fw, - bool bigEndian, - const char *nameSuffix); - - ~FakeEGCompr64FilterOcc(void); - - static void - forceLink(void); - - /* - * Size of posting list, in bits. - */ - size_t bitSize(void) const override; - - virtual bool hasWordPositions(void) const override; - - /* - * Size of posting skip list, in bits. - */ - size_t skipBitSize(void) const override; - size_t l1SkipBitSize(void) const override; - size_t l2SkipBitSize(void) const override; - size_t l3SkipBitSize(void) const override; - size_t l4SkipBitSize(void) const override; - - /* - * Single posting list performance, without feature unpack. - */ - virtual int - lowLevelSinglePostingScan(void) const override; - - /* - * Single posting list performance, with feature unpack. - */ - virtual int - lowLevelSinglePostingScanUnpack(void) const override; - - /* - * Two posting lists performance (same format) without feature unpack. - */ - virtual int - lowLevelAndPairPostingScan(const FakePosting &rhs) const override; - - /* - * Two posting lists performance (same format) with feature unpack. - */ - virtual int - lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; - - - /* - * Iterator factory, for current query evaluation framework. - */ - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + FakeEGCompr64FilterOcc(const FakeWord &fw, bool bigEndian, const char *nameSuffix); + + ~FakeEGCompr64FilterOcc(); + + static void forceLink(); + + size_t bitSize() const override; + bool hasWordPositions() const override; + size_t skipBitSize() const override; + size_t l1SkipBitSize() const override; + size_t l2SkipBitSize() const override; + size_t l3SkipBitSize() const override; + size_t l4SkipBitSize() const override; + int lowLevelSinglePostingScan() const override; + int lowLevelSinglePostingScanUnpack() const override; + int lowLevelAndPairPostingScan(const FakePosting &rhs) const override; + int lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; + queryeval::SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; } // namespace fakedata } // namespace search - diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.h index 427110383fd..2946f15c539 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.h @@ -4,11 +4,9 @@ #include "fakeword.h" #include "fakeposting.h" -namespace search -{ +namespace search { -namespace fakedata -{ +namespace fakedata { /* * Old posocc format. @@ -22,51 +20,19 @@ private: public: FakeFilterOcc(const FakeWord &fakeword); - ~FakeFilterOcc(void); - - static void - forceLink(void); - - /* - * Size of posting list, in bits. - */ - size_t bitSize(void) const override; - - virtual bool hasWordPositions(void) const override; + ~FakeFilterOcc(); - /* - * Single posting list performance, without feature unpack. - */ - virtual int - lowLevelSinglePostingScan(void) const override; + static void forceLink(); - /* - * Single posting list performance, with feature unpack. - */ - virtual int - lowLevelSinglePostingScanUnpack(void) const override; - - /* - * Two posting lists performance (same format) without feature unpack. - */ - virtual int - lowLevelAndPairPostingScan(const FakePosting &rhs) const override; - - /* - * Two posting lists performance (same format) with feature unpack. - */ - virtual int - lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; - - - /* - * Iterator factory, for current query evaluation framework. - */ - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + size_t bitSize() const override; + bool hasWordPositions(void) const override; + int lowLevelSinglePostingScan(void) const override; + int lowLevelSinglePostingScanUnpack(void) const override; + int lowLevelAndPairPostingScan(const FakePosting &rhs) const override; + int lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; + queryeval::SearchIterator * createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; } // namespace fakedata } // namespace search - diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h index c4f3e27c4ac..efbe44b605e 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h @@ -9,11 +9,8 @@ #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/posocccompression.h> -namespace search -{ - -namespace fakedata -{ +namespace search { +namespace fakedata { class FakeMemTreeOccMgr : public FakeWord::RandomizedWriter { @@ -38,12 +35,9 @@ public: PostingIdx(NodeAllocator &allocator) : _tree(), _iterator(_tree.getRoot(), allocator) - { - } + {} - void - clear(void) - { + void clear() { _tree.clear(_iterator.getAllocator()); _iterator = _tree.begin(_iterator.getAllocator()); } @@ -64,8 +58,7 @@ public: _features(), _removal(true), _seq(0) - { - } + {} PendingOp(uint32_t wordIdx, uint32_t docId, EntryRef features) : _wordIdx(wordIdx), @@ -73,42 +66,15 @@ public: _features(features), _removal(false), _seq(0) - { - } + {} - void - setSeq(uint32_t seq) - { - _seq = seq; - } - - uint32_t - getWordIdx(void) const - { - return _wordIdx; - } + void setSeq(uint32_t seq) { _seq = seq; } + uint32_t getWordIdx(void) const { return _wordIdx; } + uint32_t getDocId(void) const { return _docId; } + EntryRef getFeatureRef(void) const { return _features; } + bool getRemove() const { return _removal; } - uint32_t - getDocId(void) const - { - return _docId; - } - - EntryRef - getFeatureRef(void) const - { - return _features; - } - - bool - getRemove(void) const - { - return _removal; - } - - bool - operator<(const PendingOp &rhs) const - { + bool operator<(const PendingOp &rhs) const { if (_wordIdx != rhs._wordIdx) return _wordIdx < rhs._wordIdx; if (_docId != rhs._docId) @@ -125,42 +91,19 @@ public: FeatureStore _featureStore; FakeMemTreeOccMgr(const Schema &schema); - - virtual - ~FakeMemTreeOccMgr(void); - - void - freeze(void); - - void - transferHoldLists(void); - - void - incGeneration(void); - - void - trimHoldLists(void); - - void - sync(void); - - virtual void - add(uint32_t wordIdx, index::DocIdAndFeatures &features) override; - - virtual void - remove(uint32_t wordIdx, uint32_t docId) override; - - void - sortUnflushed(void); - - void - flush(void); - - void - compactTrees(void); - - void - finalize(void); + ~FakeMemTreeOccMgr(); + + void freeze(); + void transferHoldLists(); + void incGeneration(); + void trimHoldLists(); + void sync(); + void add(uint32_t wordIdx, index::DocIdAndFeatures &features) override; + void remove(uint32_t wordIdx, uint32_t docId) override; + void sortUnflushed(); + void flush(); + void compactTrees(); + void finalize(); }; @@ -174,7 +117,9 @@ public: FakeMemTreeOccMgr _mgr; FakeMemTreeOccFactory(const Schema &schema); + ~FakeMemTreeOccFactory(); +<<<<<<< HEAD virtual ~FakeMemTreeOccFactory(void); @@ -183,21 +128,20 @@ public: virtual void setup(const std::vector<const FakeWord *> &fws) override; +======= + FakePosting::SP make(const FakeWord &fw) override; + void setup(const std::vector<const FakeWord *> &fws) override; +>>>>>>> Use override }; class FakeMemTreeOcc2Factory : public FakeMemTreeOccFactory { public: FakeMemTreeOcc2Factory(const Schema &schema); + ~FakeMemTreeOcc2Factory(); - virtual - ~FakeMemTreeOcc2Factory(void); - - virtual FakePosting::SP - make(const FakeWord &fw) override; - - virtual void - setup(const std::vector<const FakeWord *> &fws) override; + FakePosting::SP make(const FakeWord &fw) override; + void setup(const std::vector<const FakeWord *> &fws) override; }; @@ -235,51 +179,18 @@ public: const FakeMemTreeOccMgr &mgr, const char *suffix); - ~FakeMemTreeOcc(void); - - static void - forceLink(void); - - /* - * Size of posting list, in bits. - */ - size_t bitSize(void) const override; - - virtual bool hasWordPositions(void) const override; - - /* - * Single posting list performance, without feature unpack. - */ - virtual int - lowLevelSinglePostingScan(void) const override; + ~FakeMemTreeOcc(); - /* - * Single posting list performance, with feature unpack. - */ - virtual int - lowLevelSinglePostingScanUnpack(void) const override; - - /* - * Two posting lists performance (same format) without feature unpack. - */ - virtual int - lowLevelAndPairPostingScan(const FakePosting &rhs) const override; - - /* - * Two posting lists performance (same format) with feature unpack. - */ - virtual int - lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; - - - /* - * Iterator factory, for current query evaluation framework. - */ - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + static void forceLink(); + size_t bitSize() const override; + bool hasWordPositions() const override; + int lowLevelSinglePostingScan() const override; + int lowLevelSinglePostingScanUnpack() const override; + int lowLevelAndPairPostingScan(const FakePosting &rhs) const override; + int lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; + queryeval::SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; } // namespace fakedata } // namespace search - diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.h index 5e146b5705a..f88df381d92 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.h @@ -4,11 +4,9 @@ #include "fakeword.h" #include "fakeposting.h" -namespace search -{ +namespace search { -namespace fakedata -{ +namespace fakedata { /* * YST style compression of docid list. @@ -22,52 +20,19 @@ private: size_t _bitSize; public: FakeZcbFilterOcc(const FakeWord &fw); + ~FakeZcbFilterOcc(); - ~FakeZcbFilterOcc(void); - - static void - forceLink(void); - - /* - * Size of posting list, in bits. - */ - size_t bitSize(void) const override; - - virtual bool hasWordPositions(void) const override; - - /* - * Single posting list performance, without feature unpack. - */ - virtual int - lowLevelSinglePostingScan(void) const override; + static void forceLink(); - /* - * Single posting list performance, with feature unpack. - */ - virtual int - lowLevelSinglePostingScanUnpack(void) const override; - - /* - * Two posting lists performance (same format) without feature unpack. - */ - virtual int - lowLevelAndPairPostingScan(const FakePosting &rhs) const override; - - /* - * Two posting lists performance (same format) with feature unpack. - */ - virtual int - lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; - - - /* - * Iterator factory, for current query evaluation framework. - */ - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + size_t bitSize() const override; + bool hasWordPositions() const override; + int lowLevelSinglePostingScan() const override; + int lowLevelSinglePostingScanUnpack() const override; + int lowLevelAndPairPostingScan(const FakePosting &rhs) const override; + int lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; + queryeval::SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; } // namespace fakedata } // namespace search - diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp index dfd47889513..316b80f9596 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp @@ -1,16 +1,8 @@ // 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(".fakezcfilterocc"); #include "fakezcfilterocc.h" -#include <vespa/searchlib/bitcompression/compression.h> -#include <vespa/searchlib/bitcompression/posocccompression.h> -#include <vespa/searchlib/diskindex/zcposocciterators.h> -#include <vespa/searchlib/index/docidandfeatures.h> -#include <vespa/searchlib/index/postinglistcounts.h> #include "fpfactory.h" - +#include <vespa/searchlib/diskindex/zcposocciterators.h> using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataArray; @@ -26,11 +18,9 @@ using search::bitcompression::FeatureEncodeContext; using search::ComprFileWriteContext; using namespace search::diskindex; -namespace search -{ +namespace search { -namespace fakedata -{ +namespace fakedata { #define L1SKIPSTRIDE 16 @@ -769,10 +759,8 @@ class FakeZcSkipFilterOcc : public FakeZcFilterOcc public: FakeZcSkipFilterOcc(const FakeWord &fw); - ~FakeZcSkipFilterOcc(void); - - virtual SearchIterator * - createIterator(const TermFieldMatchDataArray &matchData) const override; + ~FakeZcSkipFilterOcc(); + SearchIterator *createIterator(const TermFieldMatchDataArray &matchData) const override; }; static FPFactoryInit @@ -1384,7 +1372,9 @@ class FakeEGCompr64PosOcc : public FakeZcFilterOcc { public: FakeEGCompr64PosOcc(const FakeWord &fw); + ~FakeEGCompr64PosOcc(); +<<<<<<< HEAD ~FakeEGCompr64PosOcc(void); void setup(const FakeWord &fw); @@ -1395,6 +1385,12 @@ public: virtual SearchIterator * createIterator(const TermFieldMatchDataArray &matchData) const override; +======= + void setup(const FakeWord &fw); + size_t bitSize() const override; + bool hasWordPositions() const override; + SearchIterator *createIterator(const TermFieldMatchDataArray &matchData) const override; +>>>>>>> Use override }; @@ -1488,7 +1484,7 @@ FakeEGCompr64PosOcc<bigEndian>::setup(const FakeWord &fw) template <bool bigEndian> size_t -FakeEGCompr64PosOcc<bigEndian>::bitSize(void) const +FakeEGCompr64PosOcc<bigEndian>::bitSize() const { return _compressedBits; } @@ -1496,7 +1492,7 @@ FakeEGCompr64PosOcc<bigEndian>::bitSize(void) const template <bool bigEndian> bool -FakeEGCompr64PosOcc<bigEndian>::hasWordPositions(void) const +FakeEGCompr64PosOcc<bigEndian>::hasWordPositions() const { return true; } @@ -1517,9 +1513,11 @@ class FakeEG2Compr64PosOcc : public FakeZcFilterOcc { public: FakeEG2Compr64PosOcc(const FakeWord &fw); + ~FakeEG2Compr64PosOcc(); - ~FakeEG2Compr64PosOcc(void); + void setup(const FakeWord &fw); +<<<<<<< HEAD void setup(const FakeWord &fw); size_t bitSize(void) const override; @@ -1528,6 +1526,11 @@ public: virtual SearchIterator * createIterator(const fef::TermFieldMatchDataArray &matchData) const override; +======= + size_t bitSize() const override; + bool hasWordPositions() const override; + SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; +>>>>>>> Use override }; @@ -1651,6 +1654,7 @@ class FakeZcSkipPosOcc : public FakeZcFilterOcc public: FakeZcSkipPosOcc(const FakeWord &fw); +<<<<<<< HEAD ~FakeZcSkipPosOcc(void); size_t bitSize(void) const override; @@ -1659,6 +1663,13 @@ public: virtual SearchIterator * createIterator(const TermFieldMatchDataArray &matchData) const override; +======= + ~FakeZcSkipPosOcc(); + + size_t bitSize() const override; + bool hasWordPositions() const override; + SearchIterator *createIterator(const TermFieldMatchDataArray &matchData) const override; +>>>>>>> Use override }; @@ -1673,14 +1684,14 @@ FakeZcSkipPosOcc<bigEndian>::FakeZcSkipPosOcc(const FakeWord &fw) template <bool bigEndian> -FakeZcSkipPosOcc<bigEndian>::~FakeZcSkipPosOcc(void) +FakeZcSkipPosOcc<bigEndian>::~FakeZcSkipPosOcc() { } template <bool bigEndian> size_t -FakeZcSkipPosOcc<bigEndian>::bitSize(void) const +FakeZcSkipPosOcc<bigEndian>::bitSize() const { return _compressedBits - _l1SkipSize - _l2SkipSize - _l3SkipSize - _l4SkipSize; @@ -1689,7 +1700,7 @@ FakeZcSkipPosOcc<bigEndian>::bitSize(void) const template <bool bigEndian> bool -FakeZcSkipPosOcc<bigEndian>::hasWordPositions(void) const +FakeZcSkipPosOcc<bigEndian>::hasWordPositions() const { return true; } @@ -1714,7 +1725,9 @@ class FakeZc2SkipPosOcc : public FakeZcFilterOcc search::index::PostingListCounts _counts; public: FakeZc2SkipPosOcc(const FakeWord &fw); + ~FakeZc2SkipPosOcc(); +<<<<<<< HEAD ~FakeZc2SkipPosOcc(void); size_t bitSize(void) const override; @@ -1723,6 +1736,11 @@ public: virtual SearchIterator * createIterator(const TermFieldMatchDataArray &matchData) const override; +======= + size_t bitSize() const override; + bool hasWordPositions() const override; + SearchIterator *createIterator(const TermFieldMatchDataArray &matchData) const override; +>>>>>>> Use override }; @@ -1737,14 +1755,14 @@ FakeZc2SkipPosOcc<bigEndian>::FakeZc2SkipPosOcc(const FakeWord &fw) template <bool bigEndian> -FakeZc2SkipPosOcc<bigEndian>::~FakeZc2SkipPosOcc(void) +FakeZc2SkipPosOcc<bigEndian>::~FakeZc2SkipPosOcc() { } template <bool bigEndian> size_t -FakeZc2SkipPosOcc<bigEndian>::bitSize(void) const +FakeZc2SkipPosOcc<bigEndian>::bitSize() const { return _compressedBits - _l1SkipSize - _l2SkipSize - _l3SkipSize - _l4SkipSize; @@ -1753,7 +1771,7 @@ FakeZc2SkipPosOcc<bigEndian>::bitSize(void) const template <bool bigEndian> bool -FakeZc2SkipPosOcc<bigEndian>::hasWordPositions(void) const +FakeZc2SkipPosOcc<bigEndian>::hasWordPositions() const { return true; } diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.h index 65ac3ead5d1..5d81e37001e 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.h @@ -1,17 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once - #include "fakeword.h" #include "fakeposting.h" #include <vespa/searchlib/bitcompression/compression.h> #include <vespa/searchlib/bitcompression/posocccompression.h> -namespace search -{ +namespace search { -namespace fakedata -{ +namespace fakedata { /* * YST style compression of docid list. @@ -38,70 +35,29 @@ protected: void setup(const FakeWord &fw, bool doFeatures, bool dynamicK); template <bool bigEndian> - void - setupT(const FakeWord &fw, bool doFeatures, bool dynamicK); + void setupT(const FakeWord &fw, bool doFeatures, bool dynamicK); public: FakeZcFilterOcc(const FakeWord &fw); - - FakeZcFilterOcc(const FakeWord &fw, - bool bigEndian, - const char *nameSuffix); - - ~FakeZcFilterOcc(void); - - static void - forceLink(void); - - /* - * Size of posting list, in bits. - */ - size_t bitSize(void) const override; - - virtual bool hasWordPositions(void) const override; - - /* - * Size of posting skip list, in bits. - */ - size_t skipBitSize(void) const override; - size_t l1SkipBitSize(void) const override; - size_t l2SkipBitSize(void) const override; - size_t l3SkipBitSize(void) const override; - size_t l4SkipBitSize(void) const override; - - /* - * Single posting list performance, without feature unpack. - */ - virtual int - lowLevelSinglePostingScan(void) const override; - - /* - * Single posting list performance, with feature unpack. - */ - virtual int - lowLevelSinglePostingScanUnpack(void) const override; - - /* - * Two posting lists performance (same format) without feature unpack. - */ - virtual int - lowLevelAndPairPostingScan(const FakePosting &rhs) const override; - - /* - * Two posting lists performance (same format) with feature unpack. - */ - virtual int - lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; - - - /* - * Iterator factory, for current query evaluation framework. - */ - virtual search::queryeval::SearchIterator * - createIterator(const fef::TermFieldMatchDataArray &matchData) const override; + FakeZcFilterOcc(const FakeWord &fw, bool bigEndian, const char *nameSuffix); + ~FakeZcFilterOcc(); + + static void forceLink(); + + size_t bitSize() const override; + bool hasWordPositions() const override; + size_t skipBitSize() const override; + size_t l1SkipBitSize() const override; + size_t l2SkipBitSize() const override; + size_t l3SkipBitSize() const override; + size_t l4SkipBitSize() const override; + int lowLevelSinglePostingScan() const override; + int lowLevelSinglePostingScanUnpack() const override; + int lowLevelAndPairPostingScan(const FakePosting &rhs) const override; + int lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const override; + queryeval::SearchIterator *createIterator(const fef::TermFieldMatchDataArray &matchData) const override; }; } // namespace fakedata } // namespace search - diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h index bf02e815da8..aa67eb1b933 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h @@ -41,9 +41,7 @@ public: (void) schema; } - virtual FakePosting::SP - make(const FakeWord &fw) override - { + FakePosting::SP make(const FakeWord &fw) override { return FakePosting::SP(new P(fw)); } }; diff --git a/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.h b/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.h index a41b6c27c5d..9eccdbaff0e 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.h +++ b/searchlib/src/vespa/searchlib/transactionlog/nosyncproxy.h @@ -4,24 +4,16 @@ #include "syncproxy.h" -namespace search -{ -namespace transactionlog -{ +namespace search { +namespace transactionlog { class NoSyncProxy : public SyncProxy { public: - NoSyncProxy(void); - - virtual - ~NoSyncProxy(void); - - virtual void - sync(SerialNum syncTo) override; + NoSyncProxy(); + ~NoSyncProxy(); + void sync(SerialNum syncTo) override; }; } - } - diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogclient.h b/searchlib/src/vespa/searchlib/transactionlog/translogclient.h index e219f5cffbc..802933b7d81 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogclient.h +++ b/searchlib/src/vespa/searchlib/transactionlog/translogclient.h @@ -66,10 +66,10 @@ public: Subscriber(const vespalib::string & domain, TransLogClient & tlc, Callback & callBack); bool subscribe(const SerialNum & from); - virtual ~Subscriber(); - virtual RPC::Result visit(const Packet & packet) override { return _callback.receive(packet); } - virtual void inSync() override { _callback.inSync(); } - virtual void eof() override { _callback.eof(); } + ~Subscriber(); + RPC::Result visit(const Packet & packet) override { return _callback.receive(packet); } + void inSync() override { _callback.inSync(); } + void eof() override { _callback.eof(); } private: Callback & _callback; }; diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h index 8e64b17ecb4..105a6ca643b 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserver.h +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserver.h @@ -41,7 +41,7 @@ public: uint64_t setDomainPartSize(); DomainStats getDomainStats() const; - virtual void commit(const vespalib::string & domainName, const Packet & packet) override; + void commit(const vespalib::string & domainName, const Packet & packet) override; class Session @@ -56,8 +56,8 @@ public: }; private: - virtual bool onStop() override; - virtual void run() override; + bool onStop() override; + void run() override; void exportRPC(FRT_Supervisor & supervisor); void relayToThreadRPC(FRT_RPCRequest *req); diff --git a/searchlib/src/vespa/searchlib/util/rand48.h b/searchlib/src/vespa/searchlib/util/rand48.h index d8bfa683f15..6d27d179a74 100644 --- a/searchlib/src/vespa/searchlib/util/rand48.h +++ b/searchlib/src/vespa/searchlib/util/rand48.h @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS #pragma once +#include <cstdlib> +#include <cstdint> namespace search { @@ -26,14 +26,14 @@ public: { srand48(0x1234abcd); }; - void iterate(void) { + void iterate() { _state = (UINT64_C(0x5DEECE66D) * _state + 0xb) & UINT64_C(0xFFFFFFFFFFFF); } /* * Return value from 0 to 2^31 - 1 */ - long lrand48(void) { + long lrand48() { iterate(); return static_cast<long>(_state >> 17); } diff --git a/slobrok/src/apps/check_slobrok/check_slobrok.cpp b/slobrok/src/apps/check_slobrok/check_slobrok.cpp index 8e2a91c100d..9d588eab39f 100644 --- a/slobrok/src/apps/check_slobrok/check_slobrok.cpp +++ b/slobrok/src/apps/check_slobrok/check_slobrok.cpp @@ -1,14 +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("check_slobrok"); #include <vespa/fnet/frt/frt.h> - +#include <vespa/fastos/app.h> #include <string> #include <sstream> +#include <vespa/log/log.h> +LOG_SETUP("check_slobrok"); class Slobrok_Checker : public FastOS_Application { @@ -25,10 +23,9 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; - Slobrok_Checker::~Slobrok_Checker() { LOG_ASSERT(_supervisor == NULL); diff --git a/slobrok/src/apps/sbcmd/sbcmd.cpp b/slobrok/src/apps/sbcmd/sbcmd.cpp index 60a3dfc779b..a96c4609137 100644 --- a/slobrok/src/apps/sbcmd/sbcmd.cpp +++ b/slobrok/src/apps/sbcmd/sbcmd.cpp @@ -1,14 +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("sb-cmd"); #include <vespa/fnet/frt/frt.h> - +#include <vespa/fastos/app.h> #include <string> #include <sstream> +#include <vespa/log/log.h> +LOG_SETUP("sb-cmd"); class Slobrok_CMD : public FastOS_Application { @@ -25,17 +23,15 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; - Slobrok_CMD::~Slobrok_CMD() { LOG_ASSERT(_supervisor == NULL); LOG_ASSERT(_target == NULL); } - int Slobrok_CMD::usage() { diff --git a/slobrok/src/tests/mirrorapi/match_test.cpp b/slobrok/src/tests/mirrorapi/match_test.cpp index d9ebcfd6f29..94900daa202 100644 --- a/slobrok/src/tests/mirrorapi/match_test.cpp +++ b/slobrok/src/tests/mirrorapi/match_test.cpp @@ -4,12 +4,11 @@ class MatchTester : public slobrok::api::IMirrorAPI { - virtual SpecList lookup(const std::string &) const override { + SpecList lookup(const std::string &) const override { return SpecList(); } - virtual uint32_t updates() const override { return 0; } - - virtual bool ready() const override { return true; } + uint32_t updates() const override { return 0; } + bool ready() const override { return true; } const std::string name; diff --git a/slobrok/src/tests/oldapi/mirror.h b/slobrok/src/tests/oldapi/mirror.h index 1f0db564cae..b83392dec5e 100644 --- a/slobrok/src/tests/oldapi/mirror.h +++ b/slobrok/src/tests/oldapi/mirror.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifndef Old_MIRROR_H -#define Old_MIRROR_H +#pragma once #include <vespa/fnet/frt/frt.h> #include <vespa/vespalib/util/gencnt.h> @@ -86,10 +85,7 @@ public: **/ ~MirrorOld(); - // Inherit doc from IMirrorOld. SpecList lookup(const std::string & pattern) const override; - - // Inherit doc from IMirrorOld. uint32_t updates() const override { return _updates.getAsInt(); } /** @@ -110,10 +106,7 @@ private: MirrorOld(const MirrorOld &); MirrorOld &operator=(const MirrorOld &); - /** from FNET_Task, polls slobrok **/ void PerformTask() override; - - /** from FRT_IRequestWait **/ void RequestDone(FRT_RPCRequest *req) override; FRT_Supervisor &_orb; @@ -131,5 +124,3 @@ private: } // namespace api } // namespace slobrok - -#endif diff --git a/slobrok/src/tests/startsome/rpc_info.cpp b/slobrok/src/tests/startsome/rpc_info.cpp index 76b578d4f88..be5418ff1a8 100644 --- a/slobrok/src/tests/startsome/rpc_info.cpp +++ b/slobrok/src/tests/startsome/rpc_info.cpp @@ -1,8 +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("rpc_info"); + #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> class RPCInfo : public FastOS_Application { diff --git a/slobrok/src/tests/startsome/tstdst.cpp b/slobrok/src/tests/startsome/tstdst.cpp index e2f6ae070b3..7d3fcef8695 100644 --- a/slobrok/src/tests/startsome/tstdst.cpp +++ b/slobrok/src/tests/startsome/tstdst.cpp @@ -1,15 +1,11 @@ // 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("testrpcserver"); #include <vespa/vespalib/util/host_name.h> -#include <vespa/fnet/fnet.h> #include <vespa/fnet/frt/frt.h> +#include <vespa/fastos/app.h> -#include <vector> -#include <string> -#include <sstream> +#include <vespa/log/log.h> +LOG_SETUP("testrpcserver"); class FNET_Transport; class FNET_Scheduler; diff --git a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp b/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp index ce21c918219..75092255f9e 100644 --- a/staging_vespalib/src/tests/array/allocinarray_benchmark.cpp +++ b/staging_vespalib/src/tests/array/allocinarray_benchmark.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/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/rusage.h> #include <vespa/vespalib/util/optimized.h> diff --git a/staging_vespalib/src/tests/array/allocinarray_test.cpp b/staging_vespalib/src/tests/array/allocinarray_test.cpp index 059fff91cec..c68cc3fa874 100644 --- a/staging_vespalib/src/tests/array/allocinarray_test.cpp +++ b/staging_vespalib/src/tests/array/allocinarray_test.cpp @@ -1,14 +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/log/log.h> #include <vespa/vespalib/util/array.h> #include <vespa/vespalib/util/allocinarray.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/testkit/testapp.h> #include <deque> -LOG_SETUP("array_test"); - using namespace vespalib; class Test : public TestApp diff --git a/staging_vespalib/src/tests/array/sort_benchmark.cpp b/staging_vespalib/src/tests/array/sort_benchmark.cpp index 9e2b286e864..29f1560e426 100644 --- a/staging_vespalib/src/tests/array/sort_benchmark.cpp +++ b/staging_vespalib/src/tests/array/sort_benchmark.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/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/rusage.h> #include <vespa/vespalib/util/array.hpp> diff --git a/staging_vespalib/src/tests/benchmark/testbase.h b/staging_vespalib/src/tests/benchmark/testbase.h index 02f11e21cac..beb485e6dab 100644 --- a/staging_vespalib/src/tests/benchmark/testbase.h +++ b/staging_vespalib/src/tests/benchmark/testbase.h @@ -45,7 +45,7 @@ public: private: typedef std::vector<int> Vector; size_t callByReference(const Vector & values) const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ParamByValueVectorInt : public Benchmark @@ -55,7 +55,7 @@ public: private: typedef std::vector<int> Vector; size_t callByValue(Vector values) const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ParamByReferenceVectorString : public Benchmark @@ -65,7 +65,7 @@ public: private: typedef std::vector<std::string> Vector; size_t callByReference(const Vector & values) const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ParamByValueVectorString : public Benchmark @@ -75,7 +75,7 @@ public: private: typedef std::vector<std::string> Vector; size_t callByValue(Vector values) const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ReturnByReferenceVectorString : public Benchmark @@ -85,7 +85,7 @@ public: private: typedef std::vector<std::string> Vector; const Vector & returnByReference(Vector & values) const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ReturnByValueVectorString : public Benchmark @@ -95,7 +95,7 @@ public: private: typedef std::vector<std::string> Vector; Vector returnByValue() const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class ReturnByValueMultiVectorString : public Benchmark @@ -105,7 +105,7 @@ public: private: typedef std::vector<std::string> Vector; Vector returnByValue() const __attribute__((noinline)); - virtual size_t onRun() override; + size_t onRun() override; }; class CreateVespalibString : public Benchmark @@ -113,7 +113,7 @@ class CreateVespalibString : public Benchmark public: DECLARE_BENCHMARK(CreateVespalibString); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockSystem : public Benchmark @@ -121,7 +121,7 @@ class ClockSystem : public Benchmark public: DECLARE_BENCHMARK(ClockSystem); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockREALTIME : public Benchmark @@ -129,7 +129,7 @@ class ClockREALTIME : public Benchmark public: DECLARE_BENCHMARK(ClockREALTIME); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockMONOTONIC : public Benchmark @@ -137,7 +137,7 @@ class ClockMONOTONIC : public Benchmark public: DECLARE_BENCHMARK(ClockMONOTONIC); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockMONOTONIC_RAW : public Benchmark @@ -146,7 +146,7 @@ public: DECLARE_BENCHMARK(ClockMONOTONIC_RAW); ClockMONOTONIC_RAW(); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockPROCESS_CPUTIME_ID : public Benchmark @@ -154,7 +154,7 @@ class ClockPROCESS_CPUTIME_ID : public Benchmark public: DECLARE_BENCHMARK(ClockPROCESS_CPUTIME_ID); private: - virtual size_t onRun() override; + size_t onRun() override; }; class ClockTHREAD_CPUTIME_ID : public Benchmark @@ -162,8 +162,7 @@ class ClockTHREAD_CPUTIME_ID : public Benchmark public: DECLARE_BENCHMARK(ClockTHREAD_CPUTIME_ID); private: - virtual size_t onRun() override; + size_t onRun() override; }; } - diff --git a/staging_vespalib/src/tests/bits/bits_test.cpp b/staging_vespalib/src/tests/bits/bits_test.cpp index f7b3ef1bf84..783651db366 100644 --- a/staging_vespalib/src/tests/bits/bits_test.cpp +++ b/staging_vespalib/src/tests/bits/bits_test.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("bits_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/bits.h> #include <boost/crc.hpp> diff --git a/staging_vespalib/src/tests/clock/clock_test.cpp b/staging_vespalib/src/tests/clock/clock_test.cpp index 025d8766a29..58a01a520b6 100644 --- a/staging_vespalib/src/tests/clock/clock_test.cpp +++ b/staging_vespalib/src/tests/clock/clock_test.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("sharedptr_test"); -#include <vespa/vespalib/util/clock.h> + #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/clock.h> using vespalib::Clock; using fastos::TimeStamp; diff --git a/staging_vespalib/src/tests/crc/crc_test.cpp b/staging_vespalib/src/tests/crc/crc_test.cpp index 6a5a0779d8b..df8ac89db62 100644 --- a/staging_vespalib/src/tests/crc/crc_test.cpp +++ b/staging_vespalib/src/tests/crc/crc_test.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("crc_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/crc.h> #include <boost/crc.hpp> diff --git a/staging_vespalib/src/tests/databuffer/databuffer_test.cpp b/staging_vespalib/src/tests/databuffer/databuffer_test.cpp index 7ec83e58b5c..1a242e8eec4 100644 --- a/staging_vespalib/src/tests/databuffer/databuffer_test.cpp +++ b/staging_vespalib/src/tests/databuffer/databuffer_test.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("databuffer_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/data/databuffer.h> diff --git a/staging_vespalib/src/tests/fileheader/fileheader_test.cpp b/staging_vespalib/src/tests/fileheader/fileheader_test.cpp index f2a6c8402ee..55ca571cdac 100644 --- a/staging_vespalib/src/tests/fileheader/fileheader_test.cpp +++ b/staging_vespalib/src/tests/fileheader/fileheader_test.cpp @@ -1,10 +1,8 @@ // 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("fileheader_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/data/fileheader.h> +#include <vespa/fastos/file.h> #include <iostream> using namespace vespalib; @@ -29,15 +27,9 @@ private: void testRewriteErrors(); void testLayout(); - void - testReadSize(bool mapped); - - void - testReadSizeErrors(bool mapped); - - bool - testReadSizeError(DataBuffer &buf, const std::string &expected, - bool mapped); + void testReadSize(bool mapped); + void testReadSizeErrors(bool mapped); + bool testReadSizeError(DataBuffer &buf, const std::string &expected, bool mapped); public: int Main() override { diff --git a/staging_vespalib/src/tests/floatingpointtype/floatingpointtypetest.cpp b/staging_vespalib/src/tests/floatingpointtype/floatingpointtypetest.cpp index 98b6804ac8e..19e52dbe885 100644 --- a/staging_vespalib/src/tests/floatingpointtype/floatingpointtypetest.cpp +++ b/staging_vespalib/src/tests/floatingpointtype/floatingpointtypetest.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 first to make sure it includes all it need. -#include <vespa/fastos/fastos.h> -#include <vespa/vespalib/objects/floatingpointtype.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/objects/floatingpointtype.h> class Test : public vespalib::TestApp { diff --git a/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp b/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp index aaf3f383c33..1ba9c912344 100644 --- a/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp +++ b/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.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("guard_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/growablebytebuffer.h> diff --git a/staging_vespalib/src/tests/librarypool/librarypool_test.cpp b/staging_vespalib/src/tests/librarypool/librarypool_test.cpp index 665dbca8a86..87e04d3ffbd 100644 --- a/staging_vespalib/src/tests/librarypool/librarypool_test.cpp +++ b/staging_vespalib/src/tests/librarypool/librarypool_test.cpp @@ -1,10 +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/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/librarypool.h> #include <vespa/vespalib/util/exceptions.h> -#include <vespa/log/log.h> -LOG_SETUP("librarypool_test"); using namespace vespalib; diff --git a/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp b/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp index 5430e8c1465..5a1c0d7fb32 100644 --- a/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp +++ b/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp @@ -1,11 +1,8 @@ // 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("data_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/data/memorydatastore.h> #include <vespa/vespalib/stllike/asciistream.h> -#include <vector> using namespace vespalib; diff --git a/staging_vespalib/src/tests/objectdump/objectdump.cpp b/staging_vespalib/src/tests/objectdump/objectdump.cpp index 671e89b5011..3bdbe2401e4 100644 --- a/staging_vespalib/src/tests/objectdump/objectdump.cpp +++ b/staging_vespalib/src/tests/objectdump/objectdump.cpp @@ -1,5 +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/vespalib/testkit/testapp.h> #include <vespa/vespalib/objects/identifiable.h> #include <vespa/vespalib/objects/visit.hpp> @@ -22,7 +22,7 @@ IMPLEMENT_IDENTIFIABLE(Base, vespalib::Identifiable); struct Baz : public Base { DECLARE_IDENTIFIABLE(Baz); - virtual Baz *clone() const override { return new Baz(*this); } + Baz *clone() const override { return new Baz(*this); } }; IMPLEMENT_IDENTIFIABLE(Baz, Base); @@ -45,9 +45,9 @@ struct Bar : public Base _int32(-4), _uint32(4), _int64(-8), _uint64(8), _float(2.5), _double(2.75), _string("bla bla") {} - virtual Bar *clone() const override { return new Bar(*this); } + Bar *clone() const override { return new Bar(*this); } - virtual void visitMembers(ObjectVisitor &v) const override { + void visitMembers(ObjectVisitor &v) const override { visit(v, "_bool", _bool); visit(v, "_int8", _int8); visit(v, "_uint8", _uint8); diff --git a/staging_vespalib/src/tests/objects/identifiable_test.cpp b/staging_vespalib/src/tests/objects/identifiable_test.cpp index c60f33b9b55..5ef48b6e779 100644 --- a/staging_vespalib/src/tests/objects/identifiable_test.cpp +++ b/staging_vespalib/src/tests/objects/identifiable_test.cpp @@ -1,5 +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/vespalib/testkit/testapp.h> #include <vespa/vespalib/objects/identifiable.hpp> #include <vespa/vespalib/objects/namedobject.h> @@ -40,7 +40,7 @@ class A : public Abstract public: DECLARE_IDENTIFIABLE(A); A() { } - virtual void someAbstractVirtualMethod() override { } + void someAbstractVirtualMethod() override { }; }; class B : public A diff --git a/staging_vespalib/src/tests/objectselection/objectselection.cpp b/staging_vespalib/src/tests/objectselection/objectselection.cpp index 27ecb068231..db696230082 100644 --- a/staging_vespalib/src/tests/objectselection/objectselection.cpp +++ b/staging_vespalib/src/tests/objectselection/objectselection.cpp @@ -1,5 +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/vespalib/testkit/testapp.h> #include <vespa/vespalib/objects/identifiable.hpp> #include <vespa/vespalib/objects/objectpredicate.h> @@ -17,7 +17,7 @@ struct Foo : public Identifiable DECLARE_IDENTIFIABLE(Foo); virtual Foo *clone() const { return new Foo(*this); } - virtual void selectMembers(const ObjectPredicate &p, ObjectOperation &o) override { + void selectMembers(const ObjectPredicate &p, ObjectOperation &o) override { for (uint32_t i = 0; i < nodes.size(); ++i) { nodes[i]->select(p, o); } @@ -32,7 +32,7 @@ struct Bar : public Foo DECLARE_IDENTIFIABLE(Bar); Bar() : value(0) {} Bar(int v) { value = v; } - virtual Bar *clone() const override { return new Bar(*this); } + Bar *clone() const override { return new Bar(*this); } }; IMPLEMENT_IDENTIFIABLE(Bar, Identifiable); @@ -40,7 +40,7 @@ struct ObjectType : public ObjectPredicate { uint32_t cid; ObjectType(uint32_t id) : cid(id) {} - virtual bool check(const Identifiable &obj) const override { + bool check(const Identifiable &obj) const override { return (obj.getClass().id() == cid); } }; @@ -48,7 +48,7 @@ struct ObjectType : public ObjectPredicate struct ObjectCollect : public ObjectOperation { std::vector<Identifiable*> nodes; - virtual void execute(Identifiable &obj) override { + void execute(Identifiable &obj) override { nodes.push_back(&obj); } }; diff --git a/staging_vespalib/src/tests/polymorphicarray/polymorphicarray_test.cpp b/staging_vespalib/src/tests/polymorphicarray/polymorphicarray_test.cpp index affb7287674..a1c8a31729c 100644 --- a/staging_vespalib/src/tests/polymorphicarray/polymorphicarray_test.cpp +++ b/staging_vespalib/src/tests/polymorphicarray/polymorphicarray_test.cpp @@ -1,5 +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/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/polymorphicarrays.h> @@ -112,7 +112,7 @@ class Factory : public ComplexArrayT<A>::Factory { public: A * create() override { return new Complex(); } - virtual Factory * clone() const override { return new Factory(*this); } + Factory * clone() const override { return new Factory(*this); } }; TEST("require that complex arrays conforms") { diff --git a/staging_vespalib/src/tests/programoptions/programoptions_test.cpp b/staging_vespalib/src/tests/programoptions/programoptions_test.cpp index 881954bfa3f..709f8a3b723 100644 --- a/staging_vespalib/src/tests/programoptions/programoptions_test.cpp +++ b/staging_vespalib/src/tests/programoptions/programoptions_test.cpp @@ -1,14 +1,9 @@ // 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/util/programoptions.h> #include <vespa/vespalib/util/programoptions_testutils.h> - #include <iostream> -#include <vespa/log/log.h> -#include <vespa/vespalib/testkit/testapp.h> - -LOG_SETUP("programoptions_test"); namespace vespalib { diff --git a/staging_vespalib/src/tests/rusage/rusage_test.cpp b/staging_vespalib/src/tests/rusage/rusage_test.cpp index 0367ab8c374..5094bd8b5c9 100644 --- a/staging_vespalib/src/tests/rusage/rusage_test.cpp +++ b/staging_vespalib/src/tests/rusage/rusage_test.cpp @@ -1,8 +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 <stddef.h> -#include <vespa/log/log.h> -LOG_SETUP("alloc_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/rusage.h> diff --git a/staging_vespalib/src/tests/state_server/state_server_test.cpp b/staging_vespalib/src/tests/state_server/state_server_test.cpp index f572dbcd8e1..e15a3826669 100644 --- a/staging_vespalib/src/tests/state_server/state_server_test.cpp +++ b/staging_vespalib/src/tests/state_server/state_server_test.cpp @@ -1,5 +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/vespalib/testkit/test_kit.h> #include <vespa/vespalib/net/state_server.h> #include <vespa/vespalib/net/simple_health_producer.h> @@ -52,10 +52,8 @@ vespalib::string getFull(int port, const vespalib::string &path) { return getPag struct DummyHandler : JsonGetHandler { vespalib::string result; DummyHandler(const vespalib::string &result_in) : result(result_in) {} - virtual vespalib::string get(const vespalib::string &, - const vespalib::string &, - const std::map<vespalib::string,vespalib::string> &) - const override + vespalib::string get(const vespalib::string &, const vespalib::string &, + const std::map<vespalib::string,vespalib::string> &) const override { return result; } @@ -113,10 +111,8 @@ TEST_FFFF("require that handler is selected based on longest matching url prefix } struct EchoHost : JsonGetHandler { - virtual vespalib::string get(const vespalib::string &host, - const vespalib::string &, - const std::map<vespalib::string,vespalib::string> &) - const override + vespalib::string get(const vespalib::string &host, const vespalib::string &, + const std::map<vespalib::string,vespalib::string> &) const override { return "[\"" + host + "\"]"; } @@ -316,11 +312,11 @@ TEST_FFFFF("require that custom handlers can be added to the state server", } struct EchoConsumer : MetricsProducer { - virtual vespalib::string getMetrics(const vespalib::string &consumer) override { + vespalib::string getMetrics(const vespalib::string &consumer) override { return "[\"" + consumer + "\"]"; } - virtual vespalib::string getTotalMetrics(const vespalib::string &consumer) override { - return "[\"" + consumer + "\"]"; + vespalib::string getTotalMetrics(const vespalib::string &consumer) override { + return "[\"" + consumer + "\"]"; } }; diff --git a/staging_vespalib/src/tests/timer/timer_test.cpp b/staging_vespalib/src/tests/timer/timer_test.cpp index ad782f4089f..21b60b828cc 100644 --- a/staging_vespalib/src/tests/timer/timer_test.cpp +++ b/staging_vespalib/src/tests/timer/timer_test.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("timer_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/timer.h> #include <vespa/vespalib/util/executor.h> diff --git a/staging_vespalib/src/tests/xmlserializable/xmlserializabletest.cpp b/staging_vespalib/src/tests/xmlserializable/xmlserializabletest.cpp index 1035c021f68..90fcdb8f94f 100644 --- a/staging_vespalib/src/tests/xmlserializable/xmlserializabletest.cpp +++ b/staging_vespalib/src/tests/xmlserializable/xmlserializabletest.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/vespalib/util/xmlserializable.h> - #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/xmlserializable.h> namespace vespalib { diff --git a/storageframework/src/tests/clock/timetest.cpp b/storageframework/src/tests/clock/timetest.cpp index ae07559e095..d0367449fe1 100644 --- a/storageframework/src/tests/clock/timetest.cpp +++ b/storageframework/src/tests/clock/timetest.cpp @@ -10,9 +10,6 @@ namespace defaultimplementation { struct TimeTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} - void testBasics(); void testCreatedFromClock(); void canAssignMicrosecondResolutionTimeToFakeClock(); diff --git a/storageframework/src/tests/memory/memorymanagertest.cpp b/storageframework/src/tests/memory/memorymanagertest.cpp index 885ae86e832..8b1868a6bd4 100644 --- a/storageframework/src/tests/memory/memorymanagertest.cpp +++ b/storageframework/src/tests/memory/memorymanagertest.cpp @@ -155,8 +155,7 @@ MemoryManagerTest::testBasics() struct ReduceI : public framework::ReduceMemoryUsageInterface { framework::MemoryToken::UP _token; - virtual uint64_t reduceMemoryConsumption(const MemoryToken& token, uint64_t reduceBy) override - { + uint64_t reduceMemoryConsumption(const MemoryToken& token, uint64_t reduceBy) override { assert(&token == _token.get()); (void) &token; assert(_token->getSize() >= reduceBy); diff --git a/storageframework/src/tests/memory/memorystatetest.cpp b/storageframework/src/tests/memory/memorystatetest.cpp index 40d102199d6..5a047a5c790 100644 --- a/storageframework/src/tests/memory/memorystatetest.cpp +++ b/storageframework/src/tests/memory/memorystatetest.cpp @@ -2,7 +2,6 @@ #include <vespa/storageframework/defaultimplementation/clock/realclock.h> #include <vespa/storageframework/defaultimplementation/memory/memorystate.h> -#include <vespa/storageframework/generic/memory/memorymanagerinterface.h> #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/util/exceptions.h> @@ -12,8 +11,6 @@ namespace defaultimplementation { struct MemoryStateTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} void testBasics(); @@ -30,15 +27,15 @@ private: std::map<std::string, framework::MemoryAllocationType> _types; public: - virtual void setMaximumMemoryUsage(uint64_t max) override { (void) max; } + void setMaximumMemoryUsage(uint64_t max) override { (void) max; } - virtual const framework::MemoryAllocationType& + const framework::MemoryAllocationType& registerAllocationType(const framework::MemoryAllocationType& type) override { _types[type.getName()] = type; return _types[type.getName()]; } - virtual const framework::MemoryAllocationType& + const framework::MemoryAllocationType& getAllocationType(const std::string& name) const override { std::map<std::string, framework::MemoryAllocationType>::const_iterator iter = _types.find(name); @@ -50,8 +47,7 @@ public: return iter->second; } - virtual std::vector<const MemoryAllocationType*> getAllocationTypes() const override - { + std::vector<const MemoryAllocationType*> getAllocationTypes() const override { std::vector<const MemoryAllocationType*> types; for(std::map<std::string, framework::MemoryAllocationType> ::const_iterator it = _types.begin(); it != _types.end(); ++it) diff --git a/storageframework/src/tests/testrunner.cpp b/storageframework/src/tests/testrunner.cpp index 0d40a0429d9..5baa0f60b6e 100644 --- a/storageframework/src/tests/testrunner.cpp +++ b/storageframework/src/tests/testrunner.cpp @@ -6,7 +6,7 @@ LOG_SETUP("persistencecppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/storageframework/src/tests/thread/taskthreadtest.cpp b/storageframework/src/tests/thread/taskthreadtest.cpp index bca5c81ef01..a6698be3676 100644 --- a/storageframework/src/tests/thread/taskthreadtest.cpp +++ b/storageframework/src/tests/thread/taskthreadtest.cpp @@ -34,7 +34,7 @@ namespace { struct MyThread : public TaskThread<Task> { MyThread(ThreadLock& lock) : TaskThread<Task>(lock) {} - virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { + ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } }; diff --git a/storageframework/src/tests/thread/tickingthreadtest.cpp b/storageframework/src/tests/thread/tickingthreadtest.cpp index c65b809e5da..c9d54fe557a 100644 --- a/storageframework/src/tests/thread/tickingthreadtest.cpp +++ b/storageframework/src/tests/thread/tickingthreadtest.cpp @@ -13,9 +13,6 @@ namespace defaultimplementation { struct TickingThreadTest : public CppUnit::TestFixture { - void setUp() override {} - void tearDown() override {} - void testTicksBeforeWaitBasic(); void testTicksBeforeWaitLiveUpdate(); void testDestroyWithoutStarting(); @@ -62,7 +59,7 @@ struct MyApp : public TickingThread { void start(ThreadPool& p) { _threadPool->start(p); } - virtual ThreadWaitInfo doCriticalTick(ThreadIndex index) override { + ThreadWaitInfo doCriticalTick(ThreadIndex index) override { assert(index < _context.size()); Context& c(_context[index]); if (_doCritOverlapTest) { @@ -74,13 +71,12 @@ struct MyApp : public TickingThread { ++c._critTickCount; return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } - virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex index) override { + ThreadWaitInfo doNonCriticalTick(ThreadIndex index) override { assert(index < _context.size()); Context& c(_context[index]); ++c._nonCritTickCount; return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } - uint64_t getMinCritTick() { uint64_t min = std::numeric_limits<uint64_t>().max(); for (uint32_t i=0; i<_context.size(); ++i) { @@ -314,7 +310,7 @@ struct BroadcastApp : public TickingThread { void start(ThreadPool& p) { _threadPool->start(p); } - virtual ThreadWaitInfo doCriticalTick(ThreadIndex) override { + ThreadWaitInfo doCriticalTick(ThreadIndex) override { if (!_queue.empty()) { for (uint32_t i=0; i<_queue.size(); ++i) { printTaskInfo(_queue[i], "activating"); @@ -325,7 +321,7 @@ struct BroadcastApp : public TickingThread { } return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } - virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { + ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { if (!_active.empty()) { for (uint32_t i=0; i<_active.size(); ++i) { printTaskInfo(_queue[i], "processing"); diff --git a/vbench/src/apps/dumpurl/dumpurl.cpp b/vbench/src/apps/dumpurl/dumpurl.cpp index 706dd061763..44ebc1d2ac2 100644 --- a/vbench/src/apps/dumpurl/dumpurl.cpp +++ b/vbench/src/apps/dumpurl/dumpurl.cpp @@ -1,8 +1,9 @@ // 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 <vbench/http/http_result_handler.h> #include <vbench/http/server_spec.h> #include <vbench/http/http_client.h> +#include <vespa/fastos/app.h> using namespace vbench; @@ -13,14 +14,14 @@ public: }; struct MyHttpHandler : public HttpResultHandler { - virtual void handleHeader(const string &name, const string &value) override { + void handleHeader(const string &name, const string &value) override { fprintf(stderr, "got header: '%s': '%s'\n", name.c_str(), value.c_str()); } - virtual void handleContent(const Memory &data) override { + void handleContent(const Memory &data) override { fprintf(stderr, "got data: %zu bytes\n", data.size); fwrite(data.data, 1, data.size, stdout); } - virtual void handleFailure(const string &reason) override { + void handleFailure(const string &reason) override { fprintf(stderr, "got FAILURE: '%s'\n", reason.c_str()); } }; diff --git a/vbench/src/apps/vbench/vbench.cpp b/vbench/src/apps/vbench/vbench.cpp index 32af3d70c3d..fa6bc91e035 100644 --- a/vbench/src/apps/vbench/vbench.cpp +++ b/vbench/src/apps/vbench/vbench.cpp @@ -1,13 +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/vespalib/util/signalhandler.h> #include <vespa/vespalib/util/programoptions.h> #include <vespa/vespalib/util/sync.h> #include <vespa/vespalib/util/thread.h> #include <vespa/vespalib/util/runnable_pair.h> #include <vbench/vbench/vbench.h> -#include <vespa/vespalib/data/slime/slime.h> -#include <string> #include <iostream> using namespace vbench; @@ -17,7 +14,7 @@ typedef vespalib::SignalHandler SIG; struct NotifyDone : public vespalib::Runnable { vespalib::Gate &done; NotifyDone(vespalib::Gate &d) : done(d) {} - virtual void run() override { + void run() override { done.countDown(); } }; diff --git a/vbench/src/tests/dispatcher/dispatcher_test.cpp b/vbench/src/tests/dispatcher/dispatcher_test.cpp index 284f7c55d8a..0a278508d55 100644 --- a/vbench/src/tests/dispatcher/dispatcher_test.cpp +++ b/vbench/src/tests/dispatcher/dispatcher_test.cpp @@ -7,14 +7,14 @@ using namespace vbench; struct MyHandler : public Handler<int> { int value; MyHandler() : value(-1) {} - virtual void handle(std::unique_ptr<int> v) override { value = (v.get() != 0) ? *v : 0; } + void handle(std::unique_ptr<int> v) override { value = (v.get() != 0) ? *v : 0; } }; struct Fetcher : public vespalib::Runnable { Provider<int> &provider; Handler<int> &handler; Fetcher(Provider<int> &p, Handler<int> &h) : provider(p), handler(h) {} - virtual void run() override { handler.handle(provider.provide()); } + void run() override { handler.handle(provider.provide()); } }; TEST("dispatcher") { diff --git a/vbench/src/tests/handler_thread/handler_thread_test.cpp b/vbench/src/tests/handler_thread/handler_thread_test.cpp index a21bda82b6a..e8816e1cc96 100644 --- a/vbench/src/tests/handler_thread/handler_thread_test.cpp +++ b/vbench/src/tests/handler_thread/handler_thread_test.cpp @@ -6,7 +6,7 @@ using namespace vbench; struct MyHandler : Handler<int> { std::vector<int> values; - virtual void handle(std::unique_ptr<int> value) override { + void handle(std::unique_ptr<int> value) override { values.push_back(*value); vespalib::Thread::sleep(10); // for improved coverage } diff --git a/vbench/src/tests/socket/socket_test.cpp b/vbench/src/tests/socket/socket_test.cpp index 21c410f382e..56499a089b6 100644 --- a/vbench/src/tests/socket/socket_test.cpp +++ b/vbench/src/tests/socket/socket_test.cpp @@ -34,7 +34,7 @@ struct Agent { struct Client : public Agent, public vespalib::Runnable { Client(Stream::UP s) : Agent(std::move(s)) {} - virtual void run() override { + void run() override { TEST_THREAD("client"); write("client-"); read("server-"); @@ -43,7 +43,7 @@ struct Client : public Agent, public vespalib::Runnable { struct Server : public Agent, public vespalib::Runnable { Server(Stream::UP s) : Agent(std::move(s)) {} - virtual void run() override { + void run() override { TEST_THREAD("server"); read("client-"); write("server-"); diff --git a/vbench/src/vbench/core/handler.h b/vbench/src/vbench/core/handler.h index 962e6c09ad7..3959688d949 100644 --- a/vbench/src/vbench/core/handler.h +++ b/vbench/src/vbench/core/handler.h @@ -17,4 +17,3 @@ struct Handler }; } // namespace vbench - diff --git a/vbench/src/vbench/core/input_file_reader.h b/vbench/src/vbench/core/input_file_reader.h index 410f0819d3b..5883faab9aa 100644 --- a/vbench/src/vbench/core/input_file_reader.h +++ b/vbench/src/vbench/core/input_file_reader.h @@ -4,9 +4,9 @@ #include "string.h" #include "taintable.h" +#include "line_reader.h" #include <vespa/vespalib/io/mapped_file_input.h> #include <vespa/vespalib/data/input_reader.h> -#include "line_reader.h" namespace vbench { @@ -34,7 +34,7 @@ public: **/ bool readLine(string &dst); - virtual const Taint &tainted() const override { return _taint; } + const Taint &tainted() const override { return _taint; } }; } // namespace vbench diff --git a/vbench/src/vbench/core/socket.cpp b/vbench/src/vbench/core/socket.cpp index 7306d25cf32..e11acdb864c 100644 --- a/vbench/src/vbench/core/socket.cpp +++ b/vbench/src/vbench/core/socket.cpp @@ -40,6 +40,8 @@ Socket::Socket(const string &host, int port) } } +Socket::~Socket() { } + Memory Socket::obtain() { diff --git a/vbench/src/vbench/core/socket.h b/vbench/src/vbench/core/socket.h index e961994c37a..a447dd4d592 100644 --- a/vbench/src/vbench/core/socket.h +++ b/vbench/src/vbench/core/socket.h @@ -29,12 +29,13 @@ private: public: Socket(vespalib::SocketHandle socket); Socket(const string &host, int port); - virtual bool eof() const override { return _eof; } - virtual Memory obtain() override; - virtual Input &evict(size_t bytes) override; - virtual WritableMemory reserve(size_t bytes) override; - virtual Output &commit(size_t bytes) override; - virtual const Taint &tainted() const override { return _taint; } + ~Socket(); + bool eof() const override { return _eof; } + Memory obtain() override; + Input &evict(size_t bytes) override; + WritableMemory reserve(size_t bytes) override; + Output &commit(size_t bytes) override; + const Taint &tainted() const override { return _taint; } }; struct ServerSocket { @@ -53,4 +54,3 @@ struct ServerSocket { }; } // namespace vbench - diff --git a/vbench/src/vbench/core/string.h b/vbench/src/vbench/core/string.h index 61a2b3b442c..592e63e9cbf 100644 --- a/vbench/src/vbench/core/string.h +++ b/vbench/src/vbench/core/string.h @@ -10,6 +10,8 @@ #include <string> #endif +#include <vector> + namespace vbench { // define which string class to use diff --git a/vbench/src/vbench/core/taintable.cpp b/vbench/src/vbench/core/taintable.cpp index 23e2745999a..34d65513ca7 100644 --- a/vbench/src/vbench/core/taintable.cpp +++ b/vbench/src/vbench/core/taintable.cpp @@ -1,6 +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 "taintable.h" namespace vbench { @@ -9,8 +8,9 @@ namespace { struct Untaintable : Taintable { Taint taint; - virtual const Taint &tainted() const override { return taint; } - virtual ~Untaintable() {} + + const Taint &tainted() const override { return taint; } + ~Untaintable() {} }; Untaintable untaintable; diff --git a/vbench/src/vbench/http/benchmark_headers.cpp b/vbench/src/vbench/http/benchmark_headers.cpp index e4bea82023d..c42af2a79c7 100644 --- a/vbench/src/vbench/http/benchmark_headers.cpp +++ b/vbench/src/vbench/http/benchmark_headers.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 "benchmark_headers.h" #include <map> @@ -77,7 +75,7 @@ BenchmarkHeaders::toString() const struct HeaderToString : benchmark_headers::HeaderTraverser { string &str; HeaderToString(string &s) : str(s) {} - virtual void header(const string &name, double value) override { + void header(const string &name, double value) override { str += strfmt(" %s: %g\n", name.c_str(), value); } } headerToString(str); diff --git a/vbench/src/vbench/http/http_result_handler.h b/vbench/src/vbench/http/http_result_handler.h index 85c230fefb8..18e8955b65e 100644 --- a/vbench/src/vbench/http/http_result_handler.h +++ b/vbench/src/vbench/http/http_result_handler.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once #include <vbench/core/string.h> @@ -23,4 +22,3 @@ struct HttpResultHandler }; } // namespace vbench - diff --git a/vbench/src/vbench/test/request_receptor.h b/vbench/src/vbench/test/request_receptor.h index 2de39e528e4..0692c3735f6 100644 --- a/vbench/src/vbench/test/request_receptor.h +++ b/vbench/src/vbench/test/request_receptor.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once #include <vbench/core/handler.h> @@ -11,7 +10,7 @@ namespace vbench { struct RequestReceptor : public Handler<Request> { Request::UP request; RequestReceptor() : request() {} - virtual void handle(Request::UP req) override; + void handle(Request::UP req) override; }; } // namespace vbench diff --git a/vbench/src/vbench/vbench/analyzer.h b/vbench/src/vbench/vbench/analyzer.h index e1bd8e23919..f206130cc0b 100644 --- a/vbench/src/vbench/vbench/analyzer.h +++ b/vbench/src/vbench/vbench/analyzer.h @@ -1,12 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> -#include <vbench/core/handler.h> - #include "request.h" +#include <vbench/core/handler.h> namespace vbench { @@ -18,4 +15,3 @@ struct Analyzer : public Handler<Request> }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/dropped_tagger.h b/vbench/src/vbench/vbench/dropped_tagger.h index eb64d4b4be4..a3fd7a65b99 100644 --- a/vbench/src/vbench/vbench/dropped_tagger.h +++ b/vbench/src/vbench/vbench/dropped_tagger.h @@ -1,11 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> - #include "request.h" +#include <vbench/core/handler.h> namespace vbench { @@ -19,8 +17,7 @@ private: public: DroppedTagger(Handler<Request> &next); - virtual void handle(Request::UP request) override; + void handle(Request::UP request) override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/generator.h b/vbench/src/vbench/vbench/generator.h index 5eb8e056265..51309eaf9b6 100644 --- a/vbench/src/vbench/vbench/generator.h +++ b/vbench/src/vbench/vbench/generator.h @@ -1,11 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> -#include <vespa/vespalib/util/runnable.h> #include <vbench/core/taintable.h> +#include <vespa/vespalib/util/runnable.h> +#include <memory> namespace vbench { diff --git a/vbench/src/vbench/vbench/ignore_before.h b/vbench/src/vbench/vbench/ignore_before.h index d74a398efd8..a2786a0c340 100644 --- a/vbench/src/vbench/vbench/ignore_before.h +++ b/vbench/src/vbench/vbench/ignore_before.h @@ -1,11 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> #include "request.h" #include "analyzer.h" +#include <vbench/core/handler.h> namespace vbench { @@ -22,9 +21,8 @@ private: public: IgnoreBefore(double time, Handler<Request> &next); - virtual void handle(Request::UP request) override; - virtual void report() override; + void handle(Request::UP request) override; + void report() override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/latency_analyzer.cpp b/vbench/src/vbench/vbench/latency_analyzer.cpp index 32cd6387722..baefa0ab138 100644 --- a/vbench/src/vbench/vbench/latency_analyzer.cpp +++ b/vbench/src/vbench/vbench/latency_analyzer.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 "latency_analyzer.h" #include <cmath> diff --git a/vbench/src/vbench/vbench/latency_analyzer.h b/vbench/src/vbench/vbench/latency_analyzer.h index 499f6f3b991..162fa93a0a3 100644 --- a/vbench/src/vbench/vbench/latency_analyzer.h +++ b/vbench/src/vbench/vbench/latency_analyzer.h @@ -1,11 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> -#include <vbench/core/string.h> -#include "request.h" #include "analyzer.h" namespace vbench { @@ -39,11 +35,10 @@ public: string toString() const; }; LatencyAnalyzer(Handler<Request> &next); - virtual void handle(Request::UP request) override; - virtual void report() override; + void handle(Request::UP request) override; + void report() override; void addLatency(double latency); Stats getStats() const; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/qps_analyzer.h b/vbench/src/vbench/vbench/qps_analyzer.h index 4b4b4997f62..10625a89762 100644 --- a/vbench/src/vbench/vbench/qps_analyzer.h +++ b/vbench/src/vbench/vbench/qps_analyzer.h @@ -1,10 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> -#include "request.h" #include "analyzer.h" namespace vbench { @@ -24,10 +21,9 @@ private: public: QpsAnalyzer(Handler<Request> &next); - virtual void handle(Request::UP request) override; - virtual void report() override; + void handle(Request::UP request) override; + void report() override; void addEndTime(double end); }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/qps_tagger.h b/vbench/src/vbench/vbench/qps_tagger.h index 452ee8fb827..492ae324dc0 100644 --- a/vbench/src/vbench/vbench/qps_tagger.h +++ b/vbench/src/vbench/vbench/qps_tagger.h @@ -1,12 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> - -#include "request.h" #include "tagger.h" +#include "request.h" namespace vbench { @@ -22,8 +19,7 @@ private: public: QpsTagger(double qps, Handler<Request> &next); - virtual void handle(Request::UP request) override; + void handle(Request::UP request) override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/request.h b/vbench/src/vbench/vbench/request.h index 4951c96fbab..c3eab1ab75b 100644 --- a/vbench/src/vbench/vbench/request.h +++ b/vbench/src/vbench/vbench/request.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once #include <vbench/core/string.h> @@ -68,9 +67,9 @@ public: double latency() const { return (_endTime - _startTime); } - virtual void handleHeader(const string &name, const string &value) override; - virtual void handleContent(const Memory &data) override; - virtual void handleFailure(const string &reason) override; + void handleHeader(const string &name, const string &value) override; + void handleContent(const Memory &data) override; + void handleFailure(const string &reason) override; const BenchmarkHeaders &headers() const { return _headers; } @@ -78,4 +77,3 @@ public: }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/request_dumper.h b/vbench/src/vbench/vbench/request_dumper.h index aede956477c..a06e7224c4f 100644 --- a/vbench/src/vbench/vbench/request_dumper.h +++ b/vbench/src/vbench/vbench/request_dumper.h @@ -1,11 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/core/handler.h> - -#include "request.h" #include "analyzer.h" namespace vbench { @@ -21,9 +17,8 @@ private: public: RequestDumper(Handler<Request> &_next); - virtual void handle(Request::UP request) override; - virtual void report() override; + void handle(Request::UP request) override; + void report() override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/request_generator.h b/vbench/src/vbench/vbench/request_generator.h index 38f2c7ad7f8..ac2b18cf928 100644 --- a/vbench/src/vbench/vbench/request_generator.h +++ b/vbench/src/vbench/vbench/request_generator.h @@ -1,16 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vespa/vespalib/util/runnable.h> +#include "generator.h" +#include "request.h" #include <vbench/core/input_file_reader.h> -#include <vbench/core/taintable.h> #include <vbench/core/handler.h> -#include "request.h" -#include "generator.h" - namespace vbench { /** @@ -25,12 +21,10 @@ private: bool _aborted; public: - RequestGenerator(const string &inputFile, - Handler<Request> &next); + RequestGenerator(const string &inputFile, Handler<Request> &next); void abort() override; - virtual void run() override; - virtual const Taint &tainted() const override { return _input.tainted(); } + void run() override; + const Taint &tainted() const override { return _input.tainted(); } }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/request_scheduler.h b/vbench/src/vbench/vbench/request_scheduler.h index 1de61073d35..60fe4af12fc 100644 --- a/vbench/src/vbench/vbench/request_scheduler.h +++ b/vbench/src/vbench/vbench/request_scheduler.h @@ -1,23 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> - -#include <vespa/vespalib/util/sync.h> -#include <vespa/vespalib/util/thread.h> -#include <vespa/vespalib/util/runnable.h> -#include <vespa/vespalib/util/active.h> - -#include <vbench/core/handler.h> +#include "worker.h" +#include "dropped_tagger.h" #include <vbench/core/time_queue.h> #include <vbench/core/dispatcher.h> #include <vbench/core/handler_thread.h> - -#include "request.h" -#include "worker.h" -#include "dropped_tagger.h" +#include <vespa/vespalib/util/sync.h> +#include <vespa/vespalib/util/active.h> namespace vbench { @@ -40,16 +31,15 @@ private: HttpConnectionPool _connectionPool; std::vector<Worker::UP> _workers; - virtual void run() override; + void run() override; public: typedef std::unique_ptr<RequestScheduler> UP; RequestScheduler(Handler<Request> &next, size_t numWorkers); void abort(); - virtual void handle(Request::UP request) override; - virtual void start() override; - virtual RequestScheduler &stop() override; - virtual void join() override; + void handle(Request::UP request) override; + void start() override; + RequestScheduler &stop() override; + void join() override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/request_sink.h b/vbench/src/vbench/vbench/request_sink.h index 37c6ce71fcc..9c9d46775e5 100644 --- a/vbench/src/vbench/vbench/request_sink.h +++ b/vbench/src/vbench/vbench/request_sink.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once #include "analyzer.h" @@ -15,9 +14,8 @@ class RequestSink : public Analyzer { public: RequestSink(); - virtual void handle(Request::UP request) override; - virtual void report() override; + void handle(Request::UP request) override; + void report() override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/server_tagger.h b/vbench/src/vbench/vbench/server_tagger.h index 6115873bb0c..5e760dc02e5 100644 --- a/vbench/src/vbench/vbench/server_tagger.h +++ b/vbench/src/vbench/vbench/server_tagger.h @@ -1,13 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <vbench/http/server_spec.h> -#include <vbench/core/handler.h> - -#include "request.h" #include "tagger.h" +#include <vbench/http/server_spec.h> namespace vbench { @@ -21,10 +17,8 @@ private: Handler<Request> &_next; public: - ServerTagger(const ServerSpec &server, - Handler<Request> &next); - virtual void handle(Request::UP request) override; + ServerTagger(const ServerSpec &server, Handler<Request> &next); + void handle(Request::UP request) override; }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/tagger.h b/vbench/src/vbench/vbench/tagger.h index c19319e39e2..225b83d5433 100644 --- a/vbench/src/vbench/vbench/tagger.h +++ b/vbench/src/vbench/vbench/tagger.h @@ -1,12 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> -#include <vbench/core/handler.h> - #include "request.h" +#include <vbench/core/handler.h> namespace vbench { @@ -17,4 +14,3 @@ struct Tagger : public Handler<Request> }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/vbench.h b/vbench/src/vbench/vbench/vbench.h index 5796b3dab76..186bdeeac17 100644 --- a/vbench/src/vbench/vbench/vbench.h +++ b/vbench/src/vbench/vbench/vbench.h @@ -1,14 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> - -#include <vespa/vespalib/util/runnable.h> -#include <vbench/core/taintable.h> -#include <vespa/vespalib/data/slime/slime.h> - #include "analyzer.h" #include "generator.h" #include "latency_analyzer.h" @@ -20,6 +13,8 @@ #include "request_sink.h" #include "server_tagger.h" #include "tagger.h" +#include <vbench/core/taintable.h> +#include <vespa/vespalib/data/slime/slime.h> namespace vbench { @@ -42,9 +37,8 @@ private: public: VBench(const vespalib::Slime &cfg); void abort(); - virtual void run() override; - virtual const Taint &tainted() const override { return _taint; } + void run() override; + const Taint &tainted() const override { return _taint; } }; } // namespace vbench - diff --git a/vbench/src/vbench/vbench/worker.h b/vbench/src/vbench/vbench/worker.h index cdadaf87cd3..8e9a5119f31 100644 --- a/vbench/src/vbench/vbench/worker.h +++ b/vbench/src/vbench/vbench/worker.h @@ -1,19 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #pragma once -#include <memory> - -#include <vespa/vespalib/util/runnable.h> -#include <vespa/vespalib/util/thread.h> -#include <vespa/vespalib/util/joinable.h> - +#include "request.h" #include <vbench/core/provider.h> #include <vbench/core/handler.h> #include <vbench/http/http_connection_pool.h> - -#include "request.h" +#include <vespa/vespalib/util/runnable.h> +#include <vespa/vespalib/util/thread.h> +#include <vespa/vespalib/util/joinable.h> namespace vbench { @@ -33,13 +28,12 @@ private: HttpConnectionPool &_pool; Timer &_timer; - virtual void run() override; + void run() override; public: typedef std::unique_ptr<Worker> UP; Worker(Provider<Request> &provider, Handler<Request> &next, HttpConnectionPool &pool, Timer &timer); - virtual void join() override { _thread.join(); } + void join() override { _thread.join(); } }; } // namespace vbench - diff --git a/vdslib/src/tests/bucketdistribution/bucketdistributiontest.cpp b/vdslib/src/tests/bucketdistribution/bucketdistributiontest.cpp index 589d7b66e96..89879ef9d7a 100644 --- a/vdslib/src/tests/bucketdistribution/bucketdistributiontest.cpp +++ b/vdslib/src/tests/bucketdistribution/bucketdistributiontest.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(".bucketdistributiontest"); #include <cppunit/extensions/HelperMacros.h> #include <vespa/vdslib/bucketdistribution.h> @@ -10,8 +7,6 @@ using namespace vdslib; class BucketDistributionTest : public CppUnit::TestFixture { public: - void setUp() override { } - void tearDown() override { } void testDistribution(); void testNumBucketBits(); @@ -29,7 +24,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION(BucketDistributionTest); void BucketDistributionTest::testDistribution() { - LOG(info, "testDistribution"); const uint32_t expected4[] = { 10, 11, 9, 6, 4, 8, 14, 1, 13, 2, 12, 3, 5, 7, 15, 0 }; assertDistribution(16, 4, expected4); diff --git a/vdslib/src/tests/thread/taskschedulertest.cpp b/vdslib/src/tests/thread/taskschedulertest.cpp index 22529a9f37a..a48f9d20214 100644 --- a/vdslib/src/tests/thread/taskschedulertest.cpp +++ b/vdslib/src/tests/thread/taskschedulertest.cpp @@ -1,6 +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/vdslib/thread/taskscheduler.h> #include <vespa/vdstestlib/cppunit/macros.h> diff --git a/vdstestlib/src/tests/cppunit/testrunner.cpp b/vdstestlib/src/tests/cppunit/testrunner.cpp index 1ba7be7790e..c25bee698d5 100644 --- a/vdstestlib/src/tests/cppunit/testrunner.cpp +++ b/vdstestlib/src/tests/cppunit/testrunner.cpp @@ -1,9 +1,8 @@ // 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/vdstestlib/cppunit/cppunittestrunner.h> -int main(int argc, char **argv) +int main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/vdstestlib/src/tests/dirconfig/dirconfigtest.cpp b/vdstestlib/src/tests/dirconfig/dirconfigtest.cpp index e00815241f0..73f6f3cc600 100644 --- a/vdstestlib/src/tests/dirconfig/dirconfigtest.cpp +++ b/vdstestlib/src/tests/dirconfig/dirconfigtest.cpp @@ -1,15 +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/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/exceptions.h> #include <vespa/vdstestlib/cppunit/dirconfig.h> - #include <fstream> #include <iostream> -#include <vespa/log/log.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/exceptions.h> - -LOG_SETUP("dirconfig_test"); using namespace vdstestlib; diff --git a/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.cpp b/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.cpp index 7af156bbc2a..fb692bd8e8f 100644 --- a/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.cpp +++ b/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.cpp @@ -1,11 +1,9 @@ // 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/vdstestlib/cppunit/cppunittestrunner.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> -#include <cppunit/TestSuite.h> #include <cppunit/TextTestProgressListener.h> #include <vespa/log/log.h> #include <iostream> @@ -22,7 +20,7 @@ namespace { std::vector<std::string> _wanted; bool _includeStressTests; - WantedTestList(int argc, const char * const * argv, + WantedTestList(int argc, const char *argv[], bool includeStressTests) : _wanted(), _includeStressTests(includeStressTests) @@ -66,7 +64,7 @@ namespace { return (s[s.size() - 1] == '$'); } - virtual bool include(const std::string& name) const override { + bool include(const std::string& name) const override { if ((name.find("stress") != std::string::npos || name.find("Stress") != std::string::npos) && !_includeStressTests) @@ -90,11 +88,11 @@ namespace { struct LogHook : public CppUnit::TextTestProgressListener::TestStartHook { std::string lastTest; - virtual void startedTest(const std::string& testName) override { + void startedTest(const std::string& testName) override { LOG(info, "Starting test: %s", testName.c_str()); lastTest = testName; } - virtual void stoppedTest() override { + void stoppedTest() override { LOG(info, "Stopped test: %s", lastTest.c_str()); } }; @@ -112,7 +110,7 @@ CppUnitTestRunner::CppUnitTestRunner() } int -CppUnitTestRunner::run(int argc, const char * const * argv) +CppUnitTestRunner::run(int argc, const char *argv[]) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry& registry( diff --git a/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.h b/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.h index e8ee1700927..204cfff0cb8 100644 --- a/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.h +++ b/vdstestlib/src/vespa/vdstestlib/cppunit/cppunittestrunner.h @@ -50,7 +50,7 @@ public: CppUnitTestRunner(); void listTests(const CppUnit::TestSuite *tests); - int run(int argc, const char * const * argv); + int run(int argc, const char * argv[]); }; diff --git a/vespalib/src/vespa/vespalib/util/closure.h b/vespalib/src/vespa/vespalib/util/closure.h index 81ea8430609..a494c8d97df 100644 --- a/vespalib/src/vespa/vespalib/util/closure.h +++ b/vespalib/src/vespa/vespalib/util/closure.h @@ -102,9 +102,7 @@ class Closure0_2 : public Closure0<R> { T1 _arg1; T2 _arg2; - virtual R call() override - { return _func(std::move(_arg1), std::move(_arg2)); } - + R call() override { return _func(std::move(_arg1), std::move(_arg2)); } public: Closure0_2(Func func, T1 &&arg1, T2 &&arg2) : _func(func), _arg1(std::move(arg1)), _arg2(std::move(arg2)) {} @@ -120,8 +118,7 @@ class Closure0_3 : public Closure0<R> { T2 _arg2; T3 _arg3; - virtual R call() override - { return _func(std::move(_arg1), std::move(_arg2), std::move(_arg3)); } + R call() override { return _func(std::move(_arg1), std::move(_arg2), std::move(_arg3)); } public: Closure0_3(Func func, T1 &&arg1, T2 &&arg2, T3 &&arg3) diff --git a/vespalog/src/logger/llreader.h b/vespalog/src/logger/llreader.h index 27b39d23df7..70b28d3996a 100644 --- a/vespalog/src/logger/llreader.h +++ b/vespalog/src/logger/llreader.h @@ -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 <stdexcept> -#include <vespa/log/log.h> -#include <vespa/log/log-target.h> #include <vespa/log/llparser.h> +#include <stdexcept> namespace ns_log { @@ -18,7 +16,6 @@ public: const char *what() const throw() override { return _string; } }; - class InputBuf { private: diff --git a/vespalog/src/test/threads/testthreads.cpp b/vespalog/src/test/threads/testthreads.cpp index 515fa10c11f..a708777f350 100644 --- a/vespalog/src/test/threads/testthreads.cpp +++ b/vespalog/src/test/threads/testthreads.cpp @@ -1,8 +1,8 @@ // 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/fastos/app.h> +#include <vespa/fastos/time.h> #include <vespa/log/log.h> #include <iostream> -#include <string> using std::string; @@ -15,7 +15,7 @@ class FileThread : public FastOS_Runnable string _file; public: FileThread(string file) : _done(false), _file(file) {} - virtual void Run(FastOS_ThreadInterface *thread, void *arg) override; + void Run(FastOS_ThreadInterface *thread, void *arg) override; void stop() {_done = true; } }; @@ -25,13 +25,10 @@ class LoggerThread : public FastOS_Runnable public: bool _useLogBuffer; LoggerThread() : _done(false), _useLogBuffer(false) {} - virtual void Run(FastOS_ThreadInterface *thread, void *arg) override; + void Run(FastOS_ThreadInterface *thread, void *arg) override; void stop() {_done = true; } }; - - - void FileThread::Run(FastOS_ThreadInterface *, void *) { diff --git a/vespamalloc/src/tests/allocfree/allocfree.cpp b/vespamalloc/src/tests/allocfree/allocfree.cpp index cdb471e35d2..0806d3a8453 100644 --- a/vespamalloc/src/tests/allocfree/allocfree.cpp +++ b/vespamalloc/src/tests/allocfree/allocfree.cpp @@ -19,7 +19,7 @@ public: FreeWorker(uint32_t maxQueue, bool inverse) : Consumer (maxQueue, inverse) {} private: - virtual void consume(void * p) override { free(p); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ public: : Producer(cnt, target), _size(size) {} private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } + void * produce() override { return malloc(_size); } }; //----------------------------------------------------------------------------- @@ -41,8 +41,9 @@ public: : ProducerConsumer(cnt, inverse), _size(size) { } private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } - virtual void consume(void * p) override { free(p); } + + void * produce() override { return malloc(_size); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp index 06acfa8df8a..ff33fca4661 100644 --- a/vespamalloc/src/tests/allocfree/linklist.cpp +++ b/vespamalloc/src/tests/allocfree/linklist.cpp @@ -61,7 +61,7 @@ public: LinkIn(List::AtomicHeadPtr & list, uint32_t maxQueue, bool inverse); private: List::AtomicHeadPtr & _head; - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); @@ -82,7 +82,7 @@ public: : Producer(cnt, target), _head(list) {} private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } @@ -98,13 +98,13 @@ public: : ProducerConsumer(cnt, inverse), _head(list) { } private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } return p; } - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); diff --git a/vespamalloc/src/tests/doubledelete/expectsignal.cpp b/vespamalloc/src/tests/doubledelete/expectsignal.cpp index 3237339fb97..2811da01c09 100644 --- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp +++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp @@ -9,7 +9,8 @@ class Test : public TestApp public: int Main() override; private: - virtual bool useProcessStarter() const override { return true; } + bool useProcessStarter() const override { return true; } + }; int Test::Main() diff --git a/vespamalloc/src/tests/test.cpp b/vespamalloc/src/tests/test.cpp index 9f5bd826a6b..960114b1bc1 100644 --- a/vespamalloc/src/tests/test.cpp +++ b/vespamalloc/src/tests/test.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdio.h> -#include <stdlib.h> + #include <vespa/fastos/thread.h> namespace vespamalloc { diff --git a/vespamalloc/src/tests/thread/racemanythreads.cpp b/vespamalloc/src/tests/thread/racemanythreads.cpp index 8f366acea3a..acfefceee15 100644 --- a/vespamalloc/src/tests/thread/racemanythreads.cpp +++ b/vespamalloc/src/tests/thread/racemanythreads.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp index 6261a0f8eb6..9053a435d11 100644 --- a/vespamalloc/src/tests/thread/thread.cpp +++ b/vespamalloc/src/tests/thread/thread.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; @@ -21,7 +11,7 @@ public: ~Test(); int Main() override; private: - virtual bool useIPCHelper() const override { return true; } + bool useIPCHelper() const override { return true; } }; Test::~Test() |