MCPcopy Create free account
hub / github.com/anjo76/angelscript / WhoIsCalling

Function WhoIsCalling

sdk/tests/test_feature/source/test_nested.cpp:47–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47string WhoIsCalling()
48{
49 asIScriptContext* ctx = asGetActiveContext();
50 string callingFunction;
51
52 // Test calling GetThisPointer at each level, including the ones indicating nested states
53 for (asUINT n = 0; n < ctx->GetCallstackSize(); n++)
54 {
55 asIScriptFunction *func = ctx->GetFunction(n);
56 callingFunction = func ? func->GetName() : "";
57
58 void *obj = ctx->GetThisPointer(n);
59 assert(obj == 0);
60 void* var = ctx->GetAddressOfVar(0, n);
61 }
62 return callingFunction;
63}
64
65bool TestNested()
66{

Callers

nothing calls this directly

Calls 5

GetCallstackSizeMethod · 0.80
GetThisPointerMethod · 0.80
GetAddressOfVarMethod · 0.80
GetFunctionMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected