TIMPI
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
libMesh::Parallel::PackingMixedType< BufferType > Struct Template Reference

#include <packing.h>

Classes

struct  BufferTypesPer
 
struct  IsFixed
 

Public Types

typedef BufferType buffer_type
 

Static Public Member Functions

template<typename T3 , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static unsigned int packable_size_comp (const T3 &, const Context *)
 
template<typename T1 , typename T2 , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static unsigned int packable_size_comp (const std::pair< T1, T2 > &comp, const Context *ctx)
 
template<typename T3 , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static unsigned int packable_size_comp (const T3 &comp, const Context *ctx)
 
template<typename T3 , typename OutputIter , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static void pack_comp (const T3 &comp, OutputIter data_out, const Context *)
 
template<typename T1 , typename T2 , typename OutputIter , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static void pack_comp (const std::pair< T1, T2 > &comp, OutputIter data_out, const Context *ctx)
 
template<typename T3 , typename OutputIter , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static void pack_comp (const T3 &comp, OutputIter data_out, const Context *ctx)
 
template<typename T3 , typename BufferIter , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static void unpack_comp (T3 &comp, BufferIter in, Context *)
 
template<typename T1 , typename T2 , typename BufferIter , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static void unpack_comp (std::pair< T1, T2 > &comp, BufferIter in, Context *ctx)
 
template<typename T3 , typename BufferIter , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static void unpack_comp (T3 &comp, BufferIter in, Context *ctx)
 

Detailed Description

template<typename BufferType>
struct libMesh::Parallel::PackingMixedType< BufferType >

Definition at line 211 of file packing.h.

Member Typedef Documentation

◆ buffer_type

template<typename BufferType >
typedef BufferType libMesh::Parallel::PackingMixedType< BufferType >::buffer_type

Definition at line 213 of file packing.h.

Member Function Documentation

◆ pack_comp() [1/3]

template<typename BufferType >
template<typename T1 , typename T2 , typename OutputIter , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::pack_comp ( const std::pair< T1, T2 > &  comp,
OutputIter  data_out,
const Context *  ctx 
)
inlinestatic

Definition at line 285 of file packing.h.

286 {
287 pack_comp(comp.first, data_out, ctx);
288 pack_comp(comp.second, data_out, ctx);
289 }
static void pack_comp(const T3 &comp, OutputIter data_out, const Context *)
Definition packing.h:268

References libMesh::Parallel::PackingMixedType< BufferType >::pack_comp().

◆ pack_comp() [2/3]

template<typename BufferType >
template<typename T3 , typename OutputIter , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::pack_comp ( const T3 &  comp,
OutputIter  data_out,
const Context *   
)
inlinestatic

Definition at line 268 of file packing.h.

269 {
270 buffer_type T3_as_buffer_types[BufferTypesPer<T3>::value];
271 std::memcpy(T3_as_buffer_types, &comp, sizeof(T3));
272 for (unsigned int i = 0; i != BufferTypesPer<T3>::value; ++i)
273 *data_out++ = T3_as_buffer_types[i];
274 }

Referenced by libMesh::Parallel::PackingMixedType< BufferType >::pack_comp().

◆ pack_comp() [3/3]

template<typename BufferType >
template<typename T3 , typename OutputIter , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::pack_comp ( const T3 &  comp,
OutputIter  data_out,
const Context *  ctx 
)
inlinestatic

Definition at line 295 of file packing.h.

296 {
297 Packing<T3>::pack(comp, data_out, ctx);
298 }
static void pack(const T &object, OutputIter data_out, const Context *context)

References libMesh::Parallel::Packing< T, Enable >::pack().

◆ packable_size_comp() [1/3]

template<typename BufferType >
template<typename T1 , typename T2 , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static unsigned int libMesh::Parallel::PackingMixedType< BufferType >::packable_size_comp ( const std::pair< T1, T2 > &  comp,
const Context *  ctx 
)
inlinestatic

Definition at line 241 of file packing.h.

242 {
243 return packable_size_comp(comp.first, ctx) +
244 packable_size_comp(comp.second, ctx);
245 }
static unsigned int packable_size_comp(const T3 &, const Context *)
Definition packing.h:232

References libMesh::Parallel::PackingMixedType< BufferType >::packable_size_comp().

◆ packable_size_comp() [2/3]

template<typename BufferType >
template<typename T3 , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static unsigned int libMesh::Parallel::PackingMixedType< BufferType >::packable_size_comp ( const T3 &  ,
const Context *   
)
inlinestatic

◆ packable_size_comp() [3/3]

template<typename BufferType >
template<typename T3 , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static unsigned int libMesh::Parallel::PackingMixedType< BufferType >::packable_size_comp ( const T3 &  comp,
const Context *  ctx 
)
inlinestatic

Definition at line 250 of file packing.h.

251 {
252 return Packing<T3>::packable_size(comp, ctx);
253 }
static unsigned int packable_size(const T &object, const Context *context)

References libMesh::Parallel::Packing< T, Enable >::packable_size().

◆ unpack_comp() [1/3]

template<typename BufferType >
template<typename T1 , typename T2 , typename BufferIter , typename Context , typename std::enable_if< IsFixed< std::pair< T1, T2 > >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::unpack_comp ( std::pair< T1, T2 > &  comp,
BufferIter  in,
Context *  ctx 
)
inlinestatic

Definition at line 334 of file packing.h.

335 {
336 unpack_comp(comp.first, in, ctx);
337
338 in += packable_size_comp(comp.first, ctx);
339
340 unpack_comp(comp.second, in, ctx);
341 }
static void unpack_comp(T3 &comp, BufferIter in, Context *)
Definition packing.h:309

References libMesh::Parallel::PackingMixedType< BufferType >::packable_size_comp(), and libMesh::Parallel::PackingMixedType< BufferType >::unpack_comp().

◆ unpack_comp() [2/3]

template<typename BufferType >
template<typename T3 , typename BufferIter , typename Context , typename std::enable_if< IsFixed< T3 >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::unpack_comp ( T3 &  comp,
BufferIter  in,
Context *   
)
inlinestatic

Definition at line 309 of file packing.h.

310 {
311 // memcpy is only safe to use with classes that are trivial to
312 // copy construct
313 //
314 // In this function overload, the enable_if<IsFixed> has already
315 // determined that we're safe in that respect.
316 //
317 // But the C++ standards don't mandate that important types like
318 // std::tuple ever satisfy is_trivially_copyable, and gcc goes so
319 // far as to emit warnings based on is_trivial instead, so we need
320 // to work around that here.
321 // https://gcc.gnu.org/legacy-ml/gcc-patches/2017-07/msg00299.html
322 char * comp_bytes = reinterpret_cast<char *>(&comp);
323 std::memcpy(comp_bytes, &(*in), sizeof(T3));
324 }

Referenced by libMesh::Parallel::PackingMixedType< BufferType >::unpack_comp().

◆ unpack_comp() [3/3]

template<typename BufferType >
template<typename T3 , typename BufferIter , typename Context , typename std::enable_if<!IsFixed< T3 >::value, int >::type = 0>
static void libMesh::Parallel::PackingMixedType< BufferType >::unpack_comp ( T3 &  comp,
BufferIter  in,
Context *  ctx 
)
inlinestatic

Definition at line 348 of file packing.h.

349 {
350 comp = Packing<T3>::unpack(in, ctx);
351 }
static T unpack(BufferIter in, Context *ctx)

References libMesh::Parallel::Packing< T, Enable >::unpack().


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