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

Method CreateDelegate

sdk/angelscript/source/as_scriptengine.cpp:641–657  ·  view source on GitHub ↗

interface

Source from the content-addressed store, hash-verified

639
640// interface
641asIScriptFunction *asCScriptEngine::CreateDelegate(asIScriptFunction *func, void *obj)
642{
643 if( func == 0 || obj == 0 )
644 return 0;
645
646 // The function must be a class method
647 asITypeInfo *type = func->GetObjectType();
648 if( type == 0 )
649 return 0;
650
651 // The object type must allow handles
652 if( (type->GetFlags() & asOBJ_REF) == 0 || (type->GetFlags() & (asOBJ_SCOPED | asOBJ_NOHANDLE)) )
653 return 0;
654
655 // Create the delegate the same way it would be created by the scripts
656 return AS_NAMESPACE_QUALIFIER CreateDelegate(reinterpret_cast<asCScriptFunction*>(func), obj);
657}
658
659asCScriptEngine::asCScriptEngine()
660{

Callers 1

TestFunction · 0.80

Calls 2

GetFlagsMethod · 0.80
GetObjectTypeMethod · 0.45

Tested by 1

TestFunction · 0.64