6#ifndef DUNE_COMMON_PARALLEL_MPIDATA_HH
7#define DUNE_COMMON_PARALLEL_MPIDATA_HH
40 template<
class,
class =
void>
49 template<
class T,
class Enable>
52 friend auto getMPIData<T>(T&);
72 MPI_Datatype
type()
const {
100 decltype(std::declval<T>().size()),
101 typename std::decay_t<T>::value_type>>>{
104 using hasResizeOp =
decltype(std::declval<U>().resize(0));
107 friend auto getMPIData<T>(T&);
112 static constexpr bool static_size = std::is_const<T>::value || !Std::is_detected_v<hasResizeOp, T>;
114 return (
void*)
data_.data();
123 template<
class S = T>
125 -> std::enable_if_t<!std::is_const<S>::value || !Std::is_detected_v<hasResizeOp, S>>
Traits for type conversions and type information.
Traits classes for mapping types onto MPI_Datatype.
typename Impl::voider< Types... >::type void_t
Is void for all valid input types. The workhorse for C++11 SFINAE-techniques.
Definition typetraits.hh:40
Dune namespace.
Definition alignedallocator.hh:13
auto getMPIData(T &t)
Definition mpidata.hh:44
A traits class describing the mapping of types onto MPI_Datatypes.
Definition mpitraits.hh:41
T & data_
Definition mpidata.hh:54
MPI_Datatype type() const
Definition mpidata.hh:72
void * ptr() const
Definition mpidata.hh:61
int size() const
Definition mpidata.hh:68
static constexpr bool static_size
Definition mpidata.hh:66
MPIData(T &t)
Definition mpidata.hh:56
void get()
Definition mpidata.hh:90
MPIData()
Definition mpidata.hh:81
int size()
Definition mpidata.hh:87
void * ptr()
Definition mpidata.hh:84
MPI_Datatype type() const
Definition mpidata.hh:91
MPIData(T &t)
Definition mpidata.hh:108
void * ptr()
Definition mpidata.hh:113
int size()
Definition mpidata.hh:116
T & data_
Definition mpidata.hh:131
auto resize(int size) -> std::enable_if_t<!std::is_const< S >::value||!Std::is_detected_v< hasResizeOp, S > >
Definition mpidata.hh:124
MPI_Datatype type() const
Definition mpidata.hh:119