toast::python::register_container< T > Struct Template Reference
[toast python library]

#include <toast/python/container.hpp>

List of all members.


Detailed Description

template<typename T>
struct toast::python::register_container< T >

Register a container to be automatically wrapped in python with Boost.Python.

It's like magic! Just call register_container<std::vector<int> >(); in your Boost.Python module and vectors of int's are available within python. This will work for vector, list, deque, map, set, and bitset.

Other containers that meet the standard interface can be added easily and even non-standard containers can be added with some extra work. In both cases you just specialize register_container for the container you want to wrap. In the standard container case you just need to derive from detail::register_std_container or detail::register_std_ra_container if you want RandomAccess. In the case of a non-standard container you'll have to peek at the source for some examples of how we dealt with the standard containers.


The documentation for this struct was generated from the following file:

SourceForge.net Logo