aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/query/tree/querynodemixin.h
blob: 8ede3676fd9a172375588954a196febc864263c1 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "queryvisitor.h"

namespace search::query {

template <typename T, typename Base>
struct QueryNodeMixin : Base {
    using QueryNodeMixinType = QueryNodeMixin<T, Base>;

    ~QueryNodeMixin() = 0;
    void accept(QueryVisitor &visitor) override {
        visitor.visit(static_cast<T &>(*this));
    }

protected:
    using Base::Base;
};

template <typename T, typename Base>
QueryNodeMixin<T, Base>::~QueryNodeMixin() = default;

}