GEOSX
Classes | Typedefs | Functions | Variables
LvArray::typeManipulation Namespace Reference

Contains templates for manipulating types. More...

Classes

struct  CArray
 A wrapper around a compile time c array. More...
 

Typedefs

template<bool ... BOOLS>
using all_of = camp::concepts::metalib::all_of< BOOLS ... >
 A struct that contains a static constexpr bool value that is true if all of BOOLS are true. More...
 
template<typename ... TYPES>
using all_of_t = camp::concepts::metalib::all_of_t< TYPES ... >
 A struct that contains a static constexpr bool value that is true if all of TYPES::value are true. More...
 
template<typename T >
using ViewType = typename internal::GetViewType< T >::type
 An alias for the view type of T. More...
 
template<typename T >
using ViewTypeConstSizes = typename internal::GetViewTypeConstSizes< T >::type
 An alias for the un-resizable view type of T. More...
 
template<typename T >
using ViewTypeConst = typename internal::GetViewTypeConst< T >::type
 An alias for the const view type of T. More...
 
template<typename T >
using NestedViewType = typename internal::GetNestedViewType< T >::type
 An alias for the nested view type of T. More...
 
template<typename T >
using NestedViewTypeConst = typename internal::GetNestedViewTypeConst< T >::type
 An alias for the nested const view type of T. More...
 

Functions

template<typename F >
constexpr void forEachArg (F &&f)
 The recursive base case where no argument is provided. More...
 
template<typename F , typename ARG , typename ... ARGS>
constexpr void forEachArg (F &&f, ARG &&arg, ARGS &&... args)
 Call the f with arg and then again with each argument in args . More...
 
 HAS_MEMBER_FUNCTION_NO_RTYPE (toView,)
 Defines a template static constexpr bool HasMemberFunction_toView that is true if CLASS has a method toView(). More...
 
 HAS_MEMBER_FUNCTION_NO_RTYPE (toViewConstSizes,)
 Defines a template static constexpr bool HasMemberFunction_toViewConstSizes that is true if CLASS has a method toView(). More...
 
 HAS_MEMBER_FUNCTION_NO_RTYPE (toViewConst,)
 Defines a template static constexpr bool HasMemberFunction_toViewConst that is true if CLASS has a method toViewConst(). More...
 
 HAS_MEMBER_FUNCTION_NO_RTYPE (toNestedView,)
 Defines a template static constexpr bool HasMemberFunction_toNestedView that is true if CLASS has a method toNestedView(). More...
 
 HAS_MEMBER_FUNCTION_NO_RTYPE (toNestedViewConst,)
 Defines a template static constexpr bool HasMemberFunction_toNestedViewConst that is true if CLASS has a method toNestedViewConst(). More...
 
template<camp::idx_t... INDICES>
constexpr camp::idx_t getStrideOneDimension (camp::idx_seq< INDICES... >)
 
template<typename PERMUTATION >
constexpr bool isValidPermutation (PERMUTATION)
 
template<typename T , typename U , typename INDEX_TYPE >
constexpr std::enable_if_t<(sizeof(T)<=sizeof(U)), INDEX_TYPE > convertSize (INDEX_TYPE const numU)
 Convert a number of values of type U to a number of values of type T. More...
 
template<typename T , typename U , typename INDEX_TYPE >
std::enable_if_t<(sizeof(T) > sizeof(U)), INDEX_TYPE > convertSize (INDEX_TYPE const numU)
 Convert a number of values of type U to a number of values of type T. More...
 
template<camp::idx_t... INDICES>
constexpr CArray< camp::idx_t, sizeof...(INDICES) > asArray (camp::idx_seq< INDICES... >)
 

Variables

template<template< typename ... > class TEMPLATE, typename TYPE >
constexpr bool is_instantiation_of = false
 Trait to detect if. More...
 
template<template< typename ... > class TEMPLATE, typename ... ARGS>
constexpr bool is_instantiation_of< TEMPLATE, TEMPLATE< ARGS... > > = true
 Trait to detect if. More...
 
template<typename T >
static constexpr camp::idx_t getDimension = internal::getDimension( T {} )
 

Detailed Description

Contains templates for manipulating types.

Typedef Documentation

◆ all_of

template<bool ... BOOLS>
using LvArray::typeManipulation::all_of = typedef camp::concepts::metalib::all_of< BOOLS ... >

A struct that contains a static constexpr bool value that is true if all of BOOLS are true.

Template Parameters
BOOLSA variadic pack of bool.
Note
Not a static constexpr bool so it can be used on device.

Definition at line 156 of file typeManipulation.hpp.

◆ all_of_t

template<typename ... TYPES>
using LvArray::typeManipulation::all_of_t = typedef camp::concepts::metalib::all_of_t< TYPES ... >

A struct that contains a static constexpr bool value that is true if all of TYPES::value are true.

Template Parameters
TYPESA variadic pack of types all of which define a static constexpr bool value.
Note
Not a static constexpr bool so it can be used on device.

Definition at line 164 of file typeManipulation.hpp.

◆ NestedViewType

template<typename T >
using LvArray::typeManipulation::NestedViewType = typedef typename internal::GetNestedViewType< T >::type

An alias for the nested view type of T.

Template Parameters
TThe type to get the nested view type of.

Definition at line 381 of file typeManipulation.hpp.

◆ NestedViewTypeConst

template<typename T >
using LvArray::typeManipulation::NestedViewTypeConst = typedef typename internal::GetNestedViewTypeConst< T >::type

An alias for the nested const view type of T.

Template Parameters
TThe type to get the nested const view type of.

Definition at line 388 of file typeManipulation.hpp.

◆ ViewType

template<typename T >
using LvArray::typeManipulation::ViewType = typedef typename internal::GetViewType< T >::type

An alias for the view type of T.

Template Parameters
TThe type to get the view type of.

Definition at line 360 of file typeManipulation.hpp.

◆ ViewTypeConst

template<typename T >
using LvArray::typeManipulation::ViewTypeConst = typedef typename internal::GetViewTypeConst< T >::type

An alias for the const view type of T.

Template Parameters
TThe type to get the view type of.

Definition at line 374 of file typeManipulation.hpp.

◆ ViewTypeConstSizes

template<typename T >
using LvArray::typeManipulation::ViewTypeConstSizes = typedef typename internal::GetViewTypeConstSizes< T >::type

An alias for the un-resizable view type of T.

Template Parameters
TThe type to get the view type of.

Definition at line 367 of file typeManipulation.hpp.

Function Documentation

◆ asArray()

template<camp::idx_t... INDICES>
constexpr CArray< camp::idx_t, sizeof...( INDICES ) > LvArray::typeManipulation::asArray ( camp::idx_seq< INDICES... >  )
inline
Template Parameters
INDICESA variadic pack of numbers.
Returns
A CArray containing
Template Parameters
INDICES.

Definition at line 549 of file typeManipulation.hpp.

◆ convertSize() [1/2]

template<typename T , typename U , typename INDEX_TYPE >
constexpr std::enable_if_t< ( sizeof( T ) <= sizeof( U ) ), INDEX_TYPE > LvArray::typeManipulation::convertSize ( INDEX_TYPE const  numU)
inline

Convert a number of values of type U to a number of values of type T.

Template Parameters
TThe type to convert to.
UThe type to convert from.
INDEX_TYPEThe type of numU.
Parameters
numUThe number of U to convert to number of T.
Returns
numU converted to a number of types T.

This is a specialization for when

sizeof( T ) <= sizeof( U )

.

Definition at line 476 of file typeManipulation.hpp.

◆ convertSize() [2/2]

template<typename T , typename U , typename INDEX_TYPE >
std::enable_if_t< ( sizeof( T ) > sizeof( U ) ), INDEX_TYPE > LvArray::typeManipulation::convertSize ( INDEX_TYPE const  numU)
inline

Convert a number of values of type U to a number of values of type T.

Template Parameters
TThe type to convert to.
UThe type to convert from.
INDEX_TYPEThe type of numU.
Parameters
numUThe number of U to convert to number of T.
Returns
numU converted to a number of types T.

This is a specialization for when

sizeof( T ) > sizeof( U )

.

Definition at line 495 of file typeManipulation.hpp.

◆ forEachArg() [1/2]

template<typename F >
constexpr void LvArray::typeManipulation::forEachArg ( F &&  f)
inline

The recursive base case where no argument is provided.

Template Parameters
FThe type of the function to call.
Parameters
fThe function to not call.

Definition at line 129 of file typeManipulation.hpp.

◆ forEachArg() [2/2]

template<typename F , typename ARG , typename ... ARGS>
constexpr void LvArray::typeManipulation::forEachArg ( F &&  f,
ARG &&  arg,
ARGS &&...  args 
)
inline

Call the f with arg and then again with each argument in args .

Template Parameters
FThe type of the function to call.
ARGThe type of the first argument to pass to the function.
ARGSThe types of the remaining arguments.
Parameters
fThe function to call.
argThe first argument to call the function with.
argsThe rest of the arguments to call the function with.

Definition at line 144 of file typeManipulation.hpp.

◆ getStrideOneDimension()

template<camp::idx_t... INDICES>
constexpr camp::idx_t LvArray::typeManipulation::getStrideOneDimension ( camp::idx_seq< INDICES... >  )
Template Parameters
INDICESA variadic list of indices.
Returns
The unit stride dimension, the last index in the sequence.

Definition at line 445 of file typeManipulation.hpp.

◆ HAS_MEMBER_FUNCTION_NO_RTYPE() [1/5]

LvArray::typeManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE ( toView  )

Defines a template static constexpr bool HasMemberFunction_toView that is true if CLASS has a method toView().

Template Parameters
CLASSThe type to test.

◆ HAS_MEMBER_FUNCTION_NO_RTYPE() [2/5]

LvArray::typeManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE ( toViewConstSizes  )

Defines a template static constexpr bool HasMemberFunction_toViewConstSizes that is true if CLASS has a method toView().

Template Parameters
CLASSThe type to test.

◆ HAS_MEMBER_FUNCTION_NO_RTYPE() [3/5]

LvArray::typeManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE ( toViewConst  )

Defines a template static constexpr bool HasMemberFunction_toViewConst that is true if CLASS has a method toViewConst().

Template Parameters
CLASSThe type to test.

◆ HAS_MEMBER_FUNCTION_NO_RTYPE() [4/5]

LvArray::typeManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE ( toNestedView  )

Defines a template static constexpr bool HasMemberFunction_toNestedView that is true if CLASS has a method toNestedView().

Template Parameters
CLASSThe type to test.

◆ HAS_MEMBER_FUNCTION_NO_RTYPE() [5/5]

LvArray::typeManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE ( toNestedViewConst  )

Defines a template static constexpr bool HasMemberFunction_toNestedViewConst that is true if CLASS has a method toNestedViewConst().

Template Parameters
CLASSThe type to test.

◆ isValidPermutation()

template<typename PERMUTATION >
constexpr bool LvArray::typeManipulation::isValidPermutation ( PERMUTATION  )
Template Parameters
PERMUTATIONA camp::idx_seq.
Returns
True iff
Template Parameters
PERMUTATIONis a permutation of [0, N] for some N.

Definition at line 458 of file typeManipulation.hpp.

Variable Documentation

◆ getDimension

template<typename T >
constexpr camp::idx_t LvArray::typeManipulation::getDimension = internal::getDimension( T {} )
static
Template Parameters
TThe type for which the number of indices is requested.
Returns
the number of indices for type T

Definition at line 438 of file typeManipulation.hpp.

◆ is_instantiation_of

template<template< typename ... > class TEMPLATE, typename TYPE >
constexpr bool LvArray::typeManipulation::is_instantiation_of = false

Trait to detect if.

Template Parameters
TEMPLATEThe template to check if TYPE is an instantiation of.
TYPEThe type to check.
TYPEis an instantiation of
Tempate.

Usage:

is_instantiaton_of< std::vector, std::vector< int > >

.

Definition at line 174 of file typeManipulation.hpp.

◆ is_instantiation_of< TEMPLATE, TEMPLATE< ARGS... > >

template<template< typename ... > class TEMPLATE, typename ... ARGS>
constexpr bool LvArray::typeManipulation::is_instantiation_of< TEMPLATE, TEMPLATE< ARGS... > > = true

Trait to detect if.

Template Parameters
TEMPLATEThe template to check.
ARGSThe variadic pack of argument types used to instantiate TEMPLATE.
TYPEis an instantiation of
Tempate.

Usage:

is_instantiaton_of< std::vector, std::vector< int > >

.

Note
Specialization for the true case.

Definition at line 185 of file typeManipulation.hpp.