aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-08-23 07:01:31 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-08-23 07:01:31 +0000
commit32a1d842d2aaf08ea996c9b142ef89aca1b7b3f0 (patch)
tree2d7aeda547b3fb9e2de6d969dafa46647d5b237c /vespalib
parentec6553764841765c86a4324802b1d509d1934035 (diff)
Rename template argument.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h6
-rw-r--r--vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp65
2 files changed, 34 insertions, 37 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h
index c09aab25c69..4191b5d26a6 100644
--- a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h
+++ b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h
@@ -12,13 +12,11 @@ class EntryComparatorWrapper;
/**
* A dictionary for unique store. Mostly accessed via base class.
*/
-template <typename DictionaryType>
+template <typename DictionaryT>
class UniqueStoreDictionary : public UniqueStoreDictionaryBase
{
-public:
- using Dictionary = DictionaryType;
-
protected:
+ using DictionaryType = DictionaryT;
using DataType = typename DictionaryType::DataType;
DictionaryType _dict;
diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp
index d4a275cd12e..51968f0042b 100644
--- a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp
+++ b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp
@@ -16,41 +16,41 @@
namespace search::datastore {
-template <typename DictionaryType>
-UniqueStoreDictionary<DictionaryType>::UniqueStoreDictionary()
+template <typename DictionaryT>
+UniqueStoreDictionary<DictionaryT>::UniqueStoreDictionary()
: UniqueStoreDictionaryBase(),
_dict()
{
}
-template <typename DictionaryType>
-UniqueStoreDictionary<DictionaryType>::~UniqueStoreDictionary() = default;
+template <typename DictionaryT>
+UniqueStoreDictionary<DictionaryT>::~UniqueStoreDictionary() = default;
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::freeze()
+UniqueStoreDictionary<DictionaryT>::freeze()
{
_dict.getAllocator().freeze();
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::transfer_hold_lists(generation_t generation)
+UniqueStoreDictionary<DictionaryT>::transfer_hold_lists(generation_t generation)
{
_dict.getAllocator().transferHoldLists(generation);
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::trim_hold_lists(generation_t firstUsed)
+UniqueStoreDictionary<DictionaryT>::trim_hold_lists(generation_t firstUsed)
{
_dict.getAllocator().trimHoldLists(firstUsed);
}
-template <typename DictionaryType>
+template <typename DictionaryT>
UniqueStoreAddResult
-UniqueStoreDictionary<DictionaryType>::add(const EntryComparator &comp,
- std::function<EntryRef(void)> insertEntry)
+UniqueStoreDictionary<DictionaryT>::add(const EntryComparator &comp,
+ std::function<EntryRef(void)> insertEntry)
{
auto itr = _dict.lowerBound(EntryRef(), comp);
if (itr.valid() && !comp(EntryRef(), itr.getKey())) {
@@ -63,9 +63,9 @@ UniqueStoreDictionary<DictionaryType>::add(const EntryComparator &comp,
}
}
-template <typename DictionaryType>
+template <typename DictionaryT>
EntryRef
-UniqueStoreDictionary<DictionaryType>::find(const EntryComparator &comp)
+UniqueStoreDictionary<DictionaryT>::find(const EntryComparator &comp)
{
auto itr = _dict.lowerBound(EntryRef(), comp);
if (itr.valid() && !comp(EntryRef(), itr.getKey())) {
@@ -75,9 +75,9 @@ UniqueStoreDictionary<DictionaryType>::find(const EntryComparator &comp)
}
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::remove(const EntryComparator &comp, EntryRef ref)
+UniqueStoreDictionary<DictionaryT>::remove(const EntryComparator &comp, EntryRef ref)
{
assert(ref.valid());
auto itr = _dict.lowerBound(ref, comp);
@@ -85,9 +85,9 @@ UniqueStoreDictionary<DictionaryType>::remove(const EntryComparator &comp, Entry
_dict.remove(itr);
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::move_entries(ICompactable &compactable)
+UniqueStoreDictionary<DictionaryT>::move_entries(ICompactable &compactable)
{
auto itr = _dict.begin();
while (itr.valid()) {
@@ -101,29 +101,29 @@ UniqueStoreDictionary<DictionaryType>::move_entries(ICompactable &compactable)
}
}
-template <typename DictionaryType>
+template <typename DictionaryT>
uint32_t
-UniqueStoreDictionary<DictionaryType>::get_num_uniques() const
+UniqueStoreDictionary<DictionaryT>::get_num_uniques() const
{
return _dict.getFrozenView().size();
}
-template <typename DictionaryType>
+template <typename DictionaryT>
vespalib::MemoryUsage
-UniqueStoreDictionary<DictionaryType>::get_memory_usage() const
+UniqueStoreDictionary<DictionaryT>::get_memory_usage() const
{
return _dict.getMemoryUsage();
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::build(const std::vector<EntryRef> &refs,
- const std::vector<uint32_t> &ref_counts,
- std::function<void(EntryRef)> hold)
+UniqueStoreDictionary<DictionaryT>::build(const std::vector<EntryRef> &refs,
+ const std::vector<uint32_t> &ref_counts,
+ std::function<void(EntryRef)> hold)
{
assert(refs.size() == ref_counts.size());
assert(!refs.empty());
- typename Dictionary::Builder builder(_dict.getAllocator());
+ typename DictionaryType::Builder builder(_dict.getAllocator());
for (size_t i = 1; i < refs.size(); ++i) {
if (ref_counts[i] != 0u) {
builder.insert(refs[i], DataType());
@@ -134,18 +134,17 @@ UniqueStoreDictionary<DictionaryType>::build(const std::vector<EntryRef> &refs,
_dict.assign(builder);
}
-template <typename DictionaryType>
+template <typename DictionaryT>
EntryRef
-UniqueStoreDictionary<DictionaryType>::get_frozen_root() const
+UniqueStoreDictionary<DictionaryT>::get_frozen_root() const
{
return _dict.getFrozenView().getRoot();
}
-template <typename DictionaryType>
+template <typename DictionaryT>
void
-UniqueStoreDictionary<DictionaryType>::foreach_key(EntryRef root, std::function<void(EntryRef)> callback) const
+UniqueStoreDictionary<DictionaryT>::foreach_key(EntryRef root, std::function<void(EntryRef)> callback) const
{
-
_dict.getAllocator().getNodeStore().foreach_key(root, callback);
}