aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-08-22 09:19:08 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-08-22 10:53:12 +0000
commit55baedfd0f39397ddaf78ada8df864a31fff6eb2 (patch)
tree7b03f47aa38c8435f5962db488425dcc460ec068 /searchlib
parente285036450780d6aae7eea07667daff2d80062ff (diff)
Change typedef -> using, and remove unused ones.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp15
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h65
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h69
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp19
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistattribute.h47
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h58
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h66
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp2
10 files changed, 159 insertions, 186 deletions
diff --git a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
index 620708f8c9b..2d91ac7c689 100644
--- a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
+++ b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
@@ -452,9 +452,8 @@ PostingListAttributeTest::checkPostingList(const VectorType & vec, const std::ve
const uint32_t docBegin = range.getBegin(i);
const uint32_t docEnd = range.getEnd(i);
- typename VectorType::DictionaryIterator itr =
- dict.find(typename VectorType::EnumIndex(),
- typename VectorType::ComparatorType(enumStore, values[i]));
+ auto itr = dict.find(typename VectorType::EnumIndex(),
+ typename VectorType::ComparatorType(enumStore, values[i]));
ASSERT_TRUE(itr.valid());
typename VectorType::PostingList::Iterator postings;
@@ -672,9 +671,8 @@ PostingListAttributeTest::checkPostingList(AttributeType & vec, ValueType value,
const typename AttributeType::EnumStore & enumStore = vec.getEnumStore();
const typename AttributeType::Dictionary & dict = enumStore.getPostingDictionary();
const typename AttributeType::PostingList & postingList = vec.getPostingList();
- typename AttributeType::DictionaryIterator itr =
- dict.find(typename AttributeType::EnumIndex(),
- typename AttributeType::ComparatorType(vec.getEnumStore(), value));
+ auto itr = dict.find(typename AttributeType::EnumIndex(),
+ typename AttributeType::ComparatorType(vec.getEnumStore(), value));
ASSERT_TRUE(itr.valid());
typename AttributeType::PostingList::Iterator postings;
@@ -693,9 +691,8 @@ void
PostingListAttributeTest::checkNonExistantPostingList(AttributeType & vec, ValueType value)
{
const typename AttributeType::Dictionary & dict = vec.getEnumStore().getPostingDictionary();
- typename AttributeType::DictionaryIterator itr =
- dict.find(typename AttributeType::EnumIndex(),
- typename AttributeType::ComparatorType(vec.getEnumStore(), value));
+ auto itr = dict.find(typename AttributeType::EnumIndex(),
+ typename AttributeType::ComparatorType(vec.getEnumStore(), value));
EXPECT_TRUE(!itr.valid());
}
diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h
index b06cc419400..e990a1030f5 100644
--- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h
@@ -8,7 +8,7 @@
namespace search {
-/*
+/**
* Implementation of multi value numeric attribute that in addition to enum store and
* multi value mapping uses an underlying posting list to provide faster search.
* This class is used for both array and weighted set types.
@@ -26,9 +26,13 @@ class MultiValueNumericPostingAttribute
typename B::LoadedValueType,
typename B::EnumStore>
{
+public:
+ using EnumStore = typename B::EnumStore;
+ using EnumIndex = typename EnumStore::Index;
+ using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
+
private:
- struct DocumentWeightAttributeAdapter : IDocumentWeightAttribute
- {
+ struct DocumentWeightAttributeAdapter : IDocumentWeightAttribute {
const MultiValueNumericPostingAttribute &self;
DocumentWeightAttributeAdapter(const MultiValueNumericPostingAttribute &self_in) : self(self_in) {}
virtual LookupResult lookup(const vespalib::string &term) const override final;
@@ -40,37 +44,32 @@ private:
friend class PostingListAttributeTest;
template <typename, typename, typename>
friend class attribute::PostingSearchContext; // getEnumStore()
- typedef MultiValueNumericPostingAttribute<B, M> SelfType;
-public:
- typedef typename B::EnumStore EnumStore;
- typedef typename EnumStore::Index EnumIndex;
- using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
-private:
- typedef typename B::DocId DocId;
- typedef typename B::LoadedVector LoadedVector;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
- typedef PostingListAttributeSubBase<AttributeWeightPosting, LoadedVector,
- typename B::LoadedValueType, EnumStore> PostingParent;
- typedef typename PostingParent::PostingList PostingList;
- typedef typename PostingParent::PostingMap PostingMap;
- typedef typename PostingParent::Posting Posting;
- typedef EnumPostingTree Dictionary;
- typedef typename Dictionary::Iterator DictionaryIterator;
- typedef typename Dictionary::ConstIterator DictionaryConstIterator;
- typedef typename Dictionary::FrozenView FrozenDictionary;
- typedef typename EnumStore::ComparatorType ComparatorType;
-
- typedef typename MultiValueNumericEnumAttribute<B, M>::DocIndices DocIndices;
- typedef typename MultiValueNumericEnumAttribute<B, M>::generation_t generation_t;
- typedef typename MultiValueNumericEnumAttribute<B, M>::WeightedIndex WeightedIndex;
-
- typedef typename MultiValueNumericEnumAttribute<B, M>::ArraySearchContext ArraySearchContext;
- typedef typename MultiValueNumericEnumAttribute<B, M>::SetSearchContext SetSearchContext;
- typedef ArraySearchContext ArrayNumericSearchContext;
- typedef SetSearchContext SetNumericSearchContext;
+
+ using SelfType = MultiValueNumericPostingAttribute<B, M>;
+ using LoadedVector = typename B::LoadedVector;
+ using PostingParent = PostingListAttributeSubBase<AttributeWeightPosting, LoadedVector,
+ typename B::LoadedValueType, EnumStore>;
+
+ using ArraySearchContext = typename MultiValueNumericEnumAttribute<B, M>::ArraySearchContext;
+ using ArrayNumericSearchContext = ArraySearchContext;
+ using ArrayPostingSearchContext = attribute::NumericPostingSearchContext<ArrayNumericSearchContext, SelfType, int32_t>;
+ using ComparatorType = typename EnumStore::ComparatorType;
+ using Dictionary = EnumPostingTree;
+ using DictionaryConstIterator = typename Dictionary::ConstIterator;
+ using DocId = typename B::DocId;
+ using DocIndices = typename MultiValueNumericEnumAttribute<B, M>::DocIndices;
+ using FrozenDictionary = typename Dictionary::FrozenView;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using Posting = typename PostingParent::Posting;
+ using PostingList = typename PostingParent::PostingList;
+ using PostingMap = typename PostingParent::PostingMap;
using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
- typedef attribute::NumericPostingSearchContext<ArrayNumericSearchContext, SelfType, int32_t> ArrayPostingSearchContext;
- typedef attribute::NumericPostingSearchContext<SetNumericSearchContext, SelfType, int32_t> SetPostingSearchContext;
+ using SetSearchContext = typename MultiValueNumericEnumAttribute<B, M>::SetSearchContext;
+ using SetNumericSearchContext = SetSearchContext;
+ using SetPostingSearchContext = attribute::NumericPostingSearchContext<SetNumericSearchContext, SelfType, int32_t>;
+ using WeightedIndex = typename MultiValueNumericEnumAttribute<B, M>::WeightedIndex;
+ using generation_t = typename MultiValueNumericEnumAttribute<B, M>::generation_t;
+
using PostingParent::_postingList;
using PostingParent::clearAllPostings;
using PostingParent::handleFillPostings;
diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp
index 6fb76bbb12f..27744e6d4b3 100644
--- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp
@@ -25,7 +25,7 @@ void
MultiValueNumericPostingAttribute<B, M>::applyValueChanges(const DocIndices& docIndices,
EnumStoreBatchUpdater& updater)
{
- typedef PostingChangeComputerT<WeightedIndex, PostingMap> PostingChangeComputer;
+ using PostingChangeComputer = PostingChangeComputerT<WeightedIndex, PostingMap>;
EnumStore & enumStore = this->getEnumStore();
ComparatorType compare(enumStore);
diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h
index a0be96ab3e9..88df7ec9704 100644
--- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h
@@ -8,7 +8,7 @@
namespace search {
-/*
+/**
* Implementation of multi value string attribute that in addition to enum store and
* multi value mapping uses an underlying posting list to provide faster search.
* This class is used for both array and weighted set types.
@@ -25,9 +25,12 @@ class MultiValueStringPostingAttributeT
typename B::LoadedValueType,
typename B::EnumStore>
{
+public:
+ using EnumStore = typename MultiValueStringAttributeT<B, T>::EnumStore;
+ using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
+
private:
- struct DocumentWeightAttributeAdapter : IDocumentWeightAttribute
- {
+ struct DocumentWeightAttributeAdapter : IDocumentWeightAttribute {
const MultiValueStringPostingAttributeT &self;
DocumentWeightAttributeAdapter(const MultiValueStringPostingAttributeT &self_in) : self(self_in) {}
virtual LookupResult lookup(const vespalib::string &term) const override final;
@@ -40,38 +43,34 @@ private:
template <typename, typename, typename>
friend class attribute::PostingSearchContext; // getEnumStore()
friend class StringAttributeTest;
- typedef MultiValueStringPostingAttributeT<B, T> SelfType;
- typedef typename B::LoadedVector LoadedVector;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
- typedef PostingListAttributeSubBase<AttributeWeightPosting,
- LoadedVector,
- typename B::LoadedValueType,
- typename B::EnumStore> PostingParent;
- typedef typename MultiValueStringAttributeT<B, T>::DocId DocId;
-public:
- typedef typename MultiValueStringAttributeT<B, T>::EnumStore EnumStore;
- typedef typename EnumStore::BatchUpdater EnumStoreBatchUpdater;
-private:
- typedef typename MultiValueStringAttributeT<B, T>::WeightedIndex WeightedIndex;
- typedef typename MultiValueStringAttributeT<B, T>::DocIndices DocIndices;
- typedef typename MultiValueStringAttributeT<B, T>::generation_t generation_t;
- typedef typename PostingParent::PostingList PostingList;
- typedef typename PostingParent::PostingMap PostingMap;
- typedef typename PostingParent::Posting Posting;
+
+ using LoadedVector = typename B::LoadedVector;
+ using PostingParent = PostingListAttributeSubBase<AttributeWeightPosting,
+ LoadedVector,
+ typename B::LoadedValueType,
+ typename B::EnumStore>;
+
+ using ComparatorType = typename EnumStore::ComparatorType;
+ using Dictionary = EnumPostingTree;
+ using DictionaryConstIterator = typename Dictionary::ConstIterator;
+ using DocId = typename MultiValueStringAttributeT<B, T>::DocId;
+ using DocIndices = typename MultiValueStringAttributeT<B, T>::DocIndices;
+ using EnumIndex = typename EnumStore::Index;
+ using FoldedComparatorType = typename EnumStore::FoldedComparatorType;
+ using FrozenDictionary = typename Dictionary::FrozenView;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using Posting = typename PostingParent::Posting;
+ using PostingList = typename PostingParent::PostingList;
+ using PostingMap = typename PostingParent::PostingMap;
using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
+ using SelfType = MultiValueStringPostingAttributeT<B, T>;
+ using StringArrayImplSearchContext = typename MultiValueStringAttributeT<B, T>::StringArrayImplSearchContext;
+ using StringArrayPostingSearchContext = attribute::StringPostingSearchContext<StringArrayImplSearchContext, SelfType, int32_t>;
+ using StringSetImplSearchContext = typename MultiValueStringAttributeT<B, T>::StringSetImplSearchContext;
+ using StringSetPostingSearchContext = attribute::StringPostingSearchContext<StringSetImplSearchContext, SelfType, int32_t>;
+ using WeightedIndex = typename MultiValueStringAttributeT<B, T>::WeightedIndex;
+ using generation_t = typename MultiValueStringAttributeT<B, T>::generation_t;
- typedef typename MultiValueStringAttributeT<B, T>::StringSetImplSearchContext StringSetImplSearchContext;
- typedef typename MultiValueStringAttributeT<B, T>::StringArrayImplSearchContext StringArrayImplSearchContext;
- typedef attribute::StringPostingSearchContext<StringSetImplSearchContext, SelfType, int32_t> StringSetPostingSearchContext;
- typedef attribute::StringPostingSearchContext<StringArrayImplSearchContext, SelfType, int32_t> StringArrayPostingSearchContext;
-
- typedef EnumPostingTree Dictionary;
- typedef typename EnumStore::Index EnumIndex;
- typedef typename EnumStore::ComparatorType ComparatorType;
- typedef typename EnumStore::FoldedComparatorType FoldedComparatorType;
- typedef typename Dictionary::Iterator DictionaryIterator;
- typedef typename Dictionary::ConstIterator DictionaryConstIterator;
- typedef typename Dictionary::FrozenView FrozenDictionary;
using PostingParent::_postingList;
using PostingParent::clearAllPostings;
using PostingParent::handleFillPostings;
@@ -113,8 +112,8 @@ public:
}
};
-typedef MultiValueStringPostingAttributeT<EnumAttribute<StringAttribute>, multivalue::Value<EnumStoreBase::Index> > ArrayStringPostingAttribute;
-typedef MultiValueStringPostingAttributeT<EnumAttribute<StringAttribute>, multivalue::WeightedValue<EnumStoreBase::Index> > WeightedSetStringPostingAttribute;
+using ArrayStringPostingAttribute = MultiValueStringPostingAttributeT<EnumAttribute<StringAttribute>, multivalue::Value<EnumStoreBase::Index> >;
+using WeightedSetStringPostingAttribute = MultiValueStringPostingAttributeT<EnumAttribute<StringAttribute>, multivalue::WeightedValue<EnumStoreBase::Index> >;
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp
index 058ef5431b0..8268d1ace20 100644
--- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp
@@ -41,7 +41,7 @@ void
MultiValueStringPostingAttributeT<B, T>::
applyValueChanges(const DocIndices& docIndices, EnumStoreBatchUpdater &updater)
{
- typedef PostingChangeComputerT<WeightedIndex, PostingMap> PostingChangeComputer;
+ using PostingChangeComputer = PostingChangeComputerT<WeightedIndex, PostingMap>;
EnumStore &enumStore(this->getEnumStore());
Dictionary &dict(enumStore.getPostingDictionary());
FoldedComparatorType compare(enumStore);
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
index 1d4d3638b08..aa515e82c94 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
@@ -305,27 +305,20 @@ clearPostings(attribute::IAttributeVector::EnumHandle eidx,
}
-
template class PostingListAttributeBase<AttributePosting>;
template class PostingListAttributeBase<AttributeWeightPosting>;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<int8_t> >
-LoadedInt8Vector;
+using LoadedInt8Vector = SequentialReadModifyWriteInterface<LoadedNumericValue<int8_t> >;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<int16_t> >
-LoadedInt16Vector;
+using LoadedInt16Vector = SequentialReadModifyWriteInterface<LoadedNumericValue<int16_t> >;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<int32_t> >
-LoadedInt32Vector;
+using LoadedInt32Vector = SequentialReadModifyWriteInterface<LoadedNumericValue<int32_t> >;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<int64_t> >
-LoadedInt64Vector;
+using LoadedInt64Vector = SequentialReadModifyWriteInterface<LoadedNumericValue<int64_t> >;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<float> >
-LoadedFloatVector;
+using LoadedFloatVector = SequentialReadModifyWriteInterface<LoadedNumericValue<float> >;
-typedef SequentialReadModifyWriteInterface<LoadedNumericValue<double> >
-LoadedDoubleVector;
+using LoadedDoubleVector = SequentialReadModifyWriteInterface<LoadedNumericValue<double> >;
template class
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h
index c35e02f7519..539b362534b 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.h
@@ -32,18 +32,19 @@ public:
template <typename P>
-class PostingListAttributeBase : public attribute::IPostingListAttributeBase
-{
+class PostingListAttributeBase : public attribute::IPostingListAttributeBase {
protected:
- typedef P Posting;
- typedef typename Posting::DataType DataType;
- typedef attribute::PostingListTraits<DataType> AggregationTraits;
- typedef typename AggregationTraits::PostingList PostingList;
- typedef AttributeVector::DocId DocId;
- typedef std::map<EnumPostingPair, PostingChange<P> > PostingMap;
- typedef datastore::EntryRef EntryRef;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
- typedef EnumStoreBase::Index EnumIndex;
+ using Posting = P;
+ using DataType = typename Posting::DataType;
+
+ using AggregationTraits = attribute::PostingListTraits<DataType>;
+ using DocId = AttributeVector::DocId;
+ using EntryRef = datastore::EntryRef;
+ using EnumIndex = EnumStoreBase::Index;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using PostingList = typename AggregationTraits::PostingList;
+ using PostingMap = std::map<EnumPostingPair, PostingChange<P> >;
+
PostingList _postingList;
AttributeVector &_attr;
EnumPostingTree &_dict;
@@ -74,20 +75,18 @@ public:
template <typename P, typename LoadedVector, typename LoadedValueType,
typename EnumStoreType>
-class PostingListAttributeSubBase : public PostingListAttributeBase<P>
-{
+class PostingListAttributeSubBase : public PostingListAttributeBase<P> {
public:
- typedef PostingListAttributeBase<P> Parent;
- typedef EnumStoreType EnumStore;
- typedef EnumPostingTree Dictionary;
- typedef typename Dictionary::Iterator DictionaryIterator;
- typedef EnumStoreBase::Index EnumIndex;
- typedef typename EnumStore::FoldedComparatorType FoldedComparatorType;
- typedef datastore::EntryRef EntryRef;
- typedef typename Parent::PostingMap PostingMap;
- typedef typename Parent::PostingList PostingList;
- typedef typename PostingList::Iterator PostingIterator;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
+ using Parent = PostingListAttributeBase<P>;
+
+ using Dictionary = EnumPostingTree;
+ using EntryRef = datastore::EntryRef;
+ using EnumIndex = EnumStoreBase::Index;
+ using EnumStore = EnumStoreType;
+ using FoldedComparatorType = typename EnumStore::FoldedComparatorType;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using PostingList = typename Parent::PostingList;
+ using PostingMap = typename Parent::PostingMap;
using Parent::clearAllPostings;
using Parent::updatePostings;
diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h
index 805103efdc1..4895eb2256a 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h
@@ -8,7 +8,7 @@
namespace search {
-/*
+/**
* Implementation of single value numeric attribute that in addition to enum store
* uses an underlying posting list to provide faster search.
*
@@ -22,45 +22,37 @@ class SingleValueNumericPostingAttribute
typename B::LoadedValueType,
typename B::EnumStore>
{
+public:
+ using T = typename SingleValueNumericEnumAttribute<B>::T;
+ using Dictionary = EnumPostingTree;
+ using EnumStore = typename SingleValueNumericEnumAttribute<B>::EnumStore;
+ using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
+
private:
friend class PostingListAttributeTest;
template <typename, typename, typename>
friend class attribute::PostingSearchContext; // getEnumStore()
- typedef SingleValueNumericPostingAttribute<B> SelfType;
- typedef typename B::LoadedVector LoadedVector;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
- typedef PostingListAttributeSubBase<AttributePosting,
- LoadedVector,
- typename B::LoadedValueType,
- typename B::EnumStore> PostingParent;
-public:
- typedef typename SingleValueNumericEnumAttribute<B>::EnumStore EnumStore;
- using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
-private:
- typedef typename SingleValueEnumAttributeBase::EnumIndex EnumIndex;
- typedef typename SingleValueNumericEnumAttribute<B>::generation_t generation_t;
-public:
- typedef typename SingleValueNumericEnumAttribute<B>::T T;
-private:
- using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
- typedef typename SingleValueNumericEnumAttribute<B>::SingleSearchContext SingleSearchContext;
- typedef SingleSearchContext SingleNumericSearchContext;
- typedef attribute::NumericPostingSearchContext<SingleNumericSearchContext, SelfType, btree::BTreeNoLeafData> SinglePostingSearchContext;
+ using LoadedVector = typename B::LoadedVector;
+ using PostingParent = PostingListAttributeSubBase<AttributePosting,
+ LoadedVector,
+ typename B::LoadedValueType,
+ typename B::EnumStore>;
- typedef typename PostingParent::PostingMap PostingMap;
- typedef typename B::BaseClass::Change Change;
- typedef typename B::BaseClass::ChangeVector ChangeVector;
- typedef typename B::BaseClass::ChangeVector::const_iterator ChangeVectorIterator;
- typedef typename B::BaseClass::DocId DocId;
- typedef typename B::BaseClass::ValueModifier ValueModifier;
+ using Change = typename B::BaseClass::Change;
+ using ComparatorType = typename EnumStore::ComparatorType;
+ using DocId = typename B::BaseClass::DocId;
+ using EnumIndex = typename SingleValueEnumAttributeBase::EnumIndex;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using PostingMap = typename PostingParent::PostingMap;
+ using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
+ using SelfType = SingleValueNumericPostingAttribute<B>;
+ using SingleSearchContext = typename SingleValueNumericEnumAttribute<B>::SingleSearchContext;
+ using SingleNumericSearchContext = SingleSearchContext;
+ using SinglePostingSearchContext = attribute::NumericPostingSearchContext<SingleNumericSearchContext, SelfType, btree::BTreeNoLeafData>;
+ using ValueModifier = typename B::BaseClass::ValueModifier;
+ using generation_t = typename SingleValueNumericEnumAttribute<B>::generation_t;
-public:
- typedef EnumPostingTree Dictionary;
-private:
- typedef typename Dictionary::Iterator DictionaryIterator;
- typedef typename Dictionary::ConstIterator DictionaryConstIterator;
- typedef typename EnumStore::ComparatorType ComparatorType;
using PostingParent::_postingList;
using PostingParent::clearAllPostings;
using PostingParent::handleFillPostings;
diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h
index edaa7260880..5afbc5aee1b 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h
@@ -7,7 +7,7 @@
namespace search {
-/*
+/**
* Implementation of single value string attribute that in addition to enum store
* uses an underlying posting list to provide faster search.
*
@@ -21,47 +21,41 @@ class SingleValueStringPostingAttributeT
typename B::LoadedValueType,
typename B::EnumStore>
{
+public:
+ using EnumStore = typename SingleValueStringAttributeT<B>::EnumStore;
+ using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
+
private:
friend class PostingListAttributeTest;
template <typename, typename, typename>
friend class attribute::PostingSearchContext; // getEnumStore()
friend class StringAttributeTest;
- typedef SingleValueStringPostingAttributeT<B> SelfType;
- typedef typename B::LoadedVector LoadedVector;
- typedef attribute::LoadedEnumAttributeVector LoadedEnumAttributeVector;
- typedef PostingListAttributeSubBase<AttributePosting,
- LoadedVector,
- typename B::LoadedValueType,
- typename B::EnumStore> PostingParent;
- typedef typename SingleValueStringAttributeT<B>::DocId DocId;
-public:
- typedef typename SingleValueStringAttributeT<B>::EnumStore EnumStore;
- using EnumStoreBatchUpdater = typename EnumStore::BatchUpdater;
-private:
- typedef typename SingleValueStringAttributeT<B>::EnumIndex EnumIndex;
- typedef typename SingleValueStringAttributeT<B>::generation_t generation_t;
- typedef typename SingleValueStringAttributeT<B>::ValueModifier ValueModifier;
-
- typedef typename SingleValueStringAttributeT<B>::StringSingleImplSearchContext StringSingleImplSearchContext;
- typedef attribute::StringPostingSearchContext<StringSingleImplSearchContext,
- SelfType,
- btree::BTreeNoLeafData>
- StringSinglePostingSearchContext;
-
- typedef StringAttribute::Change Change;
- typedef StringAttribute::ChangeVector ChangeVector;
- using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
- typedef typename PostingParent::PostingList PostingList;
- typedef typename PostingParent::PostingMap PostingMap;
- // typedef typename PostingParent::Posting Posting;
+ using LoadedVector = typename B::LoadedVector;
+ using PostingParent = PostingListAttributeSubBase<AttributePosting,
+ LoadedVector,
+ typename B::LoadedValueType,
+ typename B::EnumStore>;
+
+ using Change = StringAttribute::Change;
+ using ChangeVector = StringAttribute::ChangeVector;
+ using ComparatorType = typename EnumStore::ComparatorType;
+ using Dictionary = EnumPostingTree;
+ using DocId = typename SingleValueStringAttributeT<B>::DocId;
+ using EnumIndex = typename SingleValueStringAttributeT<B>::EnumIndex;
+ using FoldedComparatorType = typename EnumStore::FoldedComparatorType;
+ using LoadedEnumAttributeVector = attribute::LoadedEnumAttributeVector;
+ using PostingList = typename PostingParent::PostingList;
+ using PostingMap = typename PostingParent::PostingMap;
+ using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP;
+ using SelfType = SingleValueStringPostingAttributeT<B>;
+ using StringSingleImplSearchContext = typename SingleValueStringAttributeT<B>::StringSingleImplSearchContext;
+ using StringSinglePostingSearchContext = attribute::StringPostingSearchContext<StringSingleImplSearchContext,
+ SelfType,
+ btree::BTreeNoLeafData>;
+ using ValueModifier = typename SingleValueStringAttributeT<B>::ValueModifier;
+ using generation_t = typename SingleValueStringAttributeT<B>::generation_t;
- typedef EnumPostingTree Dictionary;
- typedef typename EnumStore::ComparatorType ComparatorType;
- typedef typename EnumStore::FoldedComparatorType FoldedComparatorType;
- typedef typename Dictionary::Iterator DictionaryIterator;
- typedef typename Dictionary::ConstIterator DictionaryConstIterator;
- typedef typename Dictionary::FrozenView FrozenDictionary;
using PostingParent::_postingList;
using PostingParent::clearAllPostings;
using PostingParent::handleFillPostings;
@@ -120,6 +114,6 @@ public:
}
};
-typedef SingleValueStringPostingAttributeT<EnumAttribute<StringAttribute> > SingleValueStringPostingAttribute;
+using SingleValueStringPostingAttribute = SingleValueStringPostingAttributeT<EnumAttribute<StringAttribute> >;
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp
index ed90f83648e..8374647311e 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp
@@ -67,7 +67,7 @@ makePostingChange(const EnumStoreComparator *cmpa,
// remove old posting
if ( oldIdx.valid()) {
- DictionaryIterator rmItr = dict.find(oldIdx, *cmpa);
+ auto rmItr = dict.find(oldIdx, *cmpa);
changePost[EnumPostingPair(rmItr.getKey(), cmpa)].remove(docId);
}
}