Exemplo n.º 1
0
// internal
asCScriptFunction::asCScriptFunction(asCScriptEngine *engine, asCModule *mod, asEFuncType _funcType)
{
	refCount.set(1);
	this->engine           = engine;
	this->scriptData       = 0;
	funcType               = _funcType;
	module                 = mod;
	objectType             = 0;
	name                   = "";
	isReadOnly             = false;
	isPrivate              = false;
	isFinal                = false;
	isOverride             = false;
	sysFuncIntf            = 0;
	signatureId            = 0;
	dontCleanUpOnException = false;
	vfTableIdx             = -1;
	gcFlag                 = false;
	userData               = 0;
	id                     = 0;
	accessMask             = 0xFFFFFFFF;
	isShared               = false;
	nameSpace              = engine->nameSpaces[0];
	objForDelegate         = 0;
	funcForDelegate        = 0;
	listPattern            = 0;

	if( funcType == asFUNC_SCRIPT )
		AllocateScriptFunctionData();

	// Notify the GC of script functions
	if( (funcType == asFUNC_SCRIPT && mod == 0) || (funcType == asFUNC_DELEGATE) )
		engine->gc.AddScriptObjectToGC(this, &engine->functionBehaviours);
}
Exemplo n.º 2
0
// internal
asCScriptFunction::asCScriptFunction(asCScriptEngine *engine, asCModule *mod, asEFuncType _funcType)
{
	funcType               = _funcType;
	if( funcType == asFUNC_DELEGATE )
	{
		// Delegates behave like object instances, rather than script code
		externalRefCount.set(1);
		internalRefCount.set(0);
	}
	else
	{
		internalRefCount.set(1);
		externalRefCount.set(0);
	}

	this->engine           = engine;
	this->scriptData       = 0;
	module                 = mod;
	objectType             = 0;
	name                   = "";
	isReadOnly             = false;
	isPrivate              = false;
	isProtected            = false;
	isFinal                = false;
	isOverride             = false;
	sysFuncIntf            = 0;
	signatureId            = 0;
	dontCleanUpOnException = false;
	vfTableIdx             = -1;
	gcFlag                 = false;
	userData               = 0;
	id                     = 0;
	accessMask             = 0xFFFFFFFF;
	isShared               = false;
	nameSpace              = engine->nameSpaces[0];
	objForDelegate         = 0;
	funcForDelegate        = 0;
	listPattern            = 0;

	if( funcType == asFUNC_SCRIPT )
		AllocateScriptFunctionData();

	// Notify the GC of delegates
	if( funcType == asFUNC_DELEGATE )
		engine->gc.AddScriptObjectToGC(this, &engine->functionBehaviours);
}