LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::orc::shared::MethodWrapperHandler< RetT, ClassT, ArgTs > Class Template Reference

A function object that takes an ExecutorAddr as its first argument, casts that address to a ClassT*, then calls the given method on that pointer passing in the remaining function arguments. More...

#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"

Public Types

using MethodT = RetT(ClassT::*)(ArgTs...)
 

Public Member Functions

 MethodWrapperHandler (MethodT M)
 
RetT operator() (ExecutorAddr ObjAddr, ArgTs &...Args)
 

Detailed Description

template<typename RetT, typename ClassT, typename... ArgTs>
class llvm::orc::shared::MethodWrapperHandler< RetT, ClassT, ArgTs >

A function object that takes an ExecutorAddr as its first argument, casts that address to a ClassT*, then calls the given method on that pointer passing in the remaining function arguments.

This utility removes some of the boilerplate from writing wrappers for method calls.

class MyClass {
public:
void myMethod(uint32_t, bool) { ... }
};
// SPS Method signature -- note MyClass object address as first argument.
using SPSMyMethodWrapperSignature =
SPSTuple<SPSExecutorAddr, uint32_t, bool>;
WrapperFunctionResult
myMethodCallWrapper(const char *ArgData, size_t ArgSize) {
return WrapperFunction<SPSMyMethodWrapperSignature>::handle(
ArgData, ArgSize, makeMethodWrapperHandler(&MyClass::myMethod));
}
MethodWrapperHandler< RetT, ClassT, ArgTs... > makeMethodWrapperHandler(RetT(ClassT::*Method)(ArgTs...))
Create a MethodWrapperHandler object from the given method pointer.

Definition at line 604 of file WrapperFunctionUtils.h.

Member Typedef Documentation

◆ MethodT

template<typename RetT , typename ClassT , typename... ArgTs>
using llvm::orc::shared::MethodWrapperHandler< RetT, ClassT, ArgTs >::MethodT = RetT (ClassT::*)(ArgTs...)

Definition at line 606 of file WrapperFunctionUtils.h.

Constructor & Destructor Documentation

◆ MethodWrapperHandler()

template<typename RetT , typename ClassT , typename... ArgTs>
llvm::orc::shared::MethodWrapperHandler< RetT, ClassT, ArgTs >::MethodWrapperHandler ( MethodT  M)
inline

Definition at line 607 of file WrapperFunctionUtils.h.

Member Function Documentation

◆ operator()()

template<typename RetT , typename ClassT , typename... ArgTs>
RetT llvm::orc::shared::MethodWrapperHandler< RetT, ClassT, ArgTs >::operator() ( ExecutorAddr  ObjAddr,
ArgTs &...  Args 
)
inline

Definition at line 608 of file WrapperFunctionUtils.h.

References llvm::orc::ExecutorAddr::toPtr().


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