Loading...
Searching...
No Matches
thread_util.hpp File Reference

utility functions More...

Detailed Description

utility functions

Author
Dominik Charousset <dominik.charousset (at) haw-hamburg.de>
Raphael Hiesgen <raphael.hiesgen (at) haw-hamburg.de>

Definition in file thread_util.hpp.

#include <tuple>
#include <utility>
+ Include dependency graph for thread_util.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  riot::detail::int_list< Is >
 A list of integers (wraps a long... template parameter pack). More...
 
struct  riot::detail::il_indices< Pos, Pos, int_list< Is... > >
 End of recursion, Pos reached Max. More...
 
struct  riot::detail::il_indices< Max, Pos, int_list< Is... > >
 Recursion step. More...
 

Namespaces

namespace  riot
 RIOT C++ namespace.
 

Functions

template<long To, long From = 0>
il_indices< To, From >::type riot::detail::get_indices ()
 Function to create a list of indices from From to To.
 
template<class F , long... Is, class Tuple >
auto riot::detail::apply_args (F &f, detail::int_list< Is... >, Tuple &&tup) -> decltype(f(std::get< Is >(tup)...))
 Apply arguments in a tuple to function.
 
template<class F , class Tuple , class... Ts>
auto riot::detail::apply_args_prefixed (F &f, detail::int_list<>, Tuple &, Ts &&... args) -> decltype(f(std::forward< Ts >(args)...))
 Prefix the argument tuple with additional arguments.
 
template<class F , long... Is, class Tuple , class... Ts>
auto riot::detail::apply_args_prefixed (F &f, detail::int_list< Is... >, Tuple &tup, Ts &&... args) -> decltype(f(std::forward< Ts >(args)..., std::get< Is >(tup)...))
 Prefix the argument tuple with additional arguments.
 
template<class F , long... Is, class Tuple , class... Ts>
auto riot::detail::apply_args_suffxied (F &f, detail::int_list< Is... >, Tuple &tup, Ts &&... args) -> decltype(f(std::get< Is >(tup)..., std::forward< Ts >(args)...))
 Suffix the tuple with additional arguments.
 

Function Documentation

◆ apply_args()

template<class F , long... Is, class Tuple >
auto riot::detail::apply_args ( F &  f,
detail::int_list< Is... >  ,
Tuple &&  tup 
) -> decltype(f(std::get<Is>(tup)...))
inline

Apply arguments in a tuple to function.

Definition at line 77 of file thread_util.hpp.

◆ apply_args_prefixed() [1/2]

template<class F , long... Is, class Tuple , class... Ts>
auto riot::detail::apply_args_prefixed ( F &  f,
detail::int_list< Is... >  ,
Tuple &  tup,
Ts &&...  args 
) -> decltype(f(std::forward<Ts>(args)..., std::get<Is>(tup)...))
inline

Prefix the argument tuple with additional arguments.

In this case the tuple is contains arguments.

Definition at line 97 of file thread_util.hpp.

◆ apply_args_prefixed() [2/2]

template<class F , class Tuple , class... Ts>
auto riot::detail::apply_args_prefixed ( F &  f,
detail::int_list<>  ,
Tuple &  ,
Ts &&...  args 
) -> decltype(f(std::forward<Ts>(args)...))
inline

Prefix the argument tuple with additional arguments.

In this case the tuple is empty.

Definition at line 87 of file thread_util.hpp.

◆ apply_args_suffxied()

template<class F , long... Is, class Tuple , class... Ts>
auto riot::detail::apply_args_suffxied ( F &  f,
detail::int_list< Is... >  ,
Tuple &  tup,
Ts &&...  args 
) -> decltype(f(std::get<Is>(tup)..., std::forward<Ts>(args)...))
inline

Suffix the tuple with additional arguments.

Definition at line 107 of file thread_util.hpp.

◆ get_indices()

template<long To, long From = 0>
il_indices< To, From >::type riot::detail::get_indices ( )

Function to create a list of indices from From to To.

Definition at line 69 of file thread_util.hpp.