aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/base/documentcalculator.h
blob: 03147dab22b96ee5ed66a05f2f3f1e7d1c966215 (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 <vespa/document/select/node.h>

namespace document {

namespace select { class VariableMap; }

class DocumentTypeRepo;

class DocumentCalculator {
public:
    DocumentCalculator(const DocumentTypeRepo& repo, const vespalib::string& expression);
    ~DocumentCalculator();
    double evaluate(const Document& doc, std::unique_ptr<select::VariableMap> variables);

private:
    std::unique_ptr<select::Node> _selectionNode;
};

}