aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/persistence/fieldvisitor.cpp
blob: 1bdf83250c2ce6117b7716c8cd92b8cb647d020b (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// @author Vegard Sjonfjell

#include "fieldvisitor.h"
#include <vespa/document/select/valuenodes.h>

namespace storage {

FieldVisitor::~FieldVisitor() = default;

void FieldVisitor::visitFieldValueNode(const document::select::FieldValueNode & node) {
    _fields.add(&_docType.getField(node.getRealFieldName()));
}

void FieldVisitor::visitComparison(const document::select::Compare & node) {
    visitBothBranches(node);
}

void FieldVisitor::visitAndBranch(const document::select::And & node) {
    visitBothBranches(node);
}

void FieldVisitor::visitOrBranch(const document::select::Or & node) {
    visitBothBranches(node);
}

void FieldVisitor::visitNotBranch(const document::select::Not & node) {
    node.getChild().visit(*this);
}

} // storage