dune-common  2.8.0
Public Member Functions | Static Public Member Functions | List of all members
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
 
MPIPackoperator= (const MPIPack &other)=delete
 
 MPIPack (MPIPack &&)=default
 
MPIPackoperator= (MPIPack &&other)=default
 
template<class T >
void pack (const T &data)
 Packs the data into the object. Enlarges the internal buffer if necessary. More...
 
template<class T >
auto unpack (T &data) -> std::enable_if_t< decltype(getMPIData(data))::static_size, void >
 Unpacks data from the object. More...
 
template<class T >
auto unpack (T &data) -> std::enable_if_t<!decltype(getMPIData(data))::static_size, void >
 Unpacks data from the object. More...
 
template<typename T >
MPIPackread (T &t)
 Unpacks data from the object. More...
 
template<typename T >
MPIPackwrite (const T &t)
 Packs the data into the object. Enlarges the internal buffer if necessary. More...
 
void resize (size_t size)
 Resizes the internal buffer. More...
 
void enlarge (int s)
 Enlarges the internal buffer. More...
 
size_t size () const
 Returns the size of the internal buffer. More...
 
void seek (int p)
 Sets the position in the buffer where the next pack/unpack operation should take place. More...
 
int tell () const
 Gets the position in the buffer where the next pack/unpack operation should take place. More...
 
bool eof () const
 Checks whether the end of the buffer is reached. More...
 

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. More...
 

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()

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

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
sizenew 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

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