MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Inheritance::TInherit< BaseTypes > Class Template Reference

Inherit via this template to allow other API to reflect upon the base types of deriving class. Base types are inherited as public. If you want privately inherited base classes, just inherit them as normal. More...

#include <Inheritance.h>

Inheritance diagram for Mcro::Inheritance::TInherit< BaseTypes >:

Public Types

using Bases = TTypes<BaseTypes...>
 

Public Member Functions

template<typename Self , typename Function >
constexpr void ForEachBase (this Self &&, Function &&function)
 Operate on each of the explicit base class of this type with a lambda function template. If any given type also happens to match CHasBases, iterate on their base types too recursively.
 

Detailed Description

template<typename... BaseTypes>
class Mcro::Inheritance::TInherit< BaseTypes >

Inherit via this template to allow other API to reflect upon the base types of deriving class. Base types are inherited as public. If you want privately inherited base classes, just inherit them as normal.

Usage:

class FMyThing : public TInherit<IFoo, IBar, IEtc>
{
// ...
}
Inherit via this template to allow other API to reflect upon the base types of deriving class....

Definition at line 123 of file Inheritance.h.

Member Typedef Documentation

◆ Bases

template<typename... BaseTypes>
using Mcro::Inheritance::TInherit< BaseTypes >::Bases = TTypes<BaseTypes...>

Definition at line 126 of file Inheritance.h.

Member Function Documentation

◆ ForEachBase()

template<typename... BaseTypes>
template<typename Self , typename Function >
void Mcro::Inheritance::TInherit< BaseTypes >::ForEachBase ( this Self && ,
Function && function )
inlineconstexpr

Operate on each of the explicit base class of this type with a lambda function template. If any given type also happens to match CHasBases, iterate on their base types too recursively.

This is the same as ForEachExplicitBase but for object instances of this type.

Usage:

class FMyClass : public TInherit<FFoo, FBar>
{...}
FMyClass value;
value.ForEachBase([] <typename T> ()
{
UE_LOG(LogTemp, Display, TEXT_"%s", *TTypeString<T>())
});
#define TEXT_
A convenience alternative to Unreal's own TEXT macro but this one doesn't require parenthesis around ...
Definition TextMacros.h:53
Template Parameters
Selfdeducing this
FunctionType of per-base operation
Parameters
functionPer-base operation

Definition at line 153 of file Inheritance.h.


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