Subject: Re: [boost] Is there any interest in a library which solves C++ class reflection feature just like Java does?
From: Matus Chochlik (chochlik_at_[hidden])
Date: 2011-12-07 09:12:43
On Wed, Dec 7, 2011 at 2:52 PM, jinhua luo <ljh.home.king_at_[hidden]> wrote:
> Hi Matus,
> Could you write some codes to implement the same example I showed in my
> first mail? That is, define a concrete class in the shared library, and
> declare/register it there, while the main program just dynamically loads
> the shared library (note that do not need any initialization, just dlopen
> is enough, do not need any symbol exported there and be loaded via dlsym),
> reflects the class, invoke its methods, access its members.
I'm unfortunately up to my neck in other projects right now :),
so I cannot come up with a working example right away,
but I may try if I'll have some free time.
But anyway, I don't think that the constraints that the library
should not export anything explicitly are necessary. It always
can be done with a macro in the library code.
Also I don't see why the application should not use
dlsym / GetProcAddress (at least indirectly). This could
easily be hidden in the reflection code that the app uses
to get the meta-data.
> Then we can have more clear comparison regarding the same context between
> two libraries.