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

Function createBar

sdk/tests/test_feature/source/test_scriptstruct.cpp:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27};
28
29void createBar()
30{
31 asIScriptContext *ctx = gEngine->CreateContext();
32
33 asIScriptModule *module = gEngine->GetModule("script");
34 gBarType = gEngine->GetTypeInfoById(module->GetTypeIdByDecl("Bar"));
35 asIScriptFunction *factory = gBarType->GetFactoryByDecl("Bar @Bar()");
36 ctx->Prepare(factory);
37 ctx->Execute();
38 gBar = *(asIScriptObject**)ctx->GetAddressOfReturnValue();
39 gBar->AddRef();
40
41 ctx->Release();
42}
43
44void callMethodOfBar(){
45 asIScriptContext* ctx = gEngine->CreateContext();

Callers 1

Test_mainFunction · 0.85

Calls 10

CreateContextMethod · 0.80
GetTypeInfoByIdMethod · 0.80
ExecuteMethod · 0.80
GetModuleMethod · 0.45
GetTypeIdByDeclMethod · 0.45
GetFactoryByDeclMethod · 0.45
PrepareMethod · 0.45
AddRefMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected