#include <reflectionbase.h>
函数 represents a C++ function. It describes the name, return type and parameter types of the function, but also has the Invoke method to invoke the function.
There are three kinds of functions:
c
this instance)
const this
instance)
The implicit
this
argument is not part of the parameter types, but for the Invoke method it has to be specified as first argument if the function is an instance function.
公共成员函数 |
|
MAXON_METHOD Result < void > | Invoke (void *result, const Block < Argument > &arguments) const |
template<typename T , typename... ARGS> | |
Result < typename InvokeHelper < T >::type > | Invoke (ARGS &&... args) const |
MAXON_METHOD ParameterType | GetReturnType () const |
MAXON_METHOD Block < const ParameterType > | GetParameterTypes () const |
const MAXON_METHOD Block < const 参数 > & | GetParameters () const |
MAXON_METHOD Bool | IsPure () const |
MAXON_METHOD void * | GetAddress () const |
![]() |
|
enum maxon::reflection::Member::KIND | MAXON_ENUM_FLAGS_CLASS ( KIND ) |
const MAXON_METHOD Container * | GetEnclosingContainer () const |
MAXON_METHOD KIND | GetKind () const |
const MAXON_METHOD Id & | GetSimpleName () const |
const MAXON_METHOD Id & | GetId () const |
MAXON_METHOD String | ToString (const FormatStatement *fs=nullptr) const |
静态公共成员函数 |
|
static const MAXON_METHOD 函数 * | PrivateFindMethod (const InterfaceReference &vi, Int offset) |
static const 函数 * | Find (const Id &memberId) |
static MAXON_METHOD Result < void > | FindAll (const Id &memberId, const ValueReceiver < const 函数 * > &result) |
![]() |
|
static MAXON_METHOD Result < Bool > | GetMembers (const ValueReceiver < const Member & > &members) |
static const MAXON_METHOD Member * | Find (const Id &memberId) |
私有成员函数 |
|
MAXON_INTERFACE_NONVIRTUAL_DERIVED ( 函数 , MAXON_REFERENCE_NONE , "net.maxon.reflection.interface.function") |
Additional Inherited Members |
|
![]() |
|
enum |
KIND
{
PACKAGE , CLASS , FUNCTION , INSTANCE_FUNCTION , CONST_INSTANCE_FUNCTION , CONTAINER_TEST , FUNCTION_TEST } |
|
private |
MAXON_METHOD Result <void> Invoke | ( | void * | result , |
const Block < Argument > & | arguments | ||
) | const |
Invokes this function with the given arguments. If this is an instance function, the
this
pointer has to be given as first argument.
result
has to point to an object of the return type of the function, the result will then be written to that object. For a function with
void
return type,
result
may be
nullptr
.
[out] | result |
Pointer to a value to which the function result is written. May be
nullptr
if the functions returns
void
. The type of the value must be the return type of the function, otherwise the behaviour is undefined.
|
[in] | arguments |
Arguments for the function. For an instance function, the first argument is the
this
pointer. The arguments have to match in type, otherwise the behaviour is undefined.
|
void
function)
result
is
nullptr
, otherwise OK.
Result <typename InvokeHelper <T>::type> Invoke | ( | ARGS &&... | args | ) | const |
Invokes this function with the given arguments. If this is an instance function, the
this
pointer has to be given as first argument.
T
has to be of the form
R(A1, ..., An)
,其中
R
is the return type of the function and
A1
, ...,
An
are the parameter types. For instance functions,
A1
has to be the type of the additional
this
argument. If the types don't match the actual types of the function, the behaviour is undefined.
T |
Type of the function of the form
R(A1, ..., An)
. If this doesn't match the actual type, the behaviour is undefined.
|
[in] | args |
Arguments for the function. For an instance function, the first argument is the
this
pointer.
|
MAXON_METHOD ParameterType GetReturnType | ( | ) | const |
MAXON_METHOD Block <const ParameterType > GetParameterTypes | ( | ) | const |
const MAXON_METHOD Block <const 参数 >& GetParameters | ( | ) | const |
MAXON_METHOD Bool IsPure | ( | ) | const |
MAXON_METHOD void* GetAddress | ( | ) | const |
|
static |
|
static |
|
static |
Finds all functions overloads which have the given (unqualified)
id
.
[in] | memberId | A member id. |
[out] | result | Receiver for the found functions. |