OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
meta.h File Reference
#include <type_traits>
#include <typeindex>
#include <tuple>
#include <set>
#include <utility>
#include <string>
#include <cstdint>
+ Include dependency graph for meta.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  olb::ExprBase
 
struct  olb::SimdBase
 
struct  olb::meta::id< TYPE >
 Identity type to pass non-constructible types as value. More...
 
struct  olb::meta::list_item_with_base_default_base< BASE, HEAD, TAIL >
 Get first type based on BASE contained in a given type list. More...
 
struct  olb::meta::list_item_with_base_default_base< BASE, HEAD >
 
struct  olb::meta::first_type_with_base< BASE, HEAD, TAIL >
 Get first type based on BASE contained in a given type list. More...
 
struct  olb::meta::first_type_with_base< BASE, HEAD >
 
struct  olb::meta::index_of_first_matching< COND, HEAD, TAIL... >
 
struct  olb::meta::index_of_first_matching< COND >
 
struct  olb::meta::eq< TYPES >
 Evaluates to true iff T is in TYPES. More...
 
struct  olb::meta::neq< TYPES >
 Evaluates to true iff T is not in TYPES. More...
 
struct  olb::meta::filter< COND, HEAD, TAIL >
 Return type list of all FIELDS meeting COND. More...
 
struct  olb::meta::filter< COND, TYPE >
 Return either nil type list or type list containing (single) FIELD depending on COND. More...
 
struct  olb::meta::reverse< HEAD, TAIL >
 Return type list of all FIELDS in reversed order. More...
 
struct  olb::meta::reverse< TYPE >
 Return either nil type list or type list containing FIELD in reversed order. More...
 
struct  olb::meta::list_base
 Base of any meta::list. More...
 
struct  olb::meta::list< TYPES >
 Plain wrapper for list of types. More...
 
struct  olb::meta::derived_type_in_nested< BASE, HEAD, TAIL >
 

Namespaces

namespace  olb
 Top level namespace for all of OpenLB.
 
namespace  olb::meta
 

Typedefs

template<typename TYPE >
using olb::meta::id_t = typename id<TYPE>::type
 
template<auto VALUE, typename TYPE = decltype(VALUE)>
using olb::meta::value = typename std::integral_constant<TYPE, VALUE>::type
 Identity type to wrap non-type template arguments.
 
template<typename T >
using olb::meta::is_arithmetic
 Checks whether T can be used as a scalar arithmetic type.
 
template<typename T , typename U = void>
using olb::meta::enable_if_arithmetic_t = std::enable_if_t<is_arithmetic<T>::type::value, U>
 
template<typename BASE , typename... TYPES>
using olb::meta::first_type_with_base_t = typename first_type_with_base<BASE, TYPES...>::type
 
template<template< typename > class COND, typename... TYPES>
using olb::meta::filter_t = typename filter<COND,TYPES...>::type
 meta::list of TYPES meeting COND
 
template<typename... TYPES>
using olb::meta::reverse_t = typename reverse<TYPES...>::type
 meta::list of TYPES in reversed order
 

Functions

template<typename TYPE >
bool olb::meta::is_aligned (const void *ptr)
 Returns true iff address ptr is aligned w.r.t. TYPE.
 
template<typename T >
std::string olb::meta::name ()
 Returns distinct name on GCC, Clang and ICC but may return arbitrary garbage as per the standard.
 
template<typename WANTED , typename... TYPES>
constexpr bool olb::meta::contains ()
 Returns true iff a given type list contains WANTED.
 
template<typename... TYPES>
bool olb::meta::contains (std::type_index field)
 Returns true iff a given type list contains a type index.
 
template<typename TYPES , typename F , std::size_t... INDICES>
void olb::meta::list_for_each_index (F &&f, std::index_sequence< INDICES... >)
 Apply F to each element of meta::list listed in INDICES.
 
template<typename TUPLE , typename F , std::size_t... INDICES>
void olb::meta::tuple_for_each_index (TUPLE &tuple, F &&f, std::index_sequence< INDICES... >)
 Apply F to each element of TUPLE listed in INDICES.
 
template<typename TUPLE , typename F >
void olb::meta::tuple_for_each (TUPLE &tuple, F &&f)
 Apply F to each element of TUPLE.
 
template<typename T , unsigned D, typename U , std::size_t... INDICES>
std::array< T, D > olb::meta::make_array (U &&u, std::index_sequence< INDICES... >)
 Return std::array<T,D> where T is initialized with a common value (helper)
 
template<typename T , unsigned D, typename U >
std::array< T, D > olb::meta::make_array (U &&u)
 Return std::array<T,D> where T is initialized with a common value.
 
template<typename T , unsigned D, typename F , std::size_t... INDICES>
std::array< T, D > olb::meta::make_array_f (F &&f, std::index_sequence< INDICES... >)
 Return std::array<T,D> where T is initialized using a iDim-dependent function (helper)
 
template<typename T , unsigned D, typename F >
std::array< T, D > olb::meta::make_array_f (F &&f)
 Return std::array<T,D> where T is initialized using a iDim-dependent function.
 
template<auto... VALUE, typename COND >
constexpr bool olb::meta::indexed_pack_contains (COND cond)
 Returns true iff at least one VALUE satisfies COND.
 
template<std::size_t... Is, std::size_t... Js>
constexpr auto olb::meta::operator+ (std::index_sequence< Is... >, std::index_sequence< Js... >)
 Concatenate two index sequences.
 
template<std::size_t... Is>
constexpr auto olb::meta::array_from_index_sequence (std::index_sequence< Is... >)
 Convert index sequence into an array of its values.
 
template<typename PREDICATE , std::size_t... Is>
constexpr auto olb::meta::filter_index_sequence (PREDICATE predicate, std::index_sequence< Is... >)
 Return index sequence of Is matching PREDICATE depending on index.
 
template<typename TYPES , typename PREDICATE , std::size_t... Is>
constexpr auto olb::meta::filter_index_sequence (PREDICATE predicate, std::index_sequence< Is... >)
 Return index sequence of Is matching PREDICATE depending on type in TYPES.
 
template<typename TYPES , template< typename > class COND, std::size_t... Is>
constexpr auto olb::meta::filter_index_sequence (std::index_sequence< Is... >)
 Return index sequence of Is matching COND in TYPES.
 
template<typename TYPES , template< typename > class COND>
constexpr auto olb::meta::filter_index_sequence ()
 Return index sequence of Is matching COND using index_sequence of TYPES.
 
template<typename MAP , std::size_t... Is>
constexpr auto olb::meta::map_index_sequence (MAP map, std::index_sequence< Is... >)
 
template<std::size_t N, std::size_t I, std::size_t... Is>
constexpr auto olb::meta::take_n_sequence (std::index_sequence< I, Is... >)
 
template<std::size_t N, std::size_t I, std::size_t... Is>
constexpr auto olb::meta::drop_n_sequence (std::index_sequence< I, Is... >)
 
template<std::size_t N>
constexpr auto olb::meta::zero_sequence ()
 
template<std::size_t I, std::size_t O>
constexpr auto olb::meta::make_index_sequence_in_range ()
 
template<std::size_t... Is>
constexpr bool olb::meta::is_zero_sequence (std::index_sequence< Is... >)
 
template<typename F , std::size_t... INDICES>
void olb::meta::call_n_times (F &&f, std::index_sequence< INDICES... >)
 Call F for each index (exlicitly unrolled loop)
 
template<unsigned N, typename F >
void olb::meta::call_n_times (F &&f)
 Call F for each i in 0..N-1 (exlicitly unrolled loop)
 
template<typename TYPES , typename Fa , typename Fb , std::size_t Ia, std::size_t Iaa, std::size_t... Is>
void olb::meta::index_sequence_for_subsequence_L2 (Fa &&fa, Fb &&fb, std::index_sequence< Ia, Iaa, Is... > seq)
 Call fa for indices in index_sequence and call fb for indices in between indices in.
 
template<typename TYPES , typename Fa , typename Fb , std::size_t I, std::size_t... Is>
void olb::meta::index_sequence_for_subsequence_L1 (Fa &&fa, Fb &&fb, std::index_sequence< I, Is... > seq)
 Call fa for indices in index_sequence and call fb for indices in between indices in.
 
template<typename TYPES , typename Fa , typename Fb , std::size_t... Is>
void olb::meta::index_sequence_for_subsequence (Fa &&fa, Fb &&fb, std::index_sequence< Is... > seq)
 Call fa for indices in index_sequence and call fb for indices in between indices in.