• Advertisement
Sign in to follow this  

Enumerate factories behaviours

Recommended Posts

I create script api dumper and use that code:

for (asUINT m = 0, mc = type->GetBehaviourCount(); m < mc; m++) {
    asEBehaviours bh;
    asIScriptFunction* pM = type->GetBehaviourByIndex(m, &bh);
    if (bh == asBEHAVE_CONSTRUCT || bh == asBEHAVE_DESTRUCT || bh == asBEHAVE_FACTORY)
        Log::WriteRaw(String(pM->GetDeclaration(false, false, true)) + ";\n");
}

But for references types their factories not appear in list.

I explore the code in GetBehaviourByIndex - in behaviours list include only ctors:

	// For reference types, the factories are also stored in the constructor
	// list, so it is sufficient to enumerate only those
	if( index - count < beh.constructors.GetLength() )
	{
		if( outBehaviour ) *outBehaviour = asBEHAVE_CONSTRUCT;
		return engine->scriptFunctions[beh.constructors[index - count]];
	}
	else 
		count += (asUINT)beh.constructors.GetLength();

But I can not find , where the factories is pushed to ctors list.

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement