Class base for working with il2cpp methods. More...
#include <MethodBase.hpp>
Public Member Functions | |
constexpr | MethodBase ()=default |
Create empty method base. | |
MethodBase (const MethodBase &other)=default | |
Copy method. | |
MethodBase (const IL2CPP::MethodInfo *info) | |
Create method from il2cpp method. | |
MethodBase (const IL2CPP::Il2CppReflectionMethod *reflectionMethod) | |
Create method from il2cpp reflection method. | |
MethodBase & | SetInstance (IL2CPP::Il2CppObject *val) |
Set method instance if it's non-static. | |
IL2CPP::MethodInfo * | GetInfo () const |
Get MethodInfo. | |
BNM_PTR | GetOffset () const |
Get method offset. | |
MethodBase | GetGeneric (const std::initializer_list< CompileTimeClass > &templateTypes) const |
Get typed version of current generic method. | |
MethodBase | GetOverride () const |
Get overridden method of current virtual method. | |
MethodBase & | operator[] (void *instance) |
Operator for setting instance. | |
MethodBase & | operator[] (IL2CPP::Il2CppObject *instance) |
Operator for setting instance. | |
MethodBase & | operator[] (UnityEngine::Object *instance) |
Operator for setting instance. | |
bool | IsValid () const noexcept |
Check if method is valid. | |
std::string | str () const |
Get full method name. | |
template<typename NewType> | |
Method< NewType > & | cast () const |
Cast method to be able to call it. | |
Public Attributes | |
IL2CPP::MethodInfo * | _data {} |
IL2CPP::Il2CppObject * | _instance {} |
uint8_t | _isStatic: 1 = false |
uint8_t | _isVirtual: 1 = false |
Class base for working with il2cpp methods.
This class provides fields and some basic functions to allow to call methods.
|
inlinedefault |
Copy method.
other | Other method |
BNM::MethodBase::MethodBase | ( | const IL2CPP::MethodInfo * | info | ) |
Create method from il2cpp method.
info | Il2cpp method |
BNM::MethodBase::MethodBase | ( | const IL2CPP::Il2CppReflectionMethod * | reflectionMethod | ) |
Create method from il2cpp reflection method.
reflectionMethod | Il2cpp reflection method |
MethodBase BNM::MethodBase::GetGeneric | ( | const std::initializer_list< CompileTimeClass > & | templateTypes | ) | const |
Get typed version of current generic method.
|
inline |
Get MethodInfo.
|
inline |
Get method offset.
MethodBase BNM::MethodBase::GetOverride | ( | ) | const |
Get overridden method of current virtual method.
|
inlinenodiscardnoexcept |
Check if method is valid.
|
inline |
|
inline |
|
inline |
MethodBase & BNM::MethodBase::SetInstance | ( | IL2CPP::Il2CppObject * | val | ) |
Set method instance if it's non-static.
instance | Instance |
|
inline |
Get full method name.
Returns string with full method name: ClassFullName.(method name){arguments count: ...} (static)/nothing