Jump to content
  • Advertisement
belenar

Query class for inherited mixins from application

Recommended Posts

Posted (edited)

Given:

mixin class Foo {}

class Bar : Foo {}

Is there a way to determine from the C++ side that Bar inherits from Foo?

 

edit: I finally figured out how to search this forum, and it looks like the answer is no, the mixin information doesn't persist past compilation and the closest approximation would be using metadata?

Edited by belenar

Share this post


Link to post
Share on other sites
Advertisement
On 5/18/2019 at 11:26 PM, belenar said:

the mixin information doesn't persist past compilation

Correct. Once the script is compiled, there is no way to tell which if the code was produced via a mixin or simply a copy of the script code.

For what reason do you need to know that the mixin was used? metadata might be used, but you could potentially also solve it by using interfaces. 

interface iFoo {}

mixin class Foo : iFoo {}

class Bar : Foo {} // Now Bar implements interface iFoo due to mixin Foo

 

Share this post


Link to post
Share on other sites

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

  • 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!