[C++-sig] Explaining the Magic

Brett Calcott brett.calcott at paradise.net.nz
Fri Jul 11 07:11:51 CEST 2003


Hi David,

I am in Aussie now, and though still homeless, I at least have an
office. I thought we could make a start on our plans to document some of
the boost python implementation. I brushed up on reStructuredText so, as
discussed I'll try and construct a document from our conversations.

As suggested I have had a look at the luabind conversation, and though I
understand bits here and there I need something to tie it all too.
Here's two starting questions:

1) What happens when you do the following:

    struct boring {};
    ...etc...
    class_<boring>("boring")
        ;

There seems to be a fair bit going on.

- Python needs a new ClassType to be registered.
- We need to construct a new type that can hold our boring struct.
- Inward and outward converters need to be registered for the type.

Can you gesture in the general direction where these things are done.

2) Can you give a brief overview of the data structures that are
   present in the registry and an overview of the process that happens
   as a type makes its way from c++ to python and back again.


In both of these cases, I'm quite capable of reading code - but the
thing I don't get from scanning the source is a sense of the
architecture, both structurally, and temporally (er, I mean in what
order things go on).


Cheers,
Brett (Kiwi in Oz)

ps. Take your time to answer these -- I am trying to write a paper, and
get some foundation boost_python simulation framework written, so I am
happy if we progress slowly...








More information about the Cplusplus-sig mailing list