Reflection in game engine (c++)
Gabriel Sassone <[email protected]> Thu, 14 Mar 2013 11:09:30 -0700
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <CAFcPrsFBD6mgMFR8dFsi3=SsPM04ABN97oQPJj4kvdoc3qbf_A@mail.gmail.com> |
--===============0181951293==
Content-Type: multipart/alternative; boundary=bcaec554dcaa96205704d7e66cc4
--bcaec554dcaa96205704d7e66cc4
Content-Type: text/plain; charset=ISO-8859-1
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
--bcaec554dcaa96205704d7e66cc4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello gents,<div>=A0 =A0I wanted to experiment with reflection and I found =
different way to obtain it:</div><div><br></div><div>=A0 1) Invasive macro =
based registration</div><div>=A0 2) Reflection visitor pattern</div><div>=
=A0 3) Parsing pdb/clang stuff and create a manual table of what you want/n=
eed</div>
<div>=A0 4) c++ custom parser that uses tags to create reflection informati=
ons (like a comment near a member, ...) (exuberant ctags???)</div><div>=A0 =
5) create serializable/reflected classes in a data format, then run a tool =
that generates headers and cpps</div>
<div><br></div><div>I am trying to figure out flaws and merits of each kind=
, and even if there are other solutions.</div><div>I love the idea to have =
the possibility to serialize in and out structures, access fields and chang=
e values, stream in/out stuff from network ,and maybe link with scripting.<=
/div>
<div><br></div><div>My goal is to have fast iteration times, both artists a=
nd programmers, and I achieved it for rendering programmers already with ha=
ving json binarized configurable rendering, but still there are code stuff =
that are not easy to achieve.</div>
<div><br></div><div>Here are my thoughts, but I would like to hear your ide=
as and experiences!</div><div><br></div><div>1) Very precise on what you ca=
n register/serialize, but painful to maintain or plug into an existing code=
base</div>
<div>2) Less precise but you just need one method per class, that you can u=
se to serialize/reflect. Still bad in maintaining, but better in plugging i=
n.</div><div>3) You make the compiler do the work, then translate the infor=
mations you need in your format. Easy to maintain, to plug...maybe slow in =
parsing? Slow your build pipeline?</div>
<div>4) maybe easier than using pdbs, but less powerful (you cannot invoke =
methods on objects). should be faster than 3.</div><div>5) crazy idea. requ=
ires generation of code from outside...powerful like 4, so data reflection,=
but you cannot invoke methods if you want.</div>
<div><br></div><div>What are your experiences/thoughts?</div><div><br></div=
><div>Thanks to everyone that read this mail!</div><div>=A0</div><div>=A0 =
=A0 Gabriel</div><div><br></div>
--bcaec554dcaa96205704d7e66cc4--
--===============0181951293==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
--===============0181951293==--