LLVM  14.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 65 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 121 of file ExtensibleRTTI.h.

Referenced by llvm::RTTIExtends< ObjectLayer, RTTIRoot >::isA().

◆ classof()

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

Definition at line 129 of file ExtensibleRTTI.h.

◆ dynamicClassID()

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

Definition at line 123 of file ExtensibleRTTI.h.

◆ isA()

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

Definition at line 125 of file ExtensibleRTTI.h.


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