|
Boost : |
Subject: Re: [boost] [intro] Preview: Introspection library
From: Matus Chochlik (chochlik_at_[hidden])
Date: 2010-06-28 14:30:31
On Mon, Jun 28, 2010 at 4:50 PM, Stefan Strasser <strasser_at_[hidden]> wrote:
> 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.
I would be interested in some examples if you were kind enough to
provide them.
> 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.
After I tie up some loose ends on Mirror, I'm planning to
ask for opinions about the library on this list and start
a wider discussion. However currently I have to attend
to some other projects, but I'm expecting to have some free
time to work on Mirror in a couple of days again.
>
> 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.)
My mistake I've had only a quick glance at Intro, from which
I incorrectly assumed that it does.
>
> 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.
Cooperation with Boost.Serialization's object tracking is one
of the things I need to incorporate into Mirror in order for it
to be usable with Serialization.
BR
Matus
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk