|
Boost : |
Subject: Re: [boost] [intro] Preview: Introspection library
From: Stefan Strasser (strasser_at_[hidden])
Date: 2010-06-28 10:50:19
Zitat von Matus Chochlik <chochlik_at_[hidden]>:
> On Mon, Jun 28, 2010 at 3:32 PM, Sohail Somani <sohail_at_[hidden]> wrote:
>> On 10-06-28 8:00 AM, Stefan Strasser wrote:
>>>
>>> template<class Mapping>
>>> friend void introspect(Mapping mapping,type<A>){
>>> Â mapping
>>> Â Â (base_class<A_base>() Â Â Â Â Â Â Â Â Â )
>>>   (member<A,int       ,&A::m_a>()  )
>>>   (member<A,float      ,&A::m_b>()  )
>>> Â Â (member<A,std::vector<int>,&A::m_vec>())
>>> Â ();
>>> }
>>
>> I think a library like this would be useful.
>
> Just FYI there is also another introspection/reflection library
> being developed
> for boost called Mirror. It can be downloaded from sourceforge here:
> http://sourceforge.net/projects/mirror-lib/files/
> or from the boost vault.
I did look at Mirror as you know, however, AFAIU it does not fulfill
my requirement of an easy-to-implement concept that can be used to
implement no-overhead introspection algorithms.
In case I got that wrong or in case that changes, I'd be happy to
switch to Mirror for gaining access to the class members, as the focus
of my library is on the algorithms, with introspection as a means to
this end.
The problem domain of "Intro" isn't really introspection/reflection,
but algorithms using introspection.
> For example Mirror
> currently does not
> cooperate well with Boost.Serialization, but this is one of the things
> on my TODO list.
Intro does not coorperate with Boost.Serialization but implements
serialization on its own (although it is planned to fall back to the
Serializable concept in case introspect() is not available.)
Boost.Serialization has several implementation related issues but also
problems that are by design (e.g. "track_selectively") that do not
allow for optimal performance. see my performance comparison.
Stefan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk