|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-11-10 20:52:24
"George van den Driessche" <grebe_at_[hidden]> writes:
>> I'm stumped by how to store this information in any sort of container
>> though, since the properties are of different types. Any thoughts, or
>> is this madness?
>
> The properties are of different types, but the type information for
> properties will always be of the same type :) So you can generate a
> property set for your class, that includes the dictionary that maps
> names to property_type_info structures. Each property_type_info
> would be automatically generated from the static type of the
> property.
>
> The thing that's bugging me is that all the reflection mechanism is
> covered by Boost.Python because it relies on the same principles. I
> *think* the boost-langbinding list seems to know this, since you
> also need the reflection capabilities in order to support languages
> that aren't Python. But that list doesn't seem to have much traffic
> so I haven't much to go on.
We did some work on that project recently and presented it at the
Boost workshop at OOPSLA. See
http://boost-consulting.com/writing/oopsla04.html
http://boost-consulting.com/writing/langbinding.ppt
> In order to avoid too many reinvented wheels, I'd like to see
> Boost.Python split neatly into two stages:
>
> (a) Reflect C++ types into C++ objects. Each type for which you provide a
> reflection map will correspond to exactly one property_set object, which
> would contain a set of property_type_info objects.
> (b) Expose the types to Python using the objects created by (a).
We do have a front-end/back-end architecture, but I'm not sure whether
we're doing what you want.
> Once you've made that split, then you can add:
> (c) Expose the types to Lua using the objects created by (a).
> (d) Expose the types to <language-of-your-choice> using the objects created
> by (a).
> (e) Serialise the types, using results of (a).
This I have serious doubts about. What you'd expose for Python/Lua
binding would be an object's public interface: its abstraction. In
order to do serialization in that way, you'd likely have to expose an
object's guts: its implementation details.
> (f) Bind types to GUI objects, using results of (a).
What does it mean to bind a type to a GUI object?
> (g) ... you get the point.
I'm not sure.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk