MLIR  20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlir::python::PyConcreteType< DerivedTy, BaseTy > Class Template Reference

CRTP base classes for Python types that subclass Type and should be castable from it (i.e. More...

#include "Bindings/Python/IRModule.h"

+ Inheritance diagram for mlir::python::PyConcreteType< DerivedTy, BaseTy >:

Public Types

using ClassTy = pybind11::class_< DerivedTy, BaseTy >
 
using IsAFunctionTy = bool(*)(MlirType)
 
using GetTypeIDFunctionTy = MlirTypeID(*)()
 

Public Member Functions

 PyConcreteType ()=default
 
 PyConcreteType (PyMlirContextRef contextRef, MlirType t)
 
 PyConcreteType (PyType &orig)
 
- Public Member Functions inherited from mlir::python::PyType
 PyType (PyMlirContextRef contextRef, MlirType type)
 
bool operator== (const PyType &other) const
 
 operator MlirType () const
 
MlirType get () const
 
pybind11::object getCapsule ()
 Gets a capsule wrapping the void* within the MlirType. More...
 
- Public Member Functions inherited from mlir::python::BaseContextObject
 BaseContextObject (PyMlirContextRef ref)
 
PyMlirContextRefgetContext ()
 Accesses the context reference. More...
 

Static Public Member Functions

static MlirType castFrom (PyType &orig)
 
static void bind (pybind11::module &m)
 
static void bindDerived (ClassTy &m)
 Implemented by derived classes to add methods to the Python subclass. More...
 
- Static Public Member Functions inherited from mlir::python::PyType
static PyType createFromCapsule (pybind11::object capsule)
 Creates a PyType from the MlirType wrapped by a capsule. More...
 

Static Public Attributes

static constexpr GetTypeIDFunctionTy getTypeIdFunction = nullptr
 

Detailed Description

template<typename DerivedTy, typename BaseTy = PyType>
class mlir::python::PyConcreteType< DerivedTy, BaseTy >

CRTP base classes for Python types that subclass Type and should be castable from it (i.e.

via something like IntegerType(t)). By default, type class hierarchies are one level deep (i.e. a concrete type class extends PyType); however, intermediate python-visible base classes can be modeled by specifying a BaseTy.

Definition at line 930 of file IRModule.h.

Member Typedef Documentation

◆ ClassTy

template<typename DerivedTy , typename BaseTy = PyType>
using mlir::python::PyConcreteType< DerivedTy, BaseTy >::ClassTy = pybind11::class_<DerivedTy, BaseTy>

Definition at line 935 of file IRModule.h.

◆ GetTypeIDFunctionTy

template<typename DerivedTy , typename BaseTy = PyType>
using mlir::python::PyConcreteType< DerivedTy, BaseTy >::GetTypeIDFunctionTy = MlirTypeID (*)()

Definition at line 937 of file IRModule.h.

◆ IsAFunctionTy

template<typename DerivedTy , typename BaseTy = PyType>
using mlir::python::PyConcreteType< DerivedTy, BaseTy >::IsAFunctionTy = bool (*)(MlirType)

Definition at line 936 of file IRModule.h.

Constructor & Destructor Documentation

◆ PyConcreteType() [1/3]

template<typename DerivedTy , typename BaseTy = PyType>
mlir::python::PyConcreteType< DerivedTy, BaseTy >::PyConcreteType ( )
default

◆ PyConcreteType() [2/3]

template<typename DerivedTy , typename BaseTy = PyType>
mlir::python::PyConcreteType< DerivedTy, BaseTy >::PyConcreteType ( PyMlirContextRef  contextRef,
MlirType  t 
)
inline

Definition at line 941 of file IRModule.h.

◆ PyConcreteType() [3/3]

template<typename DerivedTy , typename BaseTy = PyType>
mlir::python::PyConcreteType< DerivedTy, BaseTy >::PyConcreteType ( PyType orig)
inline

Definition at line 943 of file IRModule.h.

Member Function Documentation

◆ bind()

template<typename DerivedTy , typename BaseTy = PyType>
static void mlir::python::PyConcreteType< DerivedTy, BaseTy >::bind ( pybind11::module &  m)
inlinestatic

Definition at line 957 of file IRModule.h.

◆ bindDerived()

template<typename DerivedTy , typename BaseTy = PyType>
static void mlir::python::PyConcreteType< DerivedTy, BaseTy >::bindDerived ( ClassTy m)
inlinestatic

Implemented by derived classes to add methods to the Python subclass.

Definition at line 997 of file IRModule.h.

◆ castFrom()

template<typename DerivedTy , typename BaseTy = PyType>
static MlirType mlir::python::PyConcreteType< DerivedTy, BaseTy >::castFrom ( PyType orig)
inlinestatic

Definition at line 946 of file IRModule.h.

Member Data Documentation

◆ getTypeIdFunction

template<typename DerivedTy , typename BaseTy = PyType>
constexpr GetTypeIDFunctionTy mlir::python::PyConcreteType< DerivedTy, BaseTy >::getTypeIdFunction = nullptr
staticconstexpr

Definition at line 938 of file IRModule.h.


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