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

Method CreateVirtualFunction

sdk/angelscript/source/as_builder.cpp:4444–4473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4442}
4443
4444int asCBuilder::CreateVirtualFunction(asCScriptFunction *func, int idx)
4445{
4446 asCScriptFunction *vf = asNEW(asCScriptFunction)(engine, module, asFUNC_VIRTUAL);
4447 if( vf == 0 )
4448 return asOUT_OF_MEMORY;
4449
4450 vf->name = func->name;
4451 vf->nameSpace = func->nameSpace;
4452 vf->returnType = func->returnType;
4453 vf->parameterTypes = func->parameterTypes;
4454 vf->inOutFlags = func->inOutFlags;
4455 vf->id = engine->GetNextScriptFunctionId();
4456 vf->objectType = func->objectType;
4457 vf->objectType->AddRefInternal();
4458 vf->signatureId = func->signatureId;
4459 vf->vfTableIdx = idx;
4460 vf->traits = func->traits;
4461
4462 // Clear the shared trait since the virtual function should not have that
4463 vf->SetShared(false);
4464
4465 // It is not necessary to copy the default args, as they have no meaning in the virtual function
4466
4467 module->AddScriptFunction(vf);
4468
4469 // Add a dummy to the builder so that it doesn't mix up function ids
4470 functions.PushLast(0);
4471
4472 return vf->id;
4473}
4474
4475asCObjectProperty *asCBuilder::AddPropertyToClass(sClassDeclaration *decl, const asCString &name, const asCDataType &dt, bool isPrivate, bool isProtected, bool isInherited, asCScriptCode *file, asCScriptNode *node)
4476{

Callers

nothing calls this directly

Calls 5

SetSharedMethod · 0.80
PushLastMethod · 0.80
AddRefInternalMethod · 0.45
AddScriptFunctionMethod · 0.45

Tested by

no test coverage detected