summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h
blob: 68dac1682809494c0a2c1a7c3ae8cf40f8ecf6f2 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/util/isequencedtaskexecutor.h>

namespace search::memoryindex {

/*
 * Base class for PushContext and InvertContext, with mapping to
 * the fields and uri fields handled by this context. Fields using
 * the same thread appear in the same context.
 */
class BundledFieldsContext
{
    vespalib::ISequencedTaskExecutor::ExecutorId _id;
    std::vector<uint32_t>                        _fields;
    std::vector<uint32_t>                        _uri_fields;
protected:
    BundledFieldsContext(vespalib::ISequencedTaskExecutor::ExecutorId id);
    ~BundledFieldsContext();
public:
    void add_field(uint32_t field_id);
    void add_uri_field(uint32_t uri_field_id);
    vespalib::ISequencedTaskExecutor::ExecutorId get_id() const noexcept { return _id; }
    const std::vector<uint32_t>& get_fields() const noexcept { return _fields; }
    const std::vector<uint32_t>& get_uri_fields() const noexcept { return _uri_fields; }
};

}