[C++-sig] adding types to module A from modules B, C, etc.

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Sun Aug 25 05:43:05 CEST 2002


I have made good progress with exposing a family of C++ array types to
Python (of course via Boost.Python). At the Python level it works like
this:

from somewhere import flex
d = flex.double() # one-dimensional
d.append(3)
c = flex.complex_double(flex.grid((10,20,30))) # three-dimensional
# etc. for bool int, long, float and a few other types

I also need a number of arrays with custom element types. E.g. this
simple one:

t = flex.triple() # one-dimensional array of triples
t.append((1,2,3)) # append one triple

To make this generally usable, I'd like to separate the array toolbox
from the rest of my (crystallographic) application. At the same time
I'd like to avoid this:

from somewhere import standard_flex # with int, double, etc.
from somewhere_else import custom_flex # with triple and other custom types

In other words, I'd like to add additional types to a central module
flex from a number of other modules: the modules that expose the custom
types.

Isn't this related to Dave Hawke's ideas? Could I do it right now in V2?
If not, how difficult would it be do get there?

Thanks,
        Ralf


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com




More information about the Cplusplus-sig mailing list