summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-22 13:11:12 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-22 13:11:12 +0100
commit269af3b147667a384772b2bf586d2bd98731a8c1 (patch)
tree3a34e43792c0e333777b3fbf01140e423d381e6b
parent9c6fa5fda02b0dfa3d34e9ba2b56d46f1bf101be (diff)
Only include what you need.
-rw-r--r--config/src/tests/failover/failover.cpp12
-rw-r--r--document/src/tests/serialization/annotationserializer_test.cpp7
-rw-r--r--document/src/tests/struct_anno/struct_anno_test.cpp3
-rw-r--r--document/src/vespa/document/annotation/alternatespanlist.cpp2
-rw-r--r--document/src/vespa/document/annotation/span.cpp1
-rw-r--r--document/src/vespa/document/annotation/spanlist.cpp1
-rw-r--r--document/src/vespa/document/base/documentid.cpp1
-rw-r--r--document/src/vespa/document/base/exceptions.cpp4
-rw-r--r--document/src/vespa/document/base/field.cpp3
-rw-r--r--document/src/vespa/document/base/fieldpath.cpp6
-rw-r--r--document/src/vespa/document/base/forcelink.cpp3
-rw-r--r--document/src/vespa/document/base/idstring.cpp5
-rw-r--r--document/src/vespa/document/base/testdocman.cpp14
-rw-r--r--document/src/vespa/document/bucket/bucketdistribution.cpp3
-rw-r--r--document/src/vespa/document/bucket/bucketselector.cpp7
-rw-r--r--document/src/vespa/document/datatype/annotationtype.cpp1
-rw-r--r--document/src/vespa/document/datatype/collectiondatatype.cpp4
-rw-r--r--document/src/vespa/document/datatype/numericdatatype.cpp3
-rw-r--r--document/src/vespa/document/datatype/positiondatatype.cpp4
-rw-r--r--document/src/vespa/document/datatype/structureddatatype.cpp8
-rw-r--r--document/src/vespa/document/datatype/urldatatype.cpp4
-rw-r--r--document/src/vespa/document/fieldset/fieldsetrepo.cpp4
-rw-r--r--document/src/vespa/document/fieldset/fieldsets.cpp5
-rw-r--r--document/src/vespa/document/fieldvalue/fieldvalue.cpp21
-rw-r--r--document/src/vespa/document/fieldvalue/fieldvaluewriter.h2
-rw-r--r--document/src/vespa/document/fieldvalue/mapfieldvalue.cpp14
-rw-r--r--document/src/vespa/document/fieldvalue/numericfieldvalue.cpp4
-rw-r--r--document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp13
-rw-r--r--document/src/vespa/document/predicate/predicate.cpp2
-rw-r--r--document/src/vespa/document/predicate/predicate_builder.cpp10
-rw-r--r--document/src/vespa/document/predicate/predicate_builder.h6
-rw-r--r--document/src/vespa/document/predicate/predicate_slime_builder.cpp1
-rw-r--r--document/src/vespa/document/predicate/predicate_slime_visitor.cpp1
-rw-r--r--document/src/vespa/document/repo/configbuilder.cpp1
-rw-r--r--document/src/vespa/document/repo/fixedtyperepo.cpp1
-rw-r--r--document/src/vespa/document/select/bodyfielddetector.cpp1
-rw-r--r--document/src/vespa/document/select/branch.cpp1
-rw-r--r--document/src/vespa/document/select/cloningvisitor.cpp17
-rw-r--r--document/src/vespa/document/select/cloningvisitor.h7
-rw-r--r--document/src/vespa/document/select/compare.cpp11
-rw-r--r--document/src/vespa/document/select/constant.cpp2
-rw-r--r--document/src/vespa/document/select/doctype.cpp2
-rw-r--r--document/src/vespa/document/select/invalidconstant.cpp5
-rw-r--r--document/src/vespa/document/select/orderingselector.cpp10
-rw-r--r--document/src/vespa/document/select/orderingspecification.cpp2
-rw-r--r--document/src/vespa/document/select/parser.cpp23
-rw-r--r--document/src/vespa/document/select/result.cpp2
-rw-r--r--document/src/vespa/document/select/resultset.cpp8
-rw-r--r--document/src/vespa/document/select/simpleparser.cpp2
-rw-r--r--document/src/vespa/document/select/traversingvisitor.cpp7
-rw-r--r--document/src/vespa/document/select/value.cpp3
-rw-r--r--document/src/vespa/document/serialization/annotationserializer.cpp1
-rw-r--r--document/src/vespa/document/serialization/vespadocumentserializer.cpp7
-rw-r--r--document/src/vespa/document/update/fieldupdate.cpp4
-rw-r--r--document/src/vespa/document/update/removefieldpathupdate.cpp4
-rw-r--r--document/src/vespa/document/update/valueupdate.cpp17
-rw-r--r--document/src/vespa/document/util/compressor.cpp5
-rw-r--r--document/src/vespa/document/util/printable.cpp4
-rw-r--r--searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp1
-rw-r--r--staging_vespalib/src/tests/stllike/lrucache.cpp1
-rw-r--r--vbench/src/vbench/core/socket.h2
-rw-r--r--vbench/src/vbench/test/server_socket.h1
-rw-r--r--vdslib/src/tests/distribution/distributiontest.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/net/server_socket.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/net/socket.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/net/socket_handle.cpp2
-rwxr-xr-xvespalib/src/vespa/vespalib/testkit/create-test.sh1
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_comparators.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_hook.cpp3
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_kit.h1
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_macros.h2
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_master.cpp7
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_master.h7
-rw-r--r--vespalib/src/vespa/vespalib/testkit/test_state_guard.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/testkit/testapp.cpp8
-rw-r--r--vespalib/src/vespa/vespalib/testkit/testapp.h2
-rw-r--r--vespalib/src/vespa/vespalib/testkit/time_bomb.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/websocket/server_socket.h1
-rw-r--r--vespalib/src/vespa/vespalib/websocket/socket.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/websocket/socket.h6
80 files changed, 149 insertions, 233 deletions
diff --git a/config/src/tests/failover/failover.cpp b/config/src/tests/failover/failover.cpp
index baaae8ba19a..146cb517280 100644
--- a/config/src/tests/failover/failover.cpp
+++ b/config/src/tests/failover/failover.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("failover");
+
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/config/common/misc.h>
#include <vespa/config/frt/protocol.h>
@@ -9,6 +7,8 @@ LOG_SETUP("failover");
#include <vespa/fnet/frt/frt.h>
#include "config-my.h"
#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/log/log.h>
+LOG_SETUP("failover");
using namespace config;
using vespalib::Barrier;
@@ -86,7 +86,7 @@ void verifyConfig(std::unique_ptr<MyConfig> config)
}
struct ServerFixture {
- typedef vespalib::LinkedPtr<ServerFixture> LP;
+ using UP = std::unique_ptr<ServerFixture>;
FRT_Supervisor * supervisor;
RPCServer server;
Barrier b;
@@ -130,14 +130,14 @@ struct ServerFixture {
};
struct NetworkFixture {
- std::vector<ServerFixture::LP> serverList;
+ std::vector<ServerFixture::UP> serverList;
ServerSpec spec;
bool running;
NetworkFixture(const std::vector<vespalib::string> & serverSpecs)
: spec(serverSpecs), running(true)
{
for (size_t i = 0; i < serverSpecs.size(); i++) {
- serverList.push_back(ServerFixture::LP(new ServerFixture(serverSpecs[i])));
+ serverList.push_back(std::make_unique<ServerFixture>(serverSpecs[i]));
}
}
void start(size_t i) {
diff --git a/document/src/tests/serialization/annotationserializer_test.cpp b/document/src/tests/serialization/annotationserializer_test.cpp
index ef44df57802..05a1b1441e0 100644
--- a/document/src/tests/serialization/annotationserializer_test.cpp
+++ b/document/src/tests/serialization/annotationserializer_test.cpp
@@ -4,20 +4,17 @@
#include <vespa/document/base/testdocrepo.h>
#include <vespa/document/annotation/alternatespanlist.h>
#include <vespa/document/annotation/annotation.h>
-#include <vespa/document/annotation/span.h>
-#include <vespa/document/annotation/spanlist.h>
#include <vespa/document/annotation/spantree.h>
#include <vespa/document/fieldvalue/stringfieldvalue.h>
-#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/document/serialization/annotationdeserializer.h>
#include <vespa/document/serialization/annotationserializer.h>
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/document/serialization/vespadocumentserializer.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/fastos/file.h>
#include <fstream>
-#include <sstream>
-#include <vector>
+
using document::DocumenttypesConfig;
using std::fstream;
diff --git a/document/src/tests/struct_anno/struct_anno_test.cpp b/document/src/tests/struct_anno/struct_anno_test.cpp
index c38f7527cac..a6c078698d3 100644
--- a/document/src/tests/struct_anno/struct_anno_test.cpp
+++ b/document/src/tests/struct_anno/struct_anno_test.cpp
@@ -11,8 +11,7 @@
#include <vespa/document/serialization/vespadocumentserializer.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <sstream>
-#include <vector>
+#include <vespa/fastos/file.h>
using std::ostringstream;
using std::string;
diff --git a/document/src/vespa/document/annotation/alternatespanlist.cpp b/document/src/vespa/document/annotation/alternatespanlist.cpp
index e39bd0a0f49..e0b2e7814b7 100644
--- a/document/src/vespa/document/annotation/alternatespanlist.cpp
+++ b/document/src/vespa/document/annotation/alternatespanlist.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 "alternatespanlist.h"
#include "spantreevisitor.h"
+#include <cassert>
using std::unique_ptr;
diff --git a/document/src/vespa/document/annotation/span.cpp b/document/src/vespa/document/annotation/span.cpp
index e1d35943d19..b2ab196670a 100644
--- a/document/src/vespa/document/annotation/span.cpp
+++ b/document/src/vespa/document/annotation/span.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 "span.h"
#include "spantreevisitor.h"
diff --git a/document/src/vespa/document/annotation/spanlist.cpp b/document/src/vespa/document/annotation/spanlist.cpp
index efcc25018fa..b7d717fd325 100644
--- a/document/src/vespa/document/annotation/spanlist.cpp
+++ b/document/src/vespa/document/annotation/spanlist.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 "spanlist.h"
#include "spantreevisitor.h"
diff --git a/document/src/vespa/document/base/documentid.cpp b/document/src/vespa/document/base/documentid.cpp
index 90ab5ff6c56..7548d2d4dad 100644
--- a/document/src/vespa/document/base/documentid.cpp
+++ b/document/src/vespa/document/base/documentid.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 "documentid.h"
#include <vespa/vespalib/util/md5.h>
#include <vespa/vespalib/objects/nbostream.h>
diff --git a/document/src/vespa/document/base/exceptions.cpp b/document/src/vespa/document/base/exceptions.cpp
index d326e54c0c3..3e5c464b8b4 100644
--- a/document/src/vespa/document/base/exceptions.cpp
+++ b/document/src/vespa/document/base/exceptions.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/fastos/fastos.h>
-#include <vespa/document/base/exceptions.h>
-
+#include "exceptions.h"
#include <vespa/document/datatype/datatype.h>
#include <vespa/document/fieldvalue/document.h>
diff --git a/document/src/vespa/document/base/field.cpp b/document/src/vespa/document/base/field.cpp
index fd9adfe6b42..43eedaf8cf7 100644
--- a/document/src/vespa/document/base/field.cpp
+++ b/document/src/vespa/document/base/field.cpp
@@ -1,7 +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/document/base/field.h>
+#include "field.h"
#include <vespa/document/datatype/datatype.h>
#include <vespa/document/fieldvalue/fieldvalue.h>
diff --git a/document/src/vespa/document/base/fieldpath.cpp b/document/src/vespa/document/base/fieldpath.cpp
index bf978bf21cb..54c28572ab2 100644
--- a/document/src/vespa/document/base/fieldpath.cpp
+++ b/document/src/vespa/document/base/fieldpath.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.
-#include <vespa/fastos/fastos.h>
-#include <vespa/document/base/fieldpath.h>
-#include <vespa/document/base/field.h>
+
+#include "fieldpath.h"
+#include "field.h"
#include <vespa/document/datatype/arraydatatype.h>
#include <vespa/document/datatype/mapdatatype.h>
#include <vespa/document/datatype/weightedsetdatatype.h>
diff --git a/document/src/vespa/document/base/forcelink.cpp b/document/src/vespa/document/base/forcelink.cpp
index f42ae0fe1c8..b03433081d6 100644
--- a/document/src/vespa/document/base/forcelink.cpp
+++ b/document/src/vespa/document/base/forcelink.cpp
@@ -1,7 +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/document/base/forcelink.h>
+#include "forcelink.h"
#include <vespa/document/update/updates.h>
#include <vespa/document/fieldvalue/fieldvalues.h>
diff --git a/document/src/vespa/document/base/idstring.cpp b/document/src/vespa/document/base/idstring.cpp
index e82deb8d049..9a62471d6e8 100644
--- a/document/src/vespa/document/base/idstring.cpp
+++ b/document/src/vespa/document/base/idstring.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/document/base/idstring.h>
+#include "idstring.h"
#include <vespa/vespalib/util/md5.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <vespa/document/bucket/bucketid.h>
#include <vespa/vespalib/util/vstringfmt.h>
#include <vespa/vespalib/util/optimized.h>
diff --git a/document/src/vespa/document/base/testdocman.cpp b/document/src/vespa/document/base/testdocman.cpp
index f7a01761de3..c3d02069301 100644
--- a/document/src/vespa/document/base/testdocman.cpp
+++ b/document/src/vespa/document/base/testdocman.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/document/base/testdocman.h>
-
-#include <boost/random.hpp>
-#include <vespa/document/base/exceptions.h>
+#include "testdocman.h"
+#include "exceptions.h"
#include <vespa/document/datatype/datatypes.h>
+#include <boost/random.hpp>
#include <sstream>
namespace document {
@@ -60,11 +58,9 @@ TestDocMan::TestDocMan()
: _test_repo(),
_repo(_test_repo.getTypeRepoSp()),
_typeCfg(&_test_repo.getTypeConfig())
-{
-}
+{ }
-TestDocMan::~TestDocMan() {
-}
+TestDocMan::~TestDocMan() { }
void
TestDocMan::setTypeRepo(const DocumentTypeRepo::SP &repo)
diff --git a/document/src/vespa/document/bucket/bucketdistribution.cpp b/document/src/vespa/document/bucket/bucketdistribution.cpp
index 49585fe1092..fa184be087a 100644
--- a/document/src/vespa/document/bucket/bucketdistribution.cpp
+++ b/document/src/vespa/document/bucket/bucketdistribution.cpp
@@ -1,7 +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/document/bucket/bucketdistribution.h>
+#include "bucketdistribution.h"
#include <vespa/log/log.h>
LOG_SETUP(".bucketdistribution");
diff --git a/document/src/vespa/document/bucket/bucketselector.cpp b/document/src/vespa/document/bucket/bucketselector.cpp
index 05e7bea912a..19aec7d7bf8 100644
--- a/document/src/vespa/document/bucket/bucketselector.cpp
+++ b/document/src/vespa/document/bucket/bucketselector.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/document/bucket/bucketselector.h>
-#include <algorithm>
-#include <vespa/document/bucket/bucketidfactory.h>
+#include "bucketselector.h"
+#include "bucketidfactory.h"
#include <vespa/document/base/documentid.h>
#include <vespa/document/base/idstring.h>
#include <vespa/document/select/node.h>
@@ -11,6 +9,7 @@
#include <vespa/document/select/visitor.h>
#include <vespa/document/select/branch.h>
#include <vespa/document/select/compare.h>
+#include <algorithm>
namespace document {
diff --git a/document/src/vespa/document/datatype/annotationtype.cpp b/document/src/vespa/document/datatype/annotationtype.cpp
index f34d20c348e..4ba2ea8f2be 100644
--- a/document/src/vespa/document/datatype/annotationtype.cpp
+++ b/document/src/vespa/document/datatype/annotationtype.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 "annotationtype.h"
#include "numericdatatype.h"
#include "primitivedatatype.h"
diff --git a/document/src/vespa/document/datatype/collectiondatatype.cpp b/document/src/vespa/document/datatype/collectiondatatype.cpp
index 903875e303c..19c305f6f8b 100644
--- a/document/src/vespa/document/datatype/collectiondatatype.cpp
+++ b/document/src/vespa/document/datatype/collectiondatatype.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/fastos/fastos.h>
-#include <vespa/document/datatype/collectiondatatype.h>
-
+#include "collectiondatatype.h"
#include <vespa/document/util/stringutil.h>
#include <vespa/vespalib/util/exceptions.h>
diff --git a/document/src/vespa/document/datatype/numericdatatype.cpp b/document/src/vespa/document/datatype/numericdatatype.cpp
index 5e7579871a9..ef42ee11bf9 100644
--- a/document/src/vespa/document/datatype/numericdatatype.cpp
+++ b/document/src/vespa/document/datatype/numericdatatype.cpp
@@ -1,7 +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/document/datatype/numericdatatype.h>
+#include "numericdatatype.h"
#include <ostream>
namespace document {
diff --git a/document/src/vespa/document/datatype/positiondatatype.cpp b/document/src/vespa/document/datatype/positiondatatype.cpp
index 28307476774..7a0563617f6 100644
--- a/document/src/vespa/document/datatype/positiondatatype.cpp
+++ b/document/src/vespa/document/datatype/positiondatatype.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/document/datatype/positiondatatype.h>
+
+#include "positiondatatype.h"
namespace document {
diff --git a/document/src/vespa/document/datatype/structureddatatype.cpp b/document/src/vespa/document/datatype/structureddatatype.cpp
index 0fc55dddd1e..aab959d995b 100644
--- a/document/src/vespa/document/datatype/structureddatatype.cpp
+++ b/document/src/vespa/document/datatype/structureddatatype.cpp
@@ -1,12 +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/document/datatype/structureddatatype.h>
-#include <stdexcept>
-#include <vespa/document/base/exceptions.h>
+#include "structureddatatype.h"
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".document.datatype.structured");
namespace document {
@@ -86,7 +81,6 @@ StructuredDataType::onBuildFieldPath(const vespalib::stringref & remainFieldName
fieldPath->insert(fieldPath->begin(), FieldPathEntry(fp));
return fieldPath;
} else {
- LOG(debug, "Could not find field %s", currFieldName.c_str());
return FieldPath::UP();
}
}
diff --git a/document/src/vespa/document/datatype/urldatatype.cpp b/document/src/vespa/document/datatype/urldatatype.cpp
index aada45d0e23..f69b880e9e7 100644
--- a/document/src/vespa/document/datatype/urldatatype.cpp
+++ b/document/src/vespa/document/datatype/urldatatype.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/document/datatype/urldatatype.h>
+
+#include "urldatatype.h"
namespace document {
diff --git a/document/src/vespa/document/fieldset/fieldsetrepo.cpp b/document/src/vespa/document/fieldset/fieldsetrepo.cpp
index 860364207bd..cf7b0e50947 100644
--- a/document/src/vespa/document/fieldset/fieldsetrepo.cpp
+++ b/document/src/vespa/document/fieldset/fieldsetrepo.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/document/fieldset/fieldsetrepo.h>
+
+#include "fieldsetrepo.h"
#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/stllike/asciistream.h>
diff --git a/document/src/vespa/document/fieldset/fieldsets.cpp b/document/src/vespa/document/fieldset/fieldsets.cpp
index 9a87cb41e85..4ac09820979 100644
--- a/document/src/vespa/document/fieldset/fieldsets.cpp
+++ b/document/src/vespa/document/fieldset/fieldsets.cpp
@@ -1,7 +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/document/fieldset/fieldsets.h>
+
+#include "fieldsets.h"
#include <vespa/document/fieldvalue/document.h>
+
namespace document {
bool
diff --git a/document/src/vespa/document/fieldvalue/fieldvalue.cpp b/document/src/vespa/document/fieldvalue/fieldvalue.cpp
index 3d3e0cd4358..b8b3e2d0308 100644
--- a/document/src/vespa/document/fieldvalue/fieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/fieldvalue.cpp
@@ -1,21 +1,20 @@
// 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/fieldvalue.h>
+#include "fieldvalue.h"
+#include "arrayfieldvalue.h"
+#include "intfieldvalue.h"
+#include "floatfieldvalue.h"
+#include "stringfieldvalue.h"
+#include "rawfieldvalue.h"
+#include "longfieldvalue.h"
+#include "doublefieldvalue.h"
+#include "bytefieldvalue.h"
+#include "predicatefieldvalue.h"
#include <vespa/document/base/exceptions.h>
#include <vespa/document/datatype/arraydatatype.h>
#include <vespa/document/datatype/numericdatatype.h>
#include <vespa/document/datatype/primitivedatatype.h>
-#include <vespa/document/fieldvalue/arrayfieldvalue.h>
-#include <vespa/document/fieldvalue/intfieldvalue.h>
-#include <vespa/document/fieldvalue/floatfieldvalue.h>
-#include <vespa/document/fieldvalue/stringfieldvalue.h>
-#include <vespa/document/fieldvalue/rawfieldvalue.h>
-#include <vespa/document/fieldvalue/longfieldvalue.h>
-#include <vespa/document/fieldvalue/doublefieldvalue.h>
-#include <vespa/document/fieldvalue/bytefieldvalue.h>
-#include <vespa/document/fieldvalue/predicatefieldvalue.h>
#include <vespa/document/serialization/vespadocumentserializer.h>
#include <vespa/document/util/bytebuffer.h>
#include <vespa/vespalib/objects/fieldbase.h>
diff --git a/document/src/vespa/document/fieldvalue/fieldvaluewriter.h b/document/src/vespa/document/fieldvalue/fieldvaluewriter.h
index 18d39403ff8..b004daff9a5 100644
--- a/document/src/vespa/document/fieldvalue/fieldvaluewriter.h
+++ b/document/src/vespa/document/fieldvalue/fieldvaluewriter.h
@@ -2,6 +2,8 @@
#pragma once
+#include <sys/types.h>
+
namespace document {
class FieldValue;
diff --git a/document/src/vespa/document/fieldvalue/mapfieldvalue.cpp b/document/src/vespa/document/fieldvalue/mapfieldvalue.cpp
index 262592588c7..531a3e5267c 100644
--- a/document/src/vespa/document/fieldvalue/mapfieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/mapfieldvalue.cpp
@@ -1,20 +1,18 @@
// 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/document/fieldvalue/mapfieldvalue.h>
+#include "mapfieldvalue.h"
+#include "arrayfieldvalue.h"
+#include "weightedsetfieldvalue.h"
#include <vespa/document/base/exceptions.h>
#include <vespa/document/util/bytebuffer.h>
-//#include <vespa/vespalib/util/exceptions.h>
#include <vespa/document/datatype/arraydatatype.h>
-#include <vespa/document/fieldvalue/arrayfieldvalue.h>
-#include <vespa/document/fieldvalue/weightedsetfieldvalue.h>
#include <vespa/vespalib/objects/identifiable.h>
-using vespalib::Identifiable;
-
+#include <vespa/log/log.h>
LOG_SETUP(".document.fieldvalue.map");
+using vespalib::Identifiable;
+
/// \todo TODO (was warning):
// Find a way to search through internal map without
// duplicating keys to create shared pointers.
diff --git a/document/src/vespa/document/fieldvalue/numericfieldvalue.cpp b/document/src/vespa/document/fieldvalue/numericfieldvalue.cpp
index 0e38b5c35f7..3d39544b3d0 100644
--- a/document/src/vespa/document/fieldvalue/numericfieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/numericfieldvalue.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/document/fieldvalue/numericfieldvalue.h>
+
+#include "numericfieldvalue.h"
namespace document {
diff --git a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp
index 0cb3969a9aa..36f1eabce84 100644
--- a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp
@@ -1,19 +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>
+#include "weightedsetfieldvalue.h"
#include <vespa/document/base/exceptions.h>
-#include <vespa/document/datatype/arraydatatype.h>
-#include <vespa/document/datatype/mapdatatype.h>
-#include <vespa/document/fieldvalue/arrayfieldvalue.h>
-#include <vespa/document/fieldvalue/weightedsetfieldvalue.h>
-#include <vespa/document/util/bytebuffer.h>
-#include <vespa/vespalib/objects/identifiable.h>
+#include <ostream>
using vespalib::Identifiable;
-LOG_SETUP(".document.fieldvalue.weightedset");
-
/// \todo TODO (was warning): Find a way to search through internal map without duplicating keys to create shared pointers.
namespace document {
@@ -216,7 +208,6 @@ WeightedSetFieldValue::onIterateNested(FieldPath::const_iterator start,
FieldPath::const_iterator end_,
IteratorHandler & handler) const
{
- LOG(spam, "iterating over WeightedSetFieldValue");
return _map.iterateNestedImpl(start, end_, handler, *this);
}
diff --git a/document/src/vespa/document/predicate/predicate.cpp b/document/src/vespa/document/predicate/predicate.cpp
index c3ae5fb8fb4..75648fcb4ba 100644
--- a/document/src/vespa/document/predicate/predicate.cpp
+++ b/document/src/vespa/document/predicate/predicate.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 "predicate.h"
#include <vespa/vespalib/data/slime/slime.h>
#include <algorithm>
diff --git a/document/src/vespa/document/predicate/predicate_builder.cpp b/document/src/vespa/document/predicate/predicate_builder.cpp
index 55a6ce4b3ce..dadeb4fae68 100644
--- a/document/src/vespa/document/predicate/predicate_builder.cpp
+++ b/document/src/vespa/document/predicate/predicate_builder.cpp
@@ -1,10 +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 "predicate.h"
#include "predicate_builder.h"
#include <vespa/vespalib/data/slime/inspector.h>
+#include <cassert>
using vespalib::slime::Inspector;
@@ -47,4 +46,11 @@ void PredicateBuilder::visitFalse(const Inspector &) {
_nodes.push_back(new FalsePredicate);
}
+std::unique_ptr<PredicateNode>
+PredicateBuilder::build(const vespalib::slime::Inspector &i) {
+ visit(i);
+ assert(_nodes.size() == 1);
+ return std::unique_ptr<PredicateNode>(_nodes.front());
+}
+
} // namespace document
diff --git a/document/src/vespa/document/predicate/predicate_builder.h b/document/src/vespa/document/predicate/predicate_builder.h
index 68fa0caa0dc..31bf9eb60fd 100644
--- a/document/src/vespa/document/predicate/predicate_builder.h
+++ b/document/src/vespa/document/predicate/predicate_builder.h
@@ -21,11 +21,7 @@ class PredicateBuilder : private PredicateSlimeVisitor {
virtual void visitFalse(const vespalib::slime::Inspector &i);
public:
- std::unique_ptr<PredicateNode> build(const vespalib::slime::Inspector &i) {
- visit(i);
- assert(_nodes.size() == 1);
- return std::unique_ptr<PredicateNode>(_nodes.front());
- }
+ std::unique_ptr<PredicateNode> build(const vespalib::slime::Inspector &i);
};
} // namespace document
diff --git a/document/src/vespa/document/predicate/predicate_slime_builder.cpp b/document/src/vespa/document/predicate/predicate_slime_builder.cpp
index e8740018679..bcdc3c700a2 100644
--- a/document/src/vespa/document/predicate/predicate_slime_builder.cpp
+++ b/document/src/vespa/document/predicate/predicate_slime_builder.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 "predicate.h"
#include "predicate_slime_builder.h"
diff --git a/document/src/vespa/document/predicate/predicate_slime_visitor.cpp b/document/src/vespa/document/predicate/predicate_slime_visitor.cpp
index 81cdd0606ad..9ae2e311dc2 100644
--- a/document/src/vespa/document/predicate/predicate_slime_visitor.cpp
+++ b/document/src/vespa/document/predicate/predicate_slime_visitor.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 "predicate.h"
#include "predicate_slime_visitor.h"
#include <vespa/vespalib/data/slime/inspector.h>
diff --git a/document/src/vespa/document/repo/configbuilder.cpp b/document/src/vespa/document/repo/configbuilder.cpp
index bbb03cd8ce3..19c5a389758 100644
--- a/document/src/vespa/document/repo/configbuilder.cpp
+++ b/document/src/vespa/document/repo/configbuilder.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 "configbuilder.h"
namespace document {
diff --git a/document/src/vespa/document/repo/fixedtyperepo.cpp b/document/src/vespa/document/repo/fixedtyperepo.cpp
index 414dc366c61..681b7a927db 100644
--- a/document/src/vespa/document/repo/fixedtyperepo.cpp
+++ b/document/src/vespa/document/repo/fixedtyperepo.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 "fixedtyperepo.h"
namespace document {
diff --git a/document/src/vespa/document/select/bodyfielddetector.cpp b/document/src/vespa/document/select/bodyfielddetector.cpp
index 4a749a64b93..d0ddd0043ef 100644
--- a/document/src/vespa/document/select/bodyfielddetector.cpp
+++ b/document/src/vespa/document/select/bodyfielddetector.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 "bodyfielddetector.h"
#include <vespa/document/base/exceptions.h>
#include <vespa/document/repo/documenttyperepo.h>
diff --git a/document/src/vespa/document/select/branch.cpp b/document/src/vespa/document/select/branch.cpp
index 90b9462f7b9..ddbad69b14d 100644
--- a/document/src/vespa/document/select/branch.cpp
+++ b/document/src/vespa/document/select/branch.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 "branch.h"
#include "visitor.h"
diff --git a/document/src/vespa/document/select/cloningvisitor.cpp b/document/src/vespa/document/select/cloningvisitor.cpp
index 2c25efad466..84188788416 100644
--- a/document/src/vespa/document/select/cloningvisitor.cpp
+++ b/document/src/vespa/document/select/cloningvisitor.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 "cloningvisitor.h"
#include "valuenode.h"
#include "branch.h"
@@ -9,12 +8,9 @@
#include "invalidconstant.h"
#include "doctype.h"
+namespace document {
-namespace document
-{
-
-namespace select
-{
+namespace select {
const int CloningVisitor::OrPriority;
const int CloningVisitor::AndPriority;
@@ -40,20 +36,17 @@ const int CloningVisitor::NullValPriority;
const int CloningVisitor::IdPriority;
const int CloningVisitor::SearchColPriority;
-CloningVisitor::CloningVisitor(void)
+CloningVisitor::CloningVisitor()
: _node(),
_valueNode(),
_constVal(false),
_priority(-1),
_fieldNodes(0u),
_resultSet()
-{
-}
+{ }
-CloningVisitor::~CloningVisitor(void)
-{
-}
+CloningVisitor::~CloningVisitor() { }
void
diff --git a/document/src/vespa/document/select/cloningvisitor.h b/document/src/vespa/document/select/cloningvisitor.h
index 9a513eaa082..45101f39dc8 100644
--- a/document/src/vespa/document/select/cloningvisitor.h
+++ b/document/src/vespa/document/select/cloningvisitor.h
@@ -3,12 +3,11 @@
#include "visitor.h"
#include "resultset.h"
+#include <memory>
-namespace document
-{
+namespace document {
-namespace select
-{
+namespace select {
class Node;
class ValueNode;
diff --git a/document/src/vespa/document/select/compare.cpp b/document/src/vespa/document/select/compare.cpp
index 47f9443a85a..6f4336603c3 100644
--- a/document/src/vespa/document/select/compare.cpp
+++ b/document/src/vespa/document/select/compare.cpp
@@ -1,14 +1,13 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "compare.h"
-#include <ostream>
-#include <vespa/document/datatype/datatype.h>
+#include "compare.h"
#include "valuenode.h"
-#include <vespa/document/fieldvalue/document.h>
-#include <vespa/document/util/stringutil.h>
#include "compare.h"
#include "visitor.h"
+#include <vespa/document/datatype/datatype.h>
+#include <vespa/document/fieldvalue/document.h>
+#include <vespa/document/util/stringutil.h>
+#include <ostream>
namespace document {
namespace select {
diff --git a/document/src/vespa/document/select/constant.cpp b/document/src/vespa/document/select/constant.cpp
index f12e7bd6739..686ab05055c 100644
--- a/document/src/vespa/document/select/constant.cpp
+++ b/document/src/vespa/document/select/constant.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 "constant.h"
#include "visitor.h"
diff --git a/document/src/vespa/document/select/doctype.cpp b/document/src/vespa/document/select/doctype.cpp
index b6683fe1d8f..3c23b2e5ba1 100644
--- a/document/src/vespa/document/select/doctype.cpp
+++ b/document/src/vespa/document/select/doctype.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 "doctype.h"
#include "visitor.h"
diff --git a/document/src/vespa/document/select/invalidconstant.cpp b/document/src/vespa/document/select/invalidconstant.cpp
index 3573f83541d..793e34c7bc5 100644
--- a/document/src/vespa/document/select/invalidconstant.cpp
+++ b/document/src/vespa/document/select/invalidconstant.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 "invalidconstant.h"
#include "visitor.h"
@@ -8,8 +8,7 @@ namespace select {
InvalidConstant::InvalidConstant(const vespalib::stringref & value)
: Node(value)
-{
-}
+{ }
ResultList
InvalidConstant::trace(const Context&, std::ostream& ost) const
diff --git a/document/src/vespa/document/select/orderingselector.cpp b/document/src/vespa/document/select/orderingselector.cpp
index dd4583a9bfa..8875b09f848 100644
--- a/document/src/vespa/document/select/orderingselector.cpp
+++ b/document/src/vespa/document/select/orderingselector.cpp
@@ -1,16 +1,16 @@
// 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 "orderingselector.h"
-#include <algorithm>
-#include <vespa/document/base/documentid.h>
-#include <vespa/document/base/idstring.h>
+#include "orderingselector.h"
#include "node.h"
#include "valuenode.h"
#include "visitor.h"
#include "compare.h"
#include "branch.h"
+#include <algorithm>
+#include <vespa/document/base/documentid.h>
+#include <vespa/document/base/idstring.h>
+
namespace document {
using namespace document::select;
diff --git a/document/src/vespa/document/select/orderingspecification.cpp b/document/src/vespa/document/select/orderingspecification.cpp
index 7188c339beb..9af3c52c1eb 100644
--- a/document/src/vespa/document/select/orderingspecification.cpp
+++ b/document/src/vespa/document/select/orderingspecification.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 "orderingspecification.h"
#include <vespa/vespalib/stllike/asciistream.h>
diff --git a/document/src/vespa/document/select/parser.cpp b/document/src/vespa/document/select/parser.cpp
index 0dc9c1f1376..526eed25164 100644
--- a/document/src/vespa/document/select/parser.cpp
+++ b/document/src/vespa/document/select/parser.cpp
@@ -1,28 +1,27 @@
// 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 "parser.h"
+#include "branch.h"
+#include "compare.h"
+#include "constant.h"
+#include "operator.h"
+#include "doctype.h"
+#include "valuenode.h"
+#include "simpleparser.h"
+#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/base/exceptions.h>
+#include <vespa/document/util/stringutil.h>
+#include <vespa/vespalib/stllike/asciistream.h>
#include <boost/spirit/include/classic_chset.hpp>
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_escape_char.hpp>
#include <boost/spirit/include/classic_grammar_def.hpp>
#include <boost/spirit/include/classic_parse_tree.hpp>
#include <boost/spirit/include/classic_tree_to_xml.hpp>
-#include <vespa/document/repo/documenttyperepo.h>
#include <iostream>
#include <map>
#include <sstream>
-#include <vespa/document/base/exceptions.h>
-#include "branch.h"
-#include "compare.h"
-#include "constant.h"
-#include "operator.h"
-#include "doctype.h"
-#include "valuenode.h"
-#include "simpleparser.h"
-#include <vespa/document/util/stringutil.h>
-#include <vespa/vespalib/stllike/asciistream.h>
using boost::spirit::classic::tree_node;
using document::DocumentTypeRepo;
diff --git a/document/src/vespa/document/select/result.cpp b/document/src/vespa/document/select/result.cpp
index ebdecc4dd03..bc8a830afcb 100644
--- a/document/src/vespa/document/select/result.cpp
+++ b/document/src/vespa/document/select/result.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 "result.h"
#include <ostream>
diff --git a/document/src/vespa/document/select/resultset.cpp b/document/src/vespa/document/select/resultset.cpp
index 7c8f3b91104..f7fd3e95fbd 100644
--- a/document/src/vespa/document/select/resultset.cpp
+++ b/document/src/vespa/document/select/resultset.cpp
@@ -1,12 +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 "resultset.h"
-namespace document
-{
+namespace document {
-namespace select
-{
+namespace select {
std::vector<ResultSet> ResultSet::_ands;
std::vector<ResultSet> ResultSet::_ors;
diff --git a/document/src/vespa/document/select/simpleparser.cpp b/document/src/vespa/document/select/simpleparser.cpp
index e4c6748ca25..85d53854b93 100644
--- a/document/src/vespa/document/select/simpleparser.cpp
+++ b/document/src/vespa/document/select/simpleparser.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 "simpleparser.h"
#include "compare.h"
diff --git a/document/src/vespa/document/select/traversingvisitor.cpp b/document/src/vespa/document/select/traversingvisitor.cpp
index ffd840bd9fa..7f85d8b7ebb 100644
--- a/document/src/vespa/document/select/traversingvisitor.cpp
+++ b/document/src/vespa/document/select/traversingvisitor.cpp
@@ -1,16 +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 "traversingvisitor.h"
#include "valuenode.h"
#include "branch.h"
#include "compare.h"
-namespace document
-{
+namespace document {
-namespace select
-{
+namespace select {
void
TraversingVisitor::visitAndBranch(const And &expr)
diff --git a/document/src/vespa/document/select/value.cpp b/document/src/vespa/document/select/value.cpp
index c140cf5d373..7638ba3c36e 100644
--- a/document/src/vespa/document/select/value.cpp
+++ b/document/src/vespa/document/select/value.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 "value.h"
#include "operator.h"
-#include <stdint.h>
+#include <cstdint>
namespace document {
namespace select {
diff --git a/document/src/vespa/document/serialization/annotationserializer.cpp b/document/src/vespa/document/serialization/annotationserializer.cpp
index e78cea83d00..ce3d5b7cc8f 100644
--- a/document/src/vespa/document/serialization/annotationserializer.cpp
+++ b/document/src/vespa/document/serialization/annotationserializer.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 "annotationserializer.h"
#include "util.h"
#include "vespadocumentserializer.h"
diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
index 536d9366e1b..71727178f6d 100644
--- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
@@ -1,11 +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/log/log.h>
-LOG_SETUP(".vespadocumentserializer");
-
#include "vespadocumentserializer.h"
-
#include "annotationserializer.h"
#include "slime_output_to_vector.h"
#include "util.h"
@@ -132,7 +127,6 @@ void VespaDocumentSerializer::write(const Document &value,
// _either_ for the header _or_ for the body, never a mixture!
// This is to avoid horrible breakage whilst ripping out old guts.
const StructFieldValue::Chunks & chunks = value.getFields().getChunks();
- LOG(spam, "Writing %zu chunks unchanged", chunks.size());
if (hasHeader) {
assert(chunks.size() >= 1);
doc_serializer.writeUnchanged(chunks[0]);
@@ -357,7 +351,6 @@ void VespaDocumentSerializer::write(const StructFieldValue &value,
vector<pair<uint32_t, uint32_t> > field_info;
serializeFields(value, value_stream, field_info, fieldSet);
if (field_info.empty()) {
- LOG(debug, "Not writing struct since it has no fields");
return;
}
diff --git a/document/src/vespa/document/update/fieldupdate.cpp b/document/src/vespa/document/update/fieldupdate.cpp
index 8ae2da9ac02..900dceec17f 100644
--- a/document/src/vespa/document/update/fieldupdate.cpp
+++ b/document/src/vespa/document/update/fieldupdate.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 "fieldupdate.h"
#include <vespa/document/base/exceptions.h>
#include <vespa/document/fieldvalue/document.h>
-#include <vespa/document/update/fieldupdate.h>
namespace document {
diff --git a/document/src/vespa/document/update/removefieldpathupdate.cpp b/document/src/vespa/document/update/removefieldpathupdate.cpp
index 6d75e0b4e45..6c9d60abd2f 100644
--- a/document/src/vespa/document/update/removefieldpathupdate.cpp
+++ b/document/src/vespa/document/update/removefieldpathupdate.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 "removefieldpathupdate.h"
#include <vespa/document/fieldvalue/fieldvalues.h>
#include <vespa/document/select/parser.h>
-#include <vespa/document/update/removefieldpathupdate.h>
namespace document {
diff --git a/document/src/vespa/document/update/valueupdate.cpp b/document/src/vespa/document/update/valueupdate.cpp
index 6286c67b7fa..8d86420072b 100644
--- a/document/src/vespa/document/update/valueupdate.cpp
+++ b/document/src/vespa/document/update/valueupdate.cpp
@@ -1,19 +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 "valueupdate.h"
+#include <vespa/vespalib/util/stringfmt.h>
#include <stdexcept>
-#include <vespa/document/base/field.h>
-#include <vespa/document/fieldvalue/fieldvalue.h>
-#include <vespa/document/fieldvalue/document.h>
-#include <vespa/document/update/addvalueupdate.h>
-#include <vespa/document/update/arithmeticvalueupdate.h>
-#include <vespa/document/update/assignvalueupdate.h>
-#include <vespa/document/update/clearvalueupdate.h>
-#include <vespa/document/update/mapvalueupdate.h>
-#include <vespa/document/update/removevalueupdate.h>
-#include <vespa/document/util/serializable.h>
-namespace document
-{
+namespace document {
IMPLEMENT_IDENTIFIABLE_ABSTRACT(ValueUpdate, Identifiable);
diff --git a/document/src/vespa/document/util/compressor.cpp b/document/src/vespa/document/util/compressor.cpp
index 1f4a8228032..265c92721ff 100644
--- a/document/src/vespa/document/util/compressor.cpp
+++ b/document/src/vespa/document/util/compressor.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 <vespa/document/util/compressor.h>
+#include "compressor.h"
#include <vespa/vespalib/util/memory.h>
-#include <vespa/vespalib/util/linkedptr.h>
-#include <vespa/vespalib/util/sync.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <stdexcept>
#include <lz4.h>
diff --git a/document/src/vespa/document/util/printable.cpp b/document/src/vespa/document/util/printable.cpp
index 53560d666f9..b7a56152dfa 100644
--- a/document/src/vespa/document/util/printable.cpp
+++ b/document/src/vespa/document/util/printable.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/document/util/printable.h>
+
+#include "printable.h"
#include <sstream>
namespace document {
diff --git a/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp b/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp
index 42e62a958fa..68bae5e57d8 100644
--- a/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp
+++ b/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp
@@ -3,6 +3,7 @@
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/util/fileheadertk.h>
#include <vespa/vespalib/stllike/asciistream.h>
+#include <vespa/fastos/file.h>
using namespace search;
using namespace vespalib;
diff --git a/staging_vespalib/src/tests/stllike/lrucache.cpp b/staging_vespalib/src/tests/stllike/lrucache.cpp
index bc89325b4ad..d068668083f 100644
--- a/staging_vespalib/src/tests/stllike/lrucache.cpp
+++ b/staging_vespalib/src/tests/stllike/lrucache.cpp
@@ -3,6 +3,7 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/lrucache_map.hpp>
+#include <vespa/vespalib/util/linkedptr.h>
using namespace vespalib;
diff --git a/vbench/src/vbench/core/socket.h b/vbench/src/vbench/core/socket.h
index 4a281555bec..52c27dfc618 100644
--- a/vbench/src/vbench/core/socket.h
+++ b/vbench/src/vbench/core/socket.h
@@ -7,6 +7,8 @@
#include "simple_buffer.h"
#include <memory>
+class FastOS_SocketInterface;
+
namespace vbench {
class Socket : public Stream
diff --git a/vbench/src/vbench/test/server_socket.h b/vbench/src/vbench/test/server_socket.h
index af3a3365309..6be9673142f 100644
--- a/vbench/src/vbench/test/server_socket.h
+++ b/vbench/src/vbench/test/server_socket.h
@@ -4,6 +4,7 @@
#pragma once
#include <vbench/core/stream.h>
+#include <vespa/fastos/serversocket.h>
namespace vbench {
diff --git a/vdslib/src/tests/distribution/distributiontest.cpp b/vdslib/src/tests/distribution/distributiontest.cpp
index 868e57cab2b..8886d06ca69 100644
--- a/vdslib/src/tests/distribution/distributiontest.cpp
+++ b/vdslib/src/tests/distribution/distributiontest.cpp
@@ -15,6 +15,7 @@
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/config-stor-distribution.h>
#include <vespa/config/helper/configgetter.hpp>
+#include <vespa/fastos/file.h>
namespace storage {
diff --git a/vespalib/src/vespa/vespalib/net/server_socket.cpp b/vespalib/src/vespa/vespalib/net/server_socket.cpp
index f97e974ca46..1b026cfa7d4 100644
--- a/vespalib/src/vespa/vespalib/net/server_socket.cpp
+++ b/vespalib/src/vespa/vespalib/net/server_socket.cpp
@@ -1,7 +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 "server_socket.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/net/socket.cpp b/vespalib/src/vespa/vespalib/net/socket.cpp
index c98199fc2f0..23a4e5f9765 100644
--- a/vespalib/src/vespa/vespalib/net/socket.cpp
+++ b/vespalib/src/vespa/vespalib/net/socket.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 "socket.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/net/socket_handle.cpp b/vespalib/src/vespa/vespalib/net/socket_handle.cpp
index 04af33b5561..3e8afa66584 100644
--- a/vespalib/src/vespa/vespalib/net/socket_handle.cpp
+++ b/vespalib/src/vespa/vespalib/net/socket_handle.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 "socket_handle.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/testkit/create-test.sh b/vespalib/src/vespa/vespalib/testkit/create-test.sh
index 4d02c184c98..6aaeb598782 100755
--- a/vespalib/src/vespa/vespalib/testkit/create-test.sh
+++ b/vespalib/src/vespa/vespalib/testkit/create-test.sh
@@ -22,7 +22,6 @@ gen_project_file() {
gen_source() {
echo "generating '$1' ..."
- echo "#include <vespa/fastos/fastos.h>" >> $1
echo "#include <vespa/vespalib/testkit/testapp.h>" >> $1
echo "" >> $1
echo "TEST_SETUP(Test);" >> $1
diff --git a/vespalib/src/vespa/vespalib/testkit/test_comparators.cpp b/vespalib/src/vespa/vespalib/testkit/test_comparators.cpp
index 51641fe5e78..5a1edf4699c 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_comparators.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_comparators.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 "test_comparators.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/testkit/test_hook.cpp b/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
index b70c14ffe2b..ac051e03217 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_hook.cpp
@@ -1,10 +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 "test_hook.h"
-#include "test_master.h"
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/util/regexp.h>
+#include <vespa/fastos/thread.h>
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/testkit/test_kit.h b/vespalib/src/vespa/vespalib/testkit/test_kit.h
index 2439e0caf1e..57c6f7b05b8 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_kit.h
+++ b/vespalib/src/vespa/vespalib/testkit/test_kit.h
@@ -3,7 +3,6 @@
#pragma once
#include <memory>
-#include <vespa/fastos/fastos.h>
#include "test_macros.h"
#include "test_comparators.h"
#include "test_master.h"
diff --git a/vespalib/src/vespa/vespalib/testkit/test_macros.h b/vespalib/src/vespa/vespalib/testkit/test_macros.h
index fd0e8a981e0..f0a33d5f15c 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_macros.h
+++ b/vespalib/src/vespa/vespalib/testkit/test_macros.h
@@ -2,6 +2,8 @@
#pragma once
+#include <vespa/fastos/app.h>
+
#define TEST_STR(str) #str
#define TEST_CAT_IMPL(a, b) a ## b
#define TEST_CAT(a, b) TEST_CAT_IMPL(a, b)
diff --git a/vespalib/src/vespa/vespalib/testkit/test_master.cpp b/vespalib/src/vespa/vespalib/testkit/test_master.cpp
index 5c3326bbe9d..45906294a99 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_master.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_master.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.
-#include <vespa/fastos/fastos.h>
#include "test_master.h"
+#include <vespa/vespalib/util/barrier.h>
namespace vespalib {
@@ -35,9 +35,8 @@ TestMaster::threadState(const vespalib::LockGuard &)
if (_threadState == 0) {
std::ostringstream threadName;
threadName << "thread-" << _threadStorage.size();
- vespalib::LinkedPtr<ThreadState> thread(new ThreadState(threadName.str()));
- _threadStorage.push_back(thread);
- _threadState = thread.get();
+ _threadStorage.push_back(std::make_unique<ThreadState>(threadName.str()));
+ _threadState = _threadStorage.back().get();
}
return *_threadState;
}
diff --git a/vespalib/src/vespa/vespalib/testkit/test_master.h b/vespalib/src/vespa/vespalib/testkit/test_master.h
index 523c9bd8eec..369b3ea918e 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_master.h
+++ b/vespalib/src/vespa/vespalib/testkit/test_master.h
@@ -3,13 +3,14 @@
#pragma once
#include <vespa/vespalib/util/sync.h>
-#include <vespa/vespalib/util/barrier.h>
-#include <vespa/vespalib/util/linkedptr.h>
#include <string>
#include <vector>
+#include <memory>
namespace vespalib {
+class Barrier;
+
#ifndef IAM_DOXYGEN
/**
* The master of testing.
@@ -71,7 +72,7 @@ private:
std::string _name;
std::string _path_prefix;
SharedState _state;
- std::vector<vespalib::LinkedPtr<ThreadState> > _threadStorage;
+ std::vector<std::unique_ptr<ThreadState> > _threadStorage;
private:
ThreadState &threadState(const vespalib::LockGuard &);
diff --git a/vespalib/src/vespa/vespalib/testkit/test_state_guard.cpp b/vespalib/src/vespa/vespalib/testkit/test_state_guard.cpp
index 0c26d88b1df..18bd6966b8a 100644
--- a/vespalib/src/vespa/vespalib/testkit/test_state_guard.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/test_state_guard.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 "test_state_guard.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/testkit/testapp.cpp b/vespalib/src/vespa/vespalib/testkit/testapp.cpp
index a4bb01e525c..207e5a18bed 100644
--- a/vespalib/src/vespa/vespalib/testkit/testapp.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/testapp.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 "testapp.h"
namespace vespalib {
@@ -10,12 +9,9 @@ TestMaster &TestApp::master(TestMaster::master);
TestApp::TestApp()
: FastOS_Application(),
_name("<unnamed>")
-{
-}
+{ }
-TestApp::~TestApp()
-{
-}
+TestApp::~TestApp() { }
void
TestApp::ReportInit(const char *name)
diff --git a/vespalib/src/vespa/vespalib/testkit/testapp.h b/vespalib/src/vespa/vespalib/testkit/testapp.h
index 5a06736c870..39b2cbcaa0b 100644
--- a/vespalib/src/vespa/vespalib/testkit/testapp.h
+++ b/vespalib/src/vespa/vespalib/testkit/testapp.h
@@ -2,6 +2,7 @@
#pragma once
#include "test_kit.h"
+#include <vespa/fastos/app.h>
#undef TEST_MASTER
#define TEST_MASTER vespalib::TestApp::master
@@ -144,7 +145,6 @@ namespace vespalib {
*
* Simple test example:
* <pre>
- * \#include <vespa/fastos/fastos.h>
* \#include <vespa/vespalib/testkit/testapp.h>
*
* TEST_SETUP(Test)
diff --git a/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp b/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp
index 28cd638e724..284b0c4ffa7 100644
--- a/vespalib/src/vespa/vespalib/testkit/time_bomb.cpp
+++ b/vespalib/src/vespa/vespalib/testkit/time_bomb.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 "time_bomb.h"
namespace vespalib {
diff --git a/vespalib/src/vespa/vespalib/websocket/server_socket.h b/vespalib/src/vespa/vespalib/websocket/server_socket.h
index 20e98c1f76c..664056d82dc 100644
--- a/vespalib/src/vespa/vespalib/websocket/server_socket.h
+++ b/vespalib/src/vespa/vespalib/websocket/server_socket.h
@@ -4,6 +4,7 @@
#pragma once
#include "socket.h"
+#include <vespa/fastos/serversocket.h>
namespace vespalib {
namespace ws {
diff --git a/vespalib/src/vespa/vespalib/websocket/socket.cpp b/vespalib/src/vespa/vespalib/websocket/socket.cpp
index c8bf1ec31f8..3bdea494201 100644
--- a/vespalib/src/vespa/vespalib/websocket/socket.cpp
+++ b/vespalib/src/vespa/vespalib/websocket/socket.cpp
@@ -1,13 +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 "socket.h"
+#include <vespa/fastos/socket.h>
namespace vespalib {
namespace ws {
-Socket::Socket(std::unique_ptr<FastOS_Socket> socket)
+Socket::Socket(std::unique_ptr<FastOS_SocketInterface> socket)
: _socket(std::move(socket))
{
}
diff --git a/vespalib/src/vespa/vespalib/websocket/socket.h b/vespalib/src/vespa/vespalib/websocket/socket.h
index 22391386467..cced2a8b505 100644
--- a/vespalib/src/vespa/vespalib/websocket/socket.h
+++ b/vespalib/src/vespa/vespalib/websocket/socket.h
@@ -6,17 +6,19 @@
#include <memory>
#include <vespa/vespalib/stllike/string.h>
+class FastOS_SocketInterface;
+
namespace vespalib {
namespace ws {
class Socket
{
private:
- std::unique_ptr<FastOS_Socket> _socket;
+ std::unique_ptr<FastOS_SocketInterface> _socket;
public:
typedef std::unique_ptr<Socket> UP;
- Socket(std::unique_ptr<FastOS_Socket> socket);
+ Socket(std::unique_ptr<FastOS_SocketInterface> socket);
Socket(const vespalib::string &host, int port);
virtual ~Socket();
ssize_t read(char *buf, size_t len);