aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/fef/filetablefactory.h
blob: f246f5e4bbf69e9eb857de2ac82068949cb563eb (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "itablefactory.h"

namespace search::fef {

/**
 * This factory class is used to instantiate tables that are stored in files on disk.
 **/
class FileTableFactory : public ITableFactory
{
private:
    vespalib::string _path;

public:
    /**
     * Creates a new factory for table files that are located in the given path.
     **/
    FileTableFactory(const vespalib::string & path);

    /**
     * Creates a table by reading the file 'path/name' and setting up a Table object.
     * The numbers in the file should be separated with ' ' or '\n'.
     * Table::SP(NULL) is returned if the file 'path/name' is not found.
     **/
    Table::SP createTable(const vespalib::string & name) const override;
};

}