LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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 >:
Inheritance graph
[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.

Definition at line 126 of file ExtensibleRTTI.h.

Member Function Documentation

◆ classID()

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

◆ classof()

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

Definition at line 143 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 136 of file ExtensibleRTTI.h.

References llvm::RTTIExtends< ThisT, ParentT, ParentTs >::isA().

Referenced by llvm::RTTIExtends< ThisT, ParentT, ParentTs >::isA().

◆ isA() [2/2]

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

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