MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / init

Method init

src/hx/cppia/CppiaClasses.cpp:1350–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1348}
1349
1350void CppiaClassInfo::init(CppiaCtx *ctx, int inPhase)
1351{
1352 unsigned char *pointer = ctx->pointer;
1353 ctx->push( (hx::Object *) 0 ); // this
1354 AutoStack save(ctx,pointer);
1355
1356 if (inPhase==0)
1357 {
1358 for(int i=0;i<staticVars.size();i++)
1359 {
1360 staticVars[i]->runInit(ctx);
1361 if (staticVars[i]->name==HX_CSTRING("__meta__"))
1362 {
1363 // Todo - delete/clean value
1364 mClass->__meta__ = staticVars[i]->objVal;
1365 staticVars.erase( staticVars.begin() + i );
1366 i--;
1367 }
1368 }
1369 if (enumMeta)
1370 mClass->__meta__ = enumMeta->runObject(ctx);
1371
1372 for(int i=0;i<staticDynamicFunctions.size();i++)
1373 staticDynamicFunctions[i]->runInit(ctx);
1374 }
1375 else if (inPhase==1)
1376 {
1377 if (initExpr)
1378 initExpr->runVoid(ctx);
1379 }
1380}
1381
1382
1383Dynamic CppiaClassInfo::getStaticValue(const String &inName,hx::PropertyAccess inCallProp)

Callers 15

cppiaClassInitFunction · 0.45
SLJIT_CALL varraySetIntFunction · 0.45
SLJIT_CALL varraySetBoolFunction · 0.45
runObjectMethod · 0.45
operator()Method · 0.45
createMethod · 0.45
createMethod · 0.45
createMethod · 0.45
createMethod · 0.45

Calls 6

runInitMethod · 0.80
eraseMethod · 0.80
pushMethod · 0.45
sizeMethod · 0.45
runObjectMethod · 0.45
runVoidMethod · 0.45

Tested by

no test coverage detected