🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Query class for inherited mixins from application

Started by
1 comment, last by WitchLord 5 years, 1 month ago

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?

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

 

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement