aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/datastore/entry_comparator_wrapper.h
blob: e31b639928af6b840e9a8e045342b0b73ca0956b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "entry_comparator.h"

namespace vespalib::datastore {

/*
 * Copyable comparator wrapper.
 */
class EntryComparatorWrapper {
    const EntryComparator &_comp;
public:
    EntryComparatorWrapper(const EntryComparator &comp)
        : _comp(comp)
    { }
    bool operator()(const AtomicEntryRef &lhs, const AtomicEntryRef &rhs) const {
        return _comp.less(lhs.load_acquire(), rhs.load_acquire());
    }
};

}