aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/atomic_utils.h
blob: 48914de89428940d4e534e5699989a50d1bc27ae (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
24
25
26
27
28
29
30
31
32
33
34
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

namespace vespalib::datastore {

class AtomicEntryRef;
class EntryRef;

}

namespace search::attribute::atomic_utils {

/*
 * Helper class to map from atomic value to non-atomic value, e.g.
 * from AtomicEntryRef to EntryRef.
 */
template <typename MaybeAtomicValue>
class NonAtomicValue {
public:
    using type = MaybeAtomicValue;
};

template <>
class NonAtomicValue<vespalib::datastore::AtomicEntryRef>
{
public:
    using type = vespalib::datastore::EntryRef;
};

template <class MaybeAtomicValue>
using NonAtomicValue_t = typename NonAtomicValue<MaybeAtomicValue>::type;

}