blob: a4afb129537b5c2fce7578a70cff92f37633cb79 (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "featureoverrider.h"
namespace search::fef {
void
FeatureOverrider::handle_bind_inputs(vespalib::ConstArrayRef<LazyValue> inputs)
{
_executor.bind_inputs(inputs);
}
void
FeatureOverrider::handle_bind_outputs(vespalib::ArrayRef<NumberOrObject> outputs)
{
_executor.bind_outputs(outputs);
}
FeatureOverrider::FeatureOverrider(FeatureExecutor &executor, uint32_t outputIdx, feature_t number, Value::UP object)
: _executor(executor),
_outputIdx(outputIdx),
_number(number),
_object(std::move(object))
{
}
bool
FeatureOverrider::isPure()
{
return _executor.isPure();
}
void
FeatureOverrider::execute(uint32_t docId)
{
_executor.lazy_execute(docId);
if (_outputIdx < outputs().size()) {
if (_object) {
outputs().set_object(_outputIdx, *_object);
} else {
outputs().set_number(_outputIdx, _number);
}
}
}
void
FeatureOverrider::handle_bind_match_data(const MatchData &md)
{
_executor.bind_match_data(md);
}
}
|