Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::mpi::python Namespace Reference

Namespaces

 detail
 

Classes

class  content
 INTERNAL ONLY. More...
 
class  skeleton_proxy
 INTERNAL ONLY. More...
 
class  skeleton_proxy_base
 INTERNAL ONLY. More...
 

Functions

template<typename T >
void register_serialized (const T &value=T(), PyTypeObject *type=0)
 Register the type T for direct serialization within Boost.MPI. More...
 
template<typename T >
void register_skeleton_and_content (const T &value=T(), PyTypeObject *type=0)
 Registers a type for use with the skeleton/content mechanism in Python. More...
 

Function Documentation

template<typename T >
void boost::mpi::python::register_serialized ( const T value = T(),
PyTypeObject *  type = 0 
)

Register the type T for direct serialization within Boost.MPI.

The register_serialized function registers a C++ type for direct serialization within Boost.MPI. Direct serialization elides the use of the Python pickle package when serializing Python objects that represent C++ values. Direct serialization can be beneficial both to improve serialization performance (Python pickling can be very inefficient) and to permit serialization for Python-wrapped C++ objects that do not support pickling.

Parameters
valueA sample value of the type T. This may be used to compute the Python type associated with the C++ type T.
typeThe Python type associated with the C++ type T. If not provided, it will be computed from the same value value.

References boost::python::register_serialized(), boost::detail::type, and boost::program_options::value().

template<typename T >
void boost::mpi::python::register_skeleton_and_content ( const T value = T(),
PyTypeObject *  type = 0 
)

Registers a type for use with the skeleton/content mechanism in Python.

The skeleton/content mechanism can only be used from Python with C++ types that have previously been registered via a call to this function. Both the sender and the transmitter must register the type. It is permitted to call this function multiple times for the same type T, but only one call per process per type is required. The type T must be Serializable.

Parameters
valueA sample object of type T that will be used to determine the Python type associated with T, if type is not specified.
typeThe Python type associated with the C++ type T. If not provided, it will be computed from the same value value.

References boost::mpi::python::detail::skeleton_content_handler::get_content, boost::python::detail::get_direct_serialization_table(), boost::mpi::python::detail::skeleton_content_handler::get_skeleton_proxy, boost::iostreams::gzip::flags::name, boost::python::no_init, boost::mpi::python::detail::register_skeleton_and_content_handler(), boost::mpi::python::detail::skeleton_and_content_handler_registered(), boost::mpi::python::detail::skeleton_proxy_base_type, and T.