KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param > Class Template Reference

A more generic version of a DataBuffer which stores an object of type. More...

#include <data_buffer.hpp>

Inheritance diagram for kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >:
Collaboration diagram for kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >:

Public Types

using value_type = MemberType
 Value type of the buffer.
 
using MemberTypeWithConst
 
using MemberTypeWithConstAndRef
 

Public Member Functions

template<bool enabled = ownership == BufferOwnership::referencing, std::enable_if_t< enabled, bool > = true>
 GenericDataBuffer (MemberTypeWithConst &container)
 Constructor for referencing GenericDataBuffer.
 
template<bool enabled = ownership == BufferOwnership::owning, std::enable_if_t< enabled, bool > = true>
 GenericDataBuffer (MemberType container)
 Constructor for owning GenericDataBuffer.
 
MemberType constunderlying () const
 Provides access to the underlying data.
 
template<bool enabled = modifiability == BufferModifiability::modifiable, std::enable_if_t< enabled, bool > = true>
MemberTypeunderlying ()
 Provides access to the underlying data.
 
template<bool enabled = is_owning, std::enable_if_t< enabled, bool > = true>
MemberTypeWithConst extract ()
 Extract the underlying container. This will leave the DataBuffer in an unspecified state.
 

Static Public Attributes

static constexpr TParameterType parameter_type
 The type of parameter this buffer represents.
 
static constexpr BufferType buffer_type = buffer_type_param
 The type of the buffer, i.e., in, out, or in_out.
 
static constexpr bool is_out_buffer
 true if the buffer is an out or in/out buffer that results will be written to and false otherwise.
 
static constexpr bool is_owning
 Indicates whether the buffer owns its underlying storage.
 
static constexpr bool is_modifiable
 Indicates whether the underlying storage is modifiable.
 

Detailed Description

template<typename MemberType, typename TParameterType, TParameterType parameter_type_param, BufferModifiability modifiability, BufferOwnership ownership, BufferType buffer_type_param>
class kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >

A more generic version of a DataBuffer which stores an object of type.

Template Parameters
MemberTypewith its associcated
ParameterType.In difference to DataBuffer, GenericDataBuffer does not require the wrapped object to expose neither data(), resize() nor value_type.
MemberTypeType of the wrapped object.
TParameterTypeType of the parameter_type_param (required for parameter selection within plugins).
parameter_type_paramParameter type represented by this buffer.
modifiabilitymodifiable if a KaMPIng operation is allowed to modify the underlying container. constant otherwise.
ownershipowning if the buffer should hold the object. referencing if only a reference to an existing object should be held.
buffer_type_paramType of buffer, i.e., in_buffer, out_buffer, or in_out_buffer.

Member Typedef Documentation

◆ MemberTypeWithConst

Initial value:
std::conditional_t<is_modifiable, MemberType, MemberType const>

The ContainerType as const or non-const depending on modifiability.

◆ MemberTypeWithConstAndRef

Initial value:
std::conditional_t<
ownership == BufferOwnership::owning,
std::conditional_t< is_modifiable, MemberType, MemberType const > MemberTypeWithConst
Definition data_buffer.hpp:661

The ContainerType as const or non-const (see ContainerTypeWithConst) and reference or non-reference depending on ownership.

Constructor & Destructor Documentation

◆ GenericDataBuffer() [1/2]

template<typename MemberType , typename TParameterType , TParameterType parameter_type_param, BufferModifiability modifiability, BufferOwnership ownership, BufferType buffer_type_param>
template<bool enabled = ownership == BufferOwnership::referencing, std::enable_if_t< enabled, bool > = true>
kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >::GenericDataBuffer ( MemberTypeWithConst & container)
inline

Constructor for referencing GenericDataBuffer.

Parameters
containerContainer holding the actual data.

◆ GenericDataBuffer() [2/2]

template<typename MemberType , typename TParameterType , TParameterType parameter_type_param, BufferModifiability modifiability, BufferOwnership ownership, BufferType buffer_type_param>
template<bool enabled = ownership == BufferOwnership::owning, std::enable_if_t< enabled, bool > = true>
kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >::GenericDataBuffer ( MemberType container)
inline

Constructor for owning GenericDataBuffer.

Parameters
containerContainer holding the actual data.

Member Function Documentation

◆ extract()

template<typename MemberType , typename TParameterType , TParameterType parameter_type_param, BufferModifiability modifiability, BufferOwnership ownership, BufferType buffer_type_param>
template<bool enabled = is_owning, std::enable_if_t< enabled, bool > = true>
MemberTypeWithConst kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >::extract ( )
inline

Extract the underlying container. This will leave the DataBuffer in an unspecified state.

Returns
Moves the underlying container out of the DataBuffer.

◆ underlying() [1/2]

template<typename MemberType , typename TParameterType , TParameterType parameter_type_param, BufferModifiability modifiability, BufferOwnership ownership, BufferType buffer_type_param>
template<bool enabled = modifiability == BufferModifiability::modifiable, std::enable_if_t< enabled, bool > = true>
MemberType & kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >::underlying ( )
inline

Provides access to the underlying data.

Returns
A reference to the data.

◆ underlying() [2/2]

Provides access to the underlying data.

Returns
A reference to the data.

Member Data Documentation

◆ is_modifiable

Initial value:
=
modifiability == BufferModifiability::modifiable

Indicates whether the underlying storage is modifiable.

◆ is_out_buffer

Initial value:
=
(buffer_type_param == BufferType::out_buffer || buffer_type_param == BufferType::in_out_buffer)

true if the buffer is an out or in/out buffer that results will be written to and false otherwise.

◆ is_owning

Initial value:
=
ownership == BufferOwnership::owning

Indicates whether the buffer owns its underlying storage.

◆ parameter_type

Initial value:
=
parameter_type_param

The type of parameter this buffer represents.


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