aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-04-18 10:05:45 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-04-23 14:03:14 +0200
commite8b3a767a47daa723eb66feecda1bfd99f3fc225 (patch)
tree88a1f3dbef9f80c12162e56c366782a2c31e36d9 /searchlib
parentd781938ec3beb5f8158333c0e46b6b1bb88156c5 (diff)
override and optimise includes.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createarraystd.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsetstd.cpp15
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp25
-rw-r--r--searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp13
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumattribute.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericattribute.h1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multivalueattribute.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/numericbase.h3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singleenumattribute.h8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.h29
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp3
12 files changed, 47 insertions, 64 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp b/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp
index 29ea819f71d..0c312a6fe6a 100644
--- a/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/createarraystd.cpp
@@ -2,15 +2,11 @@
#include "attributefactory.h"
#include "defines.h"
-
#include "attributevector.hpp"
#include "multivalueattribute.hpp"
#include "multinumericattribute.hpp"
#include "multistringattribute.h"
-#include <vespa/log/log.h>
-LOG_SETUP(".createarraystd");
-
namespace search {
using attribute::BasicType;
diff --git a/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp b/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp
index 5aa40a20d14..721af2891e3 100644
--- a/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/createsetstd.cpp
@@ -1,16 +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/searchlib/attribute/attributefactory.h>
+#include "attributefactory.h"
#include "defines.h"
-
-#include <vespa/log/log.h>
-LOG_SETUP(".createsetstd");
-
-#include <vespa/searchlib/attribute/attributevector.hpp>
-#include <vespa/searchlib/attribute/multivalueattribute.hpp>
-#include <vespa/searchlib/attribute/multinumericattribute.hpp>
-#include <vespa/searchlib/attribute/multistringattribute.h>
+#include "attributevector.hpp"
+#include "multivalueattribute.hpp"
+#include "multinumericattribute.hpp"
+#include "multistringattribute.h"
namespace search {
diff --git a/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp b/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp
index 02890eb8789..ad08e20808a 100644
--- a/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/createsinglefastsearch.cpp
@@ -1,21 +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 <vespa/searchlib/attribute/attributefactory.h>
-#include <vespa/searchlib/attribute/integerbase.h>
-#include <vespa/searchlib/attribute/floatbase.h>
+#include "attributefactory.h"
+#include "integerbase.h"
+#include "floatbase.h"
#include "defines.h"
-
-#include <vespa/log/log.h>
-LOG_SETUP(".createsinglefastsearch");
-
-#include <vespa/searchlib/attribute/singlestringattribute.h>
-#include <vespa/searchlib/attribute/singlestringpostattribute.hpp>
-#include <vespa/searchlib/attribute/singlenumericenumattribute.hpp>
-#include <vespa/searchlib/attribute/singlenumericpostattribute.hpp>
-#include <vespa/searchlib/attribute/enumstore.hpp>
-#include <vespa/searchlib/attribute/enumattribute.hpp>
-#include <vespa/searchlib/attribute/singleenumattribute.hpp>
+#include "singlestringattribute.h"
+#include "singlestringpostattribute.hpp"
+#include "singlenumericenumattribute.hpp"
+#include "singlenumericpostattribute.hpp"
+#include "enumstore.hpp"
+#include "enumattribute.hpp"
+#include "singleenumattribute.hpp"
#define INTPOSTING(T) SingleValueNumericPostingAttribute< ENUM_ATTRIBUTE(IntegerAttributeTemplate<T>) >
#define FLOATPOSTING(T) SingleValueNumericPostingAttribute< ENUM_ATTRIBUTE(FloatingPointAttributeTemplate<T>) >
diff --git a/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp b/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp
index 766195c8e9c..c3a126631e6 100644
--- a/searchlib/src/vespa/searchlib/attribute/createsinglestd.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/createsinglestd.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 <vespa/fastos/fastos.h>
-#include <vespa/searchlib/attribute/attributefactory.h>
-
-#include <vespa/log/log.h>
-LOG_SETUP(".createsinglestd");
-
+#include "attributefactory.h"
#include "predicate_attribute.h"
#include "singlesmallnumericattribute.h"
#include "reference_attribute.h"
-#include <vespa/searchlib/attribute/attributevector.hpp>
-#include <vespa/searchlib/attribute/singlenumericattribute.hpp>
-#include <vespa/searchlib/attribute/singlestringattribute.h>
+#include "attributevector.hpp"
+#include "singlenumericattribute.hpp"
+#include "singlestringattribute.h"
#include <vespa/searchlib/tensor/generic_tensor_attribute.h>
#include <vespa/searchlib/tensor/dense_tensor_attribute.h>
diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.h b/searchlib/src/vespa/searchlib/attribute/enumattribute.h
index 8cc383d4abf..ca5058c71d3 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.h
@@ -61,7 +61,7 @@ protected:
virtual EnumType getFromEnum(EnumHandle e) const { return _enumStore.getValue(e); }
virtual void fillPostings(LoadedVector & loaded) { (void) loaded; }
- void fillEnum(LoadedVector & loaded);
+ void fillEnum(LoadedVector & loaded) override;
void fillEnum0(const void *src, size_t srcLen, EnumIndexVector &eidxs) override;
void fixupEnumRefCounts(const EnumVector &enumHist) override;
uint64_t getUniqueValueCount(void) const override;
diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
index 6afede8d3b4..01d9efe0cbc 100644
--- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
@@ -256,4 +256,3 @@ public:
};
}
-
diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
index 12b1098bbb3..e02a81e44ef 100644
--- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
@@ -3,7 +3,6 @@
#pragma once
#include "multi_value_mapping.h"
-#include <vespa/vespalib/stllike/string.h>
#include "attributevector.h"
namespace search {
@@ -48,7 +47,7 @@ protected:
* Can be overridden by subclasses that need to resize structures as a result of this.
* Should return true if underlying structures were resized.
**/
- virtual bool onAddDoc(DocId doc) override { (void) doc; return false; }
+ bool onAddDoc(DocId doc) override { (void) doc; return false; }
AddressSpace getMultiValueAddressSpaceUsage() const override;
@@ -74,4 +73,3 @@ public:
};
} // namespace search
-
diff --git a/searchlib/src/vespa/searchlib/attribute/numericbase.h b/searchlib/src/vespa/searchlib/attribute/numericbase.h
index 94bc5c1472d..2554102b511 100644
--- a/searchlib/src/vespa/searchlib/attribute/numericbase.h
+++ b/searchlib/src/vespa/searchlib/attribute/numericbase.h
@@ -4,7 +4,7 @@
#include "attributevector.h"
#include <vespa/searchlib/common/sort.h>
-#include <vespa/searchlib/attribute/enumstorebase.h>
+#include "enumstorebase.h"
#include "loadedenumvalue.h"
namespace search {
@@ -28,6 +28,7 @@ protected:
virtual void fillEnumIdx(ReaderBase &attrReader, const EnumIndexVector &eidxs, EnumVector &enumHist);
virtual void fillPostingsFixupEnum(const attribute::LoadedEnumAttributeVector &loaded);
virtual void fixupEnumRefCounts(const EnumVector &enumHist);
+ virtual bool onAddDoc(DocId) { return true; }
template<typename T>
class Equal
diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h
index 1843bde4d54..a835aa85896 100644
--- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h
@@ -2,7 +2,7 @@
#pragma once
-#include <vespa/searchlib/attribute/enumattribute.h>
+#include "enumattribute.h"
#include <vespa/searchlib/common/rcuvector.h>
namespace search {
@@ -83,7 +83,8 @@ protected:
}
virtual void mergeMemoryStats(MemoryUsage & total) { (void) total; }
- virtual void fillValues(LoadedVector & loaded) override;
+
+ void fillValues(LoadedVector & loaded) override;
void fillEnumIdx(ReaderBase &attrReader,
const EnumStoreBase::IndexVector &eidxs,
@@ -101,7 +102,7 @@ protected:
*
* Should return true if underlying structures were resized.
**/
- virtual bool onAddDoc(DocId doc) override;
+ bool onAddDoc(DocId doc) override;
public:
SingleValueEnumAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & cfg);
@@ -136,4 +137,3 @@ public:
};
} // namespace search
-
diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
index c798351211a..4b19f8d1af0 100644
--- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
@@ -2,8 +2,8 @@
#pragma once
-#include <vespa/searchlib/attribute/singleenumattribute.h>
-#include <vespa/searchlib/attribute/enumattribute.hpp>
+#include "singleenumattribute.h"
+#include "enumattribute.hpp"
#include "ipostinglistattributebase.h"
#include "singleenumattributesaver.h"
#include "load_utils.h"
diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.h b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.h
index 828c1434819..369fbf77f0b 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.h
@@ -46,9 +46,9 @@ private:
protected:
// from SingleValueEnumAttribute
- virtual void considerUpdateAttributeChange(const Change & c);
- virtual void considerArithmeticAttributeChange(const Change & c, UniqueSet & newUniques);
- virtual void applyArithmeticValueChange(const Change & c, EnumStoreBase::IndexVector & unused);
+ void considerUpdateAttributeChange(const Change & c) override;
+ void considerArithmeticAttributeChange(const Change & c, UniqueSet & newUniques) override;
+ void applyArithmeticValueChange(const Change & c, EnumStoreBase::IndexVector & unused) override;
/*
* Specialization of SearchContext
@@ -92,9 +92,10 @@ public:
const AttributeVector::Config & c =
AttributeVector::Config(AttributeVector::BasicType::fromType(T()),
attribute::CollectionType::SINGLE));
+ ~SingleValueNumericEnumAttribute();
- virtual void onCommit();
- virtual bool onLoad();
+ void onCommit() override;
+ bool onLoad() override;
bool onLoadEnumerated(ReaderBase &attrReader);
@@ -104,46 +105,46 @@ public:
//-------------------------------------------------------------------------
// Attribute read API
//-------------------------------------------------------------------------
- virtual T get(DocId doc) const {
+ T get(DocId doc) const override {
return this->_enumStore.getValue(this->_enumIndices[doc]);
}
- virtual largeint_t getInt(DocId doc) const {
+ largeint_t getInt(DocId doc) const override {
return static_cast<largeint_t>(get(doc));
}
- virtual double getFloat(DocId doc) const {
+ double getFloat(DocId doc) const override {
return static_cast<double>(get(doc));
}
- virtual uint32_t getAll(DocId doc, T * v, uint32_t sz) const {
+ uint32_t getAll(DocId doc, T * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = get(doc);
}
return 1;
}
- virtual uint32_t get(DocId doc, largeint_t * v, uint32_t sz) const {
+ uint32_t get(DocId doc, largeint_t * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = getInt(doc);
}
return 1;
}
- virtual uint32_t get(DocId doc, double * v, uint32_t sz) const {
+ uint32_t get(DocId doc, double * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = getFloat(doc);
}
return 1;
}
- virtual uint32_t getAll(DocId doc, Weighted * v, uint32_t sz) const {
+ uint32_t getAll(DocId doc, Weighted * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = Weighted(get(doc));
}
return 1;
}
- virtual uint32_t get(DocId doc, WeightedInt * v, uint32_t sz) const {
+ uint32_t get(DocId doc, WeightedInt * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = WeightedInt(getInt(doc));
}
return 1;
}
- virtual uint32_t get(DocId doc, WeightedFloat * v, uint32_t sz) const {
+ uint32_t get(DocId doc, WeightedFloat * v, uint32_t sz) const override {
if (sz > 0) {
v[0] = WeightedFloat(getFloat(doc));
}
diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
index fbf56440a08..698bdbf82d4 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
@@ -64,6 +64,9 @@ SingleValueNumericEnumAttribute(const vespalib::string & baseFileName,
}
template <typename B>
+SingleValueNumericEnumAttribute<B>::~SingleValueNumericEnumAttribute() {}
+
+template <typename B>
void
SingleValueNumericEnumAttribute<B>::onCommit()
{