Start wrapping seq_span
authorDiane Trout <diane@caltech.edu>
Wed, 29 Aug 2007 05:43:49 +0000 (05:43 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 29 Aug 2007 05:43:49 +0000 (05:43 +0000)
commit80ca9b3ccb2a64f22ab3039b9ee2ecbae2c43e10
tree43da707e9a5ba1f57ac28f9f03e4f841b9ec2a76
parent02fc4144044a430f8bee6617c0c9871d4ebe5e4d
Start wrapping seq_span
there were a couple of challanges. First off the stl_container_adapter I
was using didn't handle returning a const_reference particularly well,
so I had to add a get_const function.

The other was more insideous, the example the wiki had showed just setting
the python exception, it didn't generate a C++ exception. So when
boost::python tried to copy an undefined reference when it fell of
the end of a container I got a bus error.

The solution was to add in a C++/Python exception translater so I threw
a C++ exception indicating an IndexError, but then the it was transformed
into the appropriate Python exception.
py/CMakeLists.txt
py/alphabet.cpp [new file with mode: 0644]
py/module.cpp
py/seq_span.cpp [new file with mode: 0644]
py/stl_container_adapter.cpp [new file with mode: 0644]
py/stl_container_adapter.hpp
py/test/TestSeqSpan.py [new file with mode: 0644]