Jump to content
  • Advertisement
Sign in to follow this  
Jason Goepel

asEP_ALLOW_IMPLICIT_HANDLE_TYPES

This topic is 2083 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know this option is experimental, but does it work at all?  I'm trying to register a class with "@Name" and this option true, but it fails with asINVALID_NAME.  token = ttHandle

 

as_scriptengine.cpp(1687)

// Make sure the name is not a reserved keyword
size_t tokenLen;
int token = tok.GetToken(name, typeName.GetLength(), &tokenLen);
if( token != ttIdentifier || typeName.GetLength() != tokenLen )
	return ConfigError(asINVALID_NAME, "RegisterObjectType", name, 0);

asEP_ALLOW_IMPLICIT_HANDLE_TYPES

This option is experimental. By turning it on script classes can be declared to always be treated as handles by declaring the class with @ before the name of the class. When this is done all variables of that type will be handles, and the assignment operator will always perform a handle assignment.

Share this post


Link to post
Share on other sites
Advertisement

It is so experimental and poorly documented that not even I know exactly how it works. I had to take a peek at code to remember what it does. :)

 

This engine property currently only affects script classes. You cannot register application types to use the implicit handle feature.

 

To declare a script class to use implicit handle you write the script like this:

 

[source]

class@ MyClass {}

[/source]

 

Once the class is declared to use implicit handles, all variables and parameters declared of that type will be implicitly declared as handles, and the assignment operator will be implicitly treated as a handle assignment instead of an value assignment.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!