aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/fef/itablefactory.h
blob: b023f3c85c4f921709a423d77d12b543e1dda4cf (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
// Copyright Yahoo. 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 "table.h"

namespace search::fef {

/**
 * This is an interface for a factory used to create tables.
 **/
class ITableFactory
{
public:
    /**
     * Convenience typedef for a shared pointer to this class.
     **/
    using SP = std::shared_ptr<ITableFactory>;

    /**
     * Creates a table with the given name.
     * Table::SP(NULL) is returned if the table cannot be created.
     **/
    virtual Table::SP createTable(const vespalib::string & name) const = 0;

    /**
     * Virtual destructor to allow safe subclassing.
     **/
    virtual ~ITableFactory() = default;
};

}