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... | |
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.
value | A sample value of the type T . This may be used to compute the Python type associated with the C++ type T . |
type | The 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().
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.
value | A sample object of type T that will be used to determine the Python type associated with T, if type is not specified. |
type | The 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.