KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
named_parameter_selection.hpp File Reference

Template magic to implement named parameters in cpp. More...

#include <cstddef>
#include <limits>
#include <tuple>
#include "kamping/named_parameter_types.hpp"
Include dependency graph for named_parameter_selection.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kamping::internal::ParameterTypeUnwrapping< Arg >
 Trait struct used to determine the underlying type and value of the parameter type of an object with a parameter type. (This is a building block to enable plugins to have their own named parameters). More...
 
struct  kamping::internal::ParameterTypeUnwrapping< std::integral_constant< T, v > >
 Trait struct used to determine the underlying type and value of the parameter type of an std::integral_constant wrapping a parameter type. (This is a building block to enable plugins to have their own named parameters). More...
 
struct  kamping::internal::has_parameter_helper< typename >
 Helper struct needed to retrieve the types stored in a std::tuple for the has_parameter_type check. More...
 

Namespaces

namespace  kamping::internal
 Internal namespace marking the code that is not user-facing.
 

Typedefs

template<typename Arg >
using kamping::internal::parameter_type_t = typename ParameterTypeUnwrapping<Arg>::type
 Trait for the underlying type of the parameter type of.
 
template<ParameterType parameter_type, typename... Args>
using kamping::internal::buffer_type_with_requested_parameter_type
 Type of Buffer with requested.
 

Functions

template<typename T , typename U >
constexpr bool kamping::internal::has_same_parameter_type ()
 Check whether two objects have the same parameter type.
 
template<typename ParameterTypeConstant , size_t Index>
constexpr size_t kamping::internal::find_pos ()
 Base case if there are no parameters: always returns max index indicating that the parameter was not found.
 
template<typename ParameterTypeConstant , size_t Index, typename Arg >
constexpr size_t kamping::internal::find_pos ()
 Returns the Index parameter if the parameter type of Arg matches the requested parameter type. If not, this fails to compile.
 
template<typename ParameterTypeConstant , size_t Index, typename Arg , typename Arg2 , typename... Args>
constexpr size_t kamping::internal::find_pos ()
 Returns position of first argument in Args with Trait trait.
 
template<typename ParameterTypeConstant , typename... Args>
autokamping::internal::select_parameter_type (Args &... args)
 Returns parameter with requested parameter type.
 
template<ParameterType parameter_type, typename... Args>
autokamping::internal::select_parameter_type_in_tuple (std::tuple< Args... > &tuple)
 Returns parameter with requested parameter type.
 
template<ParameterType parameter_type, typename... Args>
auto constkamping::internal::select_parameter_type_in_tuple (std::tuple< Args... > const &tuple)
 Returns parameter with requested parameter type.
 
template<typename ParameterTypeConstant , typename... Args>
constexpr bool kamping::internal::has_parameter_type ()
 Checks if parameter with requested parameter type exists.
 
template<ParameterType parameter_type, typename... Args>
constexpr bool kamping::internal::has_parameter_type_in_tuple_impl (has_parameter_helper< std::tuple< Args... > >)
 Checks if parameter with requested parameter type exists. Wrapper using the functionality from kamping::internal::has_parameter_type() disassembling a std::tuple passed as parameter.
 
template<ParameterType parameter_type, typename Tuple >
constexpr bool kamping::internal::has_parameter_type_in_tuple ()
 Checks if parameter with requested parameter type exists.
 
template<typename ParameterTypeConstant , typename DefaultParameterType , typename... DefaultArguments, typename... Args>
decltype(autokamping::internal::select_parameter_type_or_default (std::tuple< DefaultArguments... > default_arguments, Args &... args)
 Checks if parameter with requested parameter type exists, if not constructs a default value.
 

Variables

template<typename Arg >
constexpr parameter_type_t< Argkamping::internal::parameter_type_v = ParameterTypeUnwrapping<Arg>::value
 Trait for the underlying value of the parameter type of.
 

Detailed Description

Template magic to implement named parameters in cpp.