KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
Loading...
Searching...
No Matches
kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param > Class Template Reference

Empty buffer that can be used as default argument for optional buffer parameters. More...

#include <data_buffer.hpp>

Public Types

using value_type = Data
 Value type of the buffer.
 

Public Member Functions

size_t size () const
 Get the number of elements in the underlying storage.
 
value_type constdata () const
 Get a nullptr.
 
Span< value_typeget () const
 Returns a span containing a nullptr.
 
template<typename SizeFunc >
void resize_if_requested (SizeFunc &&compute_required_size)
 Resizes the underlying container if the buffer the buffer's resize policy allows and resizing is necessary. Does nothing for an empty buffer.
 

Static Public Attributes

static constexpr ParameterType parameter_type = type
 The type of parameter this buffer represents.
 
static constexpr bool is_modifiable
 This pseudo buffer is not modifiable since it represents no actual buffer.
 
static constexpr BufferType buffer_type
 The type of the buffer, usually ignore for this special buffer.
 
static constexpr BufferResizePolicy resize_policy = no_resize
 An empty buffer can not be resized.
 
static constexpr bool is_out_buffer = false
 An empty buffer is never output.
 
static constexpr bool is_lib_allocated = false
 An empty buffer is not allocated.
 
static constexpr bool is_single_element = false
 An empty buffer contains no elements.
 
static constexpr bool is_owning = false
 An empty buffer does not own anything.
 

Detailed Description

template<typename Data, ParameterType type, BufferType buffer_type_param>
class kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >

Empty buffer that can be used as default argument for optional buffer parameters.

Template Parameters
ParameterTypeParameter type represented by this pseudo buffer.

Member Function Documentation

◆ data()

template<typename Data , ParameterType type, BufferType buffer_type_param>
value_type const * kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::data ( ) const
inline

Get a nullptr.

Returns
nullptr.

◆ get()

template<typename Data , ParameterType type, BufferType buffer_type_param>
Span< value_type > kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::get ( ) const
inline

Returns a span containing a nullptr.

Returns
Span containing a nullptr.

◆ resize_if_requested()

template<typename Data , ParameterType type, BufferType buffer_type_param>
template<typename SizeFunc >
void kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::resize_if_requested ( SizeFunc && compute_required_size)
inline

Resizes the underlying container if the buffer the buffer's resize policy allows and resizing is necessary. Does nothing for an empty buffer.

Template Parameters
SizeFuncType of the functor which computes the required buffer size.
Parameters
compute_required_sizeFunctor which is used to compute the required buffer size. compute_required_size() is not called if the buffer's resize policy is BufferResizePolicy::no_resize.

◆ size()

template<typename Data , ParameterType type, BufferType buffer_type_param>
size_t kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::size ( ) const
inline

Get the number of elements in the underlying storage.

Returns
Number of elements in the underlying storage (always 0).

Member Data Documentation

◆ buffer_type

template<typename Data , ParameterType type, BufferType buffer_type_param>
constexpr BufferType kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::buffer_type
staticconstexpr
Initial value:
=
buffer_type_param

The type of the buffer, usually ignore for this special buffer.

◆ is_modifiable

template<typename Data , ParameterType type, BufferType buffer_type_param>
constexpr bool kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >::is_modifiable
staticconstexpr
Initial value:
=
false

This pseudo buffer is not modifiable since it represents no actual buffer.


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