aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/btree/noaggrcalc.h
blob: 9c8e47b4355c688becb132b1c9a9ee6db21630a2 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "noaggregated.h"

namespace vespalib::btree {

class NoAggrCalc
{
public:
    constexpr NoAggrCalc() = default;

    constexpr static bool
    hasAggregated()
    {
        return false;
    }

    constexpr static bool aggregate_over_values() { return true; }

    template <typename DataT>
    static inline int32_t
    getVal(const DataT &val)
    {
        (void) val;
        return 0;
    }

    static void
    add(NoAggregated &a, int32_t val)
    {
        (void) a;
        (void) val;
    }

    static void
    add(NoAggregated &a, const NoAggregated &ca)
    {
        (void) a;
        (void) ca;
    }

    static void
    add(NoAggregated &a,
        const NoAggregated &oldca,
        const NoAggregated &ca)
    {
        (void) a;
        (void) oldca;
        (void) ca;
    }

    /* Returns true if recalculation is needed */
    static bool
    remove(NoAggregated &a, int32_t val)
    {
        (void) a;
        (void) val;
        return false;
    }

    /* Returns true if recalculation is needed */
    static bool
    remove(NoAggregated &a, const NoAggregated &oldca, const NoAggregated &ca)
    {
        (void) a;
        (void) oldca;
        (void) ca;
        return false;
    }

    /* Returns true if recalculation is needed */
    static bool
    update(NoAggregated &a, int32_t oldVal, int32_t val)
    {
        (void) a;
        (void) oldVal;
        (void) val;
        return false;
    }

    /* Returns true if recalculation is needed */
    static bool
    update(NoAggregated &a, const NoAggregated &oldca, const NoAggregated &ca)
    {
        (void) a;
        (void) oldca;
        (void) ca;
        return false;
    }
};

}