XVector
xvec::HnswFlatIndex Class Reference

RAII wrapper for xvecHnswFlatIndexTag. More...

#include <xvec_hnsw_flat_index.hpp>

Public Member Functions

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

Static Public Member Functions

static HnswFlatIndex fromFaissFile (xvecExecutionContextTag *context, const std::string &path)
 Load an HNSW-Flat index from a Faiss file (and upload it to device). More...
 
static HnswFlatIndex fromDescriptor (xvecExecutionContextTag *context, const xvecHnswFlatDescriptor &descriptor)
 Load an HNSW-Flat index from a FAISS-free descriptor (and upload it to device). More...
 

Detailed Description

RAII wrapper for xvecHnswFlatIndexTag.

Manages the lifetime of an HNSW-Flat index: loaded via a named factory and destroyed in the destructor. Move-only (not copyable).

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

Definition at line 57 of file xvec_hnsw_flat_index.hpp.

Constructor & Destructor Documentation

◆ ~HnswFlatIndex()

virtual xvec::HnswFlatIndex::~HnswFlatIndex ( )
virtual

◆ HnswFlatIndex() [1/2]

xvec::HnswFlatIndex::HnswFlatIndex ( HnswFlatIndex &&  other)
noexcept

◆ HnswFlatIndex() [2/2]

xvec::HnswFlatIndex::HnswFlatIndex ( const HnswFlatIndex &  )
delete

Member Function Documentation

◆ fromDescriptor()

static HnswFlatIndex xvec::HnswFlatIndex::fromDescriptor ( xvecExecutionContextTag *  context,
const xvecHnswFlatDescriptor &  descriptor 
)
static

Load an HNSW-Flat index from a FAISS-free descriptor (and upload it to device).

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

◆ fromFaissFile()

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

Load an HNSW-Flat index from a Faiss file (and upload it to device).

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

◆ handle()

xvecHnswFlatIndexTag* xvec::HnswFlatIndex::handle ( ) const
noexcept

Get the underlying C API handle.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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