LLVM 22.0.0git
llvm::RTTIExtends< ThisT, ParentT, ParentTs > Class Template Reference

Inheritance utility for extensible RTTI. More...

#include "llvm/Support/ExtensibleRTTI.h"

Inheritance diagram for llvm::RTTIExtends< ThisT, ParentT, ParentTs >:
[legend]

Public Member Functions

const void * dynamicClassID () const override
template<typename QueryT>
bool isA () const
 Check whether this instance is a subclass of QueryT.
bool isA (const void *const ClassID) const override

Static Public Member Functions

static const void * classID ()
template<typename T>
static bool classof (const T *R)

Detailed Description

template<typename ThisT, typename ParentT, typename... ParentTs>
class llvm::RTTIExtends< ThisT, ParentT, ParentTs >

Inheritance utility for extensible RTTI.

Multiple inheritance is supported, but RTTIExtends only inherits constructors from the first base class. All subsequent bases will be default constructed. Virtual and non-public inheritance are not supported.

RTTIExtents uses CRTP so the first template argument to RTTIExtends is the newly introduced type, and the second and later arguments are the parent classes.

class MyType : public RTTIExtends<MyType, RTTIRoot> {
public:
static char ID;
};
class MyDerivedType : public RTTIExtends<MyDerivedType, MyType> {
public:
static char ID;
};
class MyOtherType : public RTTIExtends<MyOtherType, MyType> {
public:
static char ID;
};
class MyMultipleInheritanceType
: public RTTIExtends<MyMultipleInheritanceType,
MyDerivedType, MyOtherType> {
public:
static char ID;
};
Inheritance utility for extensible RTTI.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24

Definition at line 128 of file ExtensibleRTTI.h.

Member Function Documentation

◆ classID()

template<typename ThisT, typename ParentT, typename... ParentTs>
const void * llvm::RTTIExtends< ThisT, ParentT, ParentTs >::classID ( )
inlinestatic

◆ classof()

template<typename ThisT, typename ParentT, typename... ParentTs>
template<typename T>
bool llvm::RTTIExtends< ThisT, ParentT, ParentTs >::classof ( const T * R)
inlinestatic

Definition at line 145 of file ExtensibleRTTI.h.

◆ dynamicClassID()

template<typename ThisT, typename ParentT, typename... ParentTs>
const void * llvm::RTTIExtends< ThisT, ParentT, ParentTs >::dynamicClassID ( ) const
inlineoverride

◆ isA() [1/2]

template<typename ThisT, typename ParentT, typename... ParentTs>
template<typename QueryT>
bool llvm::RTTIExtends< ThisT, ParentT, ParentTs >::isA ( ) const
inline

Check whether this instance is a subclass of QueryT.

Definition at line 138 of file ExtensibleRTTI.h.

Referenced by llvm::RTTIExtends< ObjectLinkingLayer, ObjectLayer >::classof(), and llvm::RTTIExtends< ObjectLinkingLayer, ObjectLayer >::isA().

◆ isA() [2/2]

template<typename ThisT, typename ParentT, typename... ParentTs>
bool llvm::RTTIExtends< ThisT, ParentT, ParentTs >::isA ( const void *const ClassID) const
inlineoverride

Definition at line 140 of file ExtensibleRTTI.h.


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