Reflection issues (Script variables and Derivated Classes)

55 views
Skip to first unread message

cristopher Ismael Sosa Abarca

unread,
Sep 8, 2014, 7:12:59 PM9/8/14
to helium...@googlegroups.com
After to playing around the Reflection library, worked fine i guessed. I want to my script variables ready for a property editor, using possibly the Reflection library but i only see its capable only C++ strictly, and i didn't find some appropiate method to register it, usuallly the variables names and types is given via a strings.

The next question is i have two reflected classes one derives from another, and reviewed the README.md file from the Reflect repository and didn't find any notes about reflected classes and derivation, only structs, the derivated class can inherit the reflected variables normally without writting additional code?

There's some advice? thanks. and sorry for my english.

cristopher Ismael Sosa Abarca

unread,
Sep 8, 2014, 10:44:16 PM9/8/14
to helium...@googlegroups.com
Other thing. I'm using AngelScript is strongly typed unlike many scripting engines (as lua), but it's possible to integrate the Reflection (or using Inspect & Foundation) using the AngelScript C++ Interface or i have to bind the Helium frameworks to AngelScript?. Thanks. 

Geoff Evans

unread,
Sep 8, 2014, 11:51:09 PM9/8/14
to helium...@googlegroups.com
Well, the C++ reflection system has a canonical Object root class, so really every class is a derived class, so you don't do anything differently.  Struct types has not canonical root class, so you need different instrumentation for base types and derived types.

Geoff Evans

unread,
Sep 8, 2014, 11:52:37 PM9/8/14
to helium...@googlegroups.com
Right now there isn't built-in support for reflecting non-C++ types.  Does AngelScript not have reflection built in?  If it does you would just need to add an engine to Inspect to generate the appropriate property widgets... Reflect doesn't really do the heavy lifting for that.

cristopher Ismael Sosa Abarca

unread,
Sep 9, 2014, 11:32:09 AM9/9/14
to helium...@googlegroups.com
Before a quick search yes, AngelScript integrates reflection, (Serialization as well), but any idea to create my own "engine" to Inspect?, because my engine is mainly heavily scripted, and using OGRE (i hope can't make any problem since their memory management, threading and includes their own "foundation" frameworks)

Any throughts?. And thanks for your response.

Geoff Evans

unread,
Sep 9, 2014, 11:36:15 AM9/9/14
to helium...@googlegroups.com
Look at https://github.com/HeliumProject/Inspect/blob/master/Reflect.h, including code in the broader Helium codebase to see how it is consumed.

That is the code that traverses Helium::Reflect types, and binds controls to instance data (fields).  Simply re-author this code to analyze AngelScript types (and bind data to AngelScript instances), and Inspect should do what you want.

cristopher Ismael Sosa Abarca

unread,
Sep 9, 2014, 1:28:55 PM9/9/14
to helium...@googlegroups.com
Oh i see thanks you!,  i'm now understand
Reply all
Reply to author
Forward
0 new messages