Re: Reflection in game engine (c++)
Thatcher Ulrich <[email protected]> Thu, 14 Mar 2013 14:55:28 -0400
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <CAMa9PtQJhRwhx_tcpUOX=vFMfK9V5A7os1mW+3ZvcHNv9ft7jQ@mail.gmail.com> |
"CES"? On Thu, Mar 14, 2013 at 2:09 PM, Gabriel Sassone <[email protected]> wrote: > Hello gents, > I wanted to experiment with reflection and I found different way to > obtain it: > > 1) Invasive macro based registration > 2) Reflection visitor pattern > 3) Parsing pdb/clang stuff and create a manual table of what you want/need > 4) c++ custom parser that uses tags to create reflection informations > (like a comment near a member, ...) (exuberant ctags???) > 5) create serializable/reflected classes in a data format, then run a tool > that generates headers and cpps > > I am trying to figure out flaws and merits of each kind, and even if there > are other solutions. > I love the idea to have the possibility to serialize in and out structures, > access fields and change values, stream in/out stuff from network ,and maybe > link with scripting. > > My goal is to have fast iteration times, both artists and programmers, and I > achieved it for rendering programmers already with having json binarized > configurable rendering, but still there are code stuff that are not easy to > achieve. > > Here are my thoughts, but I would like to hear your ideas and experiences! > > 1) Very precise on what you can register/serialize, but painful to maintain > or plug into an existing codebase > 2) Less precise but you just need one method per class, that you can use to > serialize/reflect. Still bad in maintaining, but better in plugging in. > 3) You make the compiler do the work, then translate the informations you > need in your format. Easy to maintain, to plug...maybe slow in parsing? Slow > your build pipeline? > 4) maybe easier than using pdbs, but less powerful (you cannot invoke > methods on objects). should be faster than 3. > 5) crazy idea. requires generation of code from outside...powerful like 4, > so data reflection, but you cannot invoke methods if you want. > > What are your experiences/thoughts? > > Thanks to everyone that read this mail! > > Gabriel > > > _______________________________________________ > Sweng-Gamedev mailing list > [email protected] > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com