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

Method MakeDelegate

sdk/angelscript/source/as_scriptfunction.cpp:190–208  ·  view source on GitHub ↗

internal

Source from the content-addressed store, hash-verified

188
189// internal
190void asCScriptFunction::MakeDelegate(asCScriptFunction *func, void *obj)
191{
192 // Increase the reference of the function and object
193 func->AddRef();
194 funcForDelegate = func;
195
196 func->GetEngine()->AddRefScriptObject(obj, func->GetObjectType());
197 objForDelegate = obj;
198
199 // The return type and parameters are copied from the delegated method to this object
200 // TODO: optimize: Do we really need to copy? Whenever requested the delegate can simply return the delegated methods' info directly
201 parameterTypes = func->parameterTypes;
202 returnType = func->returnType;
203 inOutFlags = func->inOutFlags;
204
205 // The delegate doesn't own the parameters as it will only forward them to the real method
206 // so the exception handler must not clean up the parameters for the delegate
207 dontCleanUpOnException = true;
208}
209
210// interface
211void *asCScriptFunction::GetAuxiliary() const

Callers 1

CreateDelegateFunction · 0.80

Calls 4

AddRefScriptObjectMethod · 0.80
AddRefMethod · 0.45
GetEngineMethod · 0.45
GetObjectTypeMethod · 0.45

Tested by

no test coverage detected