Loading...
Searching...
No Matches
Dune::MPIPack Class Reference

`#include <dune/common/parallel/mpipack.hh>`

## Public Member Functions

| MPIPack (Communication< MPI_Comm > comm, std::size_t size=0)
| MPIPack (const MPIPack &)=delete
MPIPack & | operator= (const MPIPack &other)=delete
| MPIPack (MPIPack &&)=default
MPIPack & | operator= (MPIPack &&other)=default
template<class T>
void | pack (const T &data)
| Packs the data into the object. Enlarges the internal buffer if necessary.
template<class T>
auto | unpack (T &data) -> std::enable_if_t< decltype(getMPIData(data))::static_size, void >
| Unpacks data from the object.
template<class T>
auto | unpack (T &data) -> std::enable_if_t<!decltype(getMPIData(data))::static_size, void >
| Unpacks data from the object.
template<typename T>
MPIPack & | read (T &t)
| Unpacks data from the object.
template<typename T>
MPIPack & | write (const T &t)
| Packs the data into the object. Enlarges the internal buffer if necessary.
void | resize (size_t size)
| Resizes the internal buffer.
void | enlarge (int s)
| Enlarges the internal buffer.
size_t | size () const
| Returns the size of the internal buffer.
void | seek (int p)
| Sets the position in the buffer where the next pack/unpack operation should take place.
int | tell () const
| Gets the position in the buffer where the next pack/unpack operation should take place.
bool | eof () const
| Checks whether the end of the buffer is reached.

## Static Public Member Functions

static int | getPackSize (int len, const MPI_Comm &comm, const MPI_Datatype &dt)
| Returns the size of the data needed to store the data in an MPIPack. See MPI_Pack_size.

## Friends

struct | MPIData< MPIPack >
struct | MPIData< const MPIPack >
template<typename T>
MPIPack & | operator<< (MPIPack &p, const T &t)
| Packs the data into the object. Enlarges the internal buffer if necessary.
template<typename T>
MPIPack & | operator>> (MPIPack &p, T &t)
| Unpacks data from the object.
bool | operator== (const MPIPack &a, const MPIPack &b)
bool | operator!= (const MPIPack &a, const MPIPack &b)

## Constructor & Destructor Documentation

## MPIPack() [1/3]

Dune::MPIPack::MPIPack | ( | Communication< MPI_Comm > | comm,
|  | std::size_t | size = 0 )

inline

## MPIPack() [2/3]

Dune::MPIPack::MPIPack | ( | const MPIPack & |  | ) |

delete

## MPIPack() [3/3]

Dune::MPIPack::MPIPack | ( | MPIPack && |  | ) |

default

## Member Function Documentation

## enlarge()

void Dune::MPIPack::enlarge | ( | int | s | ) |

inline

Enlarges the internal buffer.

## eof()

bool Dune::MPIPack::eof | ( |  | ) | const

inline

Checks whether the end of the buffer is reached.

## getPackSize()

int Dune::MPIPack::getPackSize | ( | int | len,
|  | const MPI_Comm & | comm,
|  | const MPI_Datatype & | dt )

inline static

Returns the size of the data needed to store the data in an MPIPack. See MPI_Pack_size.

## operator=() [1/2]

MPIPack & Dune::MPIPack::operator= | ( | const MPIPack & | other | ) |

delete

## operator=() [2/2]

MPIPack & Dune::MPIPack::operator= | ( | MPIPack && | other | ) |

default

## pack()

template<class T>

void Dune::MPIPack::pack | ( | const T & | data | ) |

inline

Packs the data into the object. Enlarges the internal buffer if necessary.

Exceptions

  MPIError |

## read()

template<typename T>

MPIPack & Dune::MPIPack::read | ( | T & | t | ) |

inline

Unpacks data from the object.

Exceptions

  MPIError |

## resize()

void Dune::MPIPack::resize | ( | size_t | size | ) |

inline

Resizes the internal buffer.

Parameters

  size | new size of internal buffer

## seek()

void Dune::MPIPack::seek | ( | int | p | ) |

inline

Sets the position in the buffer where the next pack/unpack operation should take place.

## size()

size_t Dune::MPIPack::size | ( |  | ) | const

inline

Returns the size of the internal buffer.

## tell()

int Dune::MPIPack::tell | ( |  | ) | const

inline

Gets the position in the buffer where the next pack/unpack operation should take place.

## unpack() [1/2]

template<class T>

auto Dune::MPIPack::unpack | ( | T & | data | ) | ->std::enable_if_t< decltype(getMPIData(data))::static_size, void >

inline

Unpacks data from the object.

Exceptions

  MPIError |

## unpack() [2/2]

template<class T>

auto Dune::MPIPack::unpack | ( | T & | data | ) | ->std::enable_if_t<!decltype(getMPIData(data))::static_size, void >

inline

Unpacks data from the object.

Exceptions

  MPIError |

## write()

template<typename T>

MPIPack & Dune::MPIPack::write | ( | const T & | t | ) |

inline

Packs the data into the object. Enlarges the internal buffer if necessary.

Exceptions

  MPIError |

## Friends And Related Symbol Documentation

## MPIData< const MPIPack >

friend struct MPIData< const MPIPack >

friend

## MPIData< MPIPack >

friend struct MPIData< MPIPack >

friend

## operator!=

bool operator!= | ( | const MPIPack & | a,
|  | const MPIPack & | b )

friend

## operator<<

template<typename T>

MPIPack & operator<< | ( | MPIPack & | p,
|  | const T & | t )

friend

Packs the data into the object. Enlarges the internal buffer if necessary.

Exceptions

  MPIError |

## operator==

bool operator== | ( | const MPIPack & | a,
|  | const MPIPack & | b )

friend

## operator>>

template<typename T>

MPIPack & operator>> | ( | MPIPack & | p,
|  | T & | t )

friend

Unpacks data from the object.

Exceptions

  MPIError |

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

- mpipack.hh