MLIR 23.0.0git
mlir::python::SafeInit< T > Class Template Reference

Safely calls Python initialization code on first use, avoiding deadlocks. More...

#include "mlir/Bindings/Python/NanobindUtils.h"

Public Types

typedef std::unique_ptr< T >(* F) ()

Public Member Functions

 SafeInit (F init_fn)
T & get ()

Detailed Description

template<typename T>
class mlir::python::SafeInit< T >

Safely calls Python initialization code on first use, avoiding deadlocks.

Definition at line 40 of file NanobindUtils.h.

Member Typedef Documentation

◆ F

template<typename T>
typedef std::unique_ptr< T >(* mlir::python::SafeInit< T >::F) ()

Definition at line 42 of file NanobindUtils.h.

Constructor & Destructor Documentation

◆ SafeInit()

template<typename T>
mlir::python::SafeInit< T >::SafeInit ( F init_fn)
inlineexplicit

Definition at line 44 of file NanobindUtils.h.

Member Function Documentation

◆ get()

template<typename T>
T & mlir::python::SafeInit< T >::get ( )
inline

Definition at line 46 of file NanobindUtils.h.

References result.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::classmethod().


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