diff options
Diffstat (limited to 'searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h')
-rw-r--r-- | searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h b/searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h new file mode 100644 index 00000000000..68dac168280 --- /dev/null +++ b/searchlib/src/vespa/searchlib/memoryindex/bundled_fields_context.h @@ -0,0 +1,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; } +}; + +} |