/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

// -*- c++ -*-

// I/O code for indexes

#pragma once

namespace faiss {

// todo aguzhva: get rid of this file by adding Index* Index::clone() function.
//   same for quantizers.

struct Index;
struct IndexIVF;
struct VectorTransform;
struct Quantizer;
struct IndexBinary;


namespace gpu {
    struct GpuIndexFlat;
}

/* cloning functions */
Index* clone_index(const Index*);

/** Cloner class, useful to override classes with other cloning
 * functions. The cloning function above just calls
 * Cloner::clone_Index. */
struct Cloner {
    virtual VectorTransform* clone_VectorTransform(const VectorTransform*);
    virtual Index* clone_Index(const Index*);
    virtual IndexIVF* clone_IndexIVF(const IndexIVF*);
    virtual ~Cloner() {}
};

Quantizer* clone_Quantizer(const Quantizer* quant);

IndexBinary* clone_binary_index(const IndexBinary* index);

} // namespace faiss
