LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::RTTIExtends< ThisT, ParentT > Class Template Reference

Inheritance utility for extensible RTTI. More...

#include "llvm/Support/ExtensibleRTTI.h"

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

Public Member Functions

const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 

Static Public Member Functions

static const void * classID ()
 
static bool classof (const RTTIRoot *R)
 

Detailed Description

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

Inheritance utility for extensible RTTI.

Supports single inheritance only: A class can only have one ExtensibleRTTI-parent (i.e. a parent for which the isa<> test will work), though it can have many non-ExtensibleRTTI parents.

RTTIExtents uses CRTP so the first template argument to RTTIExtends is the newly introduced type, and the second argument is the parent class.

class MyType : public RTTIExtends<MyType, RTTIRoot> { public: static char ID; };

class MyDerivedType : public RTTIExtends<MyDerivedType, MyType> { public: static char ID; };

Definition at line 114 of file ExtensibleRTTI.h.

Member Function Documentation

◆ classID()

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

Definition at line 119 of file ExtensibleRTTI.h.

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

◆ classof()

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

Definition at line 127 of file ExtensibleRTTI.h.

◆ dynamicClassID()

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

◆ isA()

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

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