| Home | Libraries | People | FAQ | More

## Function template get_content

boost::mpi::get_content — Returns the content of an object, suitable for transmission via Boost.MPI.

## Synopsis

    // In header: <boost/mpi/skeleton_and_content.hpp>

    template<typename T> const content get_content(const T & x);

## Description

The function creates an absolute MPI datatype for the object, where all offsets are counted from the address 0 (a.k.a. `MPI_BOTTOM`) instead of the address `&x` of the object. This allows the creation of MPI data types for complex data structures containing pointers, such as linked lists or trees.

The disadvantage, compared to relative MPI data types is that for each object a new MPI data type has to be created.

The contents of an object can only be transmitted when the receiver already has an object with the same structure or shape as the sender. To accomplish this, first transmit the skeleton of the object using, e.g., `skeleton()` or ``skeleton_proxy``.

The type `T` has to allow creation of an absolute MPI data type (content).

Parameters:

`x` | the object for which the content will be transmitted.

Returns: | the content of the object `x`, which can be used for transmission via `send`, `recv`, or `broadcast`.