MLIR  16.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::detail::InterfaceMap Class Reference

This class provides an efficient mapping between a given Interface type, and a particular implementation of its concept. More...

#include "mlir/Support/InterfaceSupport.h"

Public Member Functions

 InterfaceMap (InterfaceMap &&)=default
 
InterfaceMapoperator= (InterfaceMap &&rhs)
 
 ~InterfaceMap ()
 
template<typename T >
T::Concept * lookup () const
 Returns an instance of the concept object for the given interface if it was registered to this map, null otherwise. More...
 
bool contains (TypeID interfaceID) const
 Returns true if the interface map contains an interface for the given id. More...
 
 InterfaceMap (MutableArrayRef< std::pair< TypeID, void *>> elements)
 Create an InterfaceMap given with the implementation of the interfaces. More...
 
template<typename... IfaceModels>
void insert ()
 Insert the given models as implementations of the corresponding interfaces for the concrete attribute class. More...
 

Static Public Member Functions

template<typename... Types>
static InterfaceMap get ()
 Construct an InterfaceMap with the given set of template types. More...
 

Detailed Description

This class provides an efficient mapping between a given Interface type, and a particular implementation of its concept.

Definition at line 166 of file InterfaceSupport.h.

Constructor & Destructor Documentation

◆ InterfaceMap() [1/2]

mlir::detail::InterfaceMap::InterfaceMap ( InterfaceMap &&  )
default

◆ ~InterfaceMap()

mlir::detail::InterfaceMap::~InterfaceMap ( )
inline

Definition at line 183 of file InterfaceSupport.h.

◆ InterfaceMap() [2/2]

detail::InterfaceMap::InterfaceMap ( MutableArrayRef< std::pair< TypeID, void *>>  elements)

Create an InterfaceMap given with the implementation of the interfaces.

The use of this constructor is in general discouraged in favor of 'InterfaceMap::get<InterfaceA, ...>()'.

Definition at line 21 of file InterfaceSupport.cpp.

Member Function Documentation

◆ contains()

bool mlir::detail::InterfaceMap::contains ( TypeID  interfaceID) const
inline

Returns true if the interface map contains an interface for the given id.

Definition at line 213 of file InterfaceSupport.h.

◆ get()

template<typename... Types>
static InterfaceMap mlir::detail::InterfaceMap::get ( )
inlinestatic

Construct an InterfaceMap with the given set of template types.

For convenience given that object trait lists may contain other non-interface types, not all of the types need to be interfaces. The provided types that do not represent interfaces are not added to the interface map.

Definition at line 193 of file InterfaceSupport.h.

References value.

◆ insert()

template<typename... IfaceModels>
void mlir::detail::InterfaceMap::insert ( )
inline

Insert the given models as implementations of the corresponding interfaces for the concrete attribute class.

Definition at line 223 of file InterfaceSupport.h.

References mlir::presburger::compare(), and value.

◆ lookup()

template<typename T >
T::Concept* mlir::detail::InterfaceMap::lookup ( ) const
inline

Returns an instance of the concept object for the given interface if it was registered to this map, null otherwise.

Definition at line 208 of file InterfaceSupport.h.

◆ operator=()

InterfaceMap& mlir::detail::InterfaceMap::operator= ( InterfaceMap &&  rhs)
inline

Definition at line 177 of file InterfaceSupport.h.


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