XVector
xvec::IvfFlatIndex Class Reference

RAII wrapper for xvecIvfFlatIndexTag. More...

#include <xvec_ivf_flat_index.hpp>

Public Member Functions

virtual ~IvfFlatIndex ()
 
 IvfFlatIndex (IvfFlatIndex &&other) noexcept
 
IvfFlatIndex & operator= (IvfFlatIndex &&other) noexcept
 
 IvfFlatIndex (const IvfFlatIndex &)=delete
 
IvfFlatIndex & operator= (const IvfFlatIndex &)=delete
 
xvecIvfFlatIndexTag * handle () const noexcept
 Get the underlying C API handle. More...
 

Static Public Member Functions

static IvfFlatIndex fromFaissFile (xvecExecutionContextTag *context, const std::string &path)
 Load an IVF-Flat index from a Faiss file. More...
 
static IvfFlatIndex fromDescriptor (xvecExecutionContextTag *context, const xvecIvfFlatDescriptor &descriptor)
 Load an IVF-Flat index from a FAISS-free descriptor. More...
 

Detailed Description

RAII wrapper for xvecIvfFlatIndexTag.

Manages the lifetime of an IVF-Flat index. The index is loaded via named factory methods and destroyed in the destructor. Supports move semantics but not copying.

Note
Destroy this wrapper before its execution context. Index device memory remains allocated until context destruction; see Index resource lifetime.

Definition at line 58 of file xvec_ivf_flat_index.hpp.

Constructor & Destructor Documentation

◆ ~IvfFlatIndex()

virtual xvec::IvfFlatIndex::~IvfFlatIndex ( )
virtual

◆ IvfFlatIndex() [1/2]

xvec::IvfFlatIndex::IvfFlatIndex ( IvfFlatIndex &&  other)
noexcept

◆ IvfFlatIndex() [2/2]

xvec::IvfFlatIndex::IvfFlatIndex ( const IvfFlatIndex &  )
delete

Member Function Documentation

◆ fromDescriptor()

static IvfFlatIndex xvec::IvfFlatIndex::fromDescriptor ( xvecExecutionContextTag *  context,
const xvecIvfFlatDescriptor &  descriptor 
)
static

Load an IVF-Flat index from a FAISS-free descriptor.

Parameters
contextExecution context handle (not owned).
descriptorFully-populated index descriptor (borrowed for the call).
Exceptions
xvec::Errorif loading fails.
See also
xvecIvfFlatDescriptor

◆ fromFaissFile()

static IvfFlatIndex xvec::IvfFlatIndex::fromFaissFile ( xvecExecutionContextTag *  context,
const std::string &  path 
)
static

Load an IVF-Flat index from a Faiss file.

Parameters
contextExecution context handle (not owned).
pathPath to the Faiss index file (.faiss).
Exceptions
xvec::Errorif loading fails.

◆ handle()

xvecIvfFlatIndexTag* xvec::IvfFlatIndex::handle ( ) const
noexcept

Get the underlying C API handle.

◆ operator=() [1/2]

IvfFlatIndex& xvec::IvfFlatIndex::operator= ( const IvfFlatIndex &  )
delete

◆ operator=() [2/2]

IvfFlatIndex& xvec::IvfFlatIndex::operator= ( IvfFlatIndex &&  other)
noexcept

The documentation for this class was generated from the following file: