aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h
blob: b9d1fb9e57b5c63a03d2b240b3b2864def4c17f0 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>
#include <memory>

namespace search { struct IDocumentMetaStoreContext; }

namespace search::attribute {

class BitVectorSearchCache;
class ImportedAttributeVector;
class ReadableAttributeVector;
class ReferenceAttribute;

/*
 * Factory class used to create proper imported attribute vector based
 * on target attribute basic type.
 */
class ImportedAttributeVectorFactory {
public:
    static std::shared_ptr<ImportedAttributeVector>
    create(vespalib::stringref name,
           std::shared_ptr<ReferenceAttribute> reference_attribute,
           std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
           std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
           std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
           bool use_search_cache);

    static std::shared_ptr<ImportedAttributeVector>
    create(vespalib::stringref name,
           std::shared_ptr<ReferenceAttribute> reference_attribute,
           std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
           std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
           std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
           std::shared_ptr<BitVectorSearchCache> search_cache);
};

}