VisionCpp  0.0.1
Classes | Typedefs | Functions
visioncpp::internal::tools::tuple Namespace Reference

Contains standard layout tuple implementation. More...

Classes

struct  EnableIf
 The EnableIf struct is used to statically define type based on the condition. More...
 
struct  EnableIf< true, T >
 Specialisation of the EnableIf when the condition is matched. More...
 
struct  Tuple
 The tuple is a fixed-size collection of heterogeneous values. More...
 
struct  Tuple< T, Ts... >
 Specialisation of the Tuple class when it has at least one element. More...
 
struct  ElemTypeHolder
 ElemTypeHolder class is used to specify the types of the elements inside the tuple. More...
 
struct  ElemTypeHolder< 0, Tuple< T, Ts... > >
 Specialisation of the ElemTypeHolder class when the number of the elements inside the tuple is 1. More...
 
struct  ElemTypeHolder< k, Tuple< T, Ts... > >
 Specialisation of the ElemTypeHolder class when the number of the elements inside the tuple is bigger than 1. More...
 
struct  Index_list
 Creates a list of indices created for the elements in the tuple. More...
 
struct  RangeBuilder
 Specialisation of the RangeBuilder class when N!=MIN. More...
 
struct  RangeBuilder< MIN, MIN, Is... >
 Specialisation of the RangeBuilder when the MIN==MAX. More...
 

Typedefs

template<size_t MIN, size_t MAX>
using Index_range = typename RangeBuilder< MIN, MAX >::type
 IndexRange that returns a index from range of [MIN, MAX). More...
 

Functions

template<size_t k, class... Ts>
EnableIf< k==0, typename ElemTypeHolder< 0, Tuple< Ts... > >::type & >::type get (Tuple< Ts... > &t)
 get More...
 
template<size_t k, class T , class... Ts>
EnableIf< k !=0, typename ElemTypeHolder< k, Tuple< T, Ts... > >::type & >::type get (Tuple< T, Ts... > &t)
 get More...
 
template<size_t k, class... Ts>
EnableIf< k==0, const typename ElemTypeHolder< 0, Tuple< Ts... > >::type & >::type get (const Tuple< Ts... > &t)
 get More...
 
template<size_t k, class T , class... Ts>
EnableIf< k !=0, const typename ElemTypeHolder< k, Tuple< T, Ts... > >::type & >::type get (const Tuple< T, Ts... > &t)
 get More...
 
template<typename... Args>
Tuple< Args... > make_tuple (Args... args)
 make_tuple More...
 
template<typename... Args>
static constexpr size_t size (Tuple< Args... > &)
 size More...
 
template<typename... Args, typename T , size_t... I>
Tuple< Args..., T > append_impl (internal::tools::tuple::Tuple< Args... > t, T a, internal::tools::tuple::Index_list< I... >)
 append_impl More...
 
template<typename... Args, typename T >
Tuple< Args..., T > append (Tuple< Args... > t, T a)
 append More...
 
template<typename... Args1, typename... Args2, size_t... I1, size_t... I2>
Tuple< Args1..., Args2... > append_impl (internal::tools::tuple::Tuple< Args1... > t1, internal::tools::tuple::Tuple< Args2... > t2, internal::tools::tuple::Index_list< I1... >, internal::tools::tuple::Index_list< I2... >)
 append_impl More...
 
template<typename... Args1, typename... Args2>
Tuple< Args1..., Args2... > append (internal::tools::tuple::Tuple< Args1... > t1, internal::tools::tuple::Tuple< Args2... > t2)
 append More...
 

Detailed Description

Contains standard layout tuple implementation.

Typedef Documentation

◆ Index_range

template<size_t MIN, size_t MAX>
using visioncpp::internal::tools::tuple::Index_range = typedef typename RangeBuilder<MIN, MAX>::type

IndexRange that returns a index from range of [MIN, MAX).

Template Parameters
MINis the starting index in the tuple.
MAXis the size of the tuple.

Definition at line 207 of file tuple.hpp.

Function Documentation

◆ append() [1/2]

template<typename... Args1, typename... Args2>
Tuple<Args1..., Args2...> visioncpp::internal::tools::tuple::append ( internal::tools::tuple::Tuple< Args1... >  t1,
internal::tools::tuple::Tuple< Args2... >  t2 
)

append

Deduction function of the append_impl for the append of the tuple t2 to the t1 tuple. The Index_range for both tuple is automatically generated.

Template Parameters
Args1...The type of the t1 tuple.
Args2...The type of the t2 tuple.
Parameters
t1Is the tuple on which we want to append the t2 tuple.
t2Is the tuple to be appended.
Returns
Tuple<Args1..., Args2...>

Definition at line 275 of file tuple.hpp.

References append_impl().

Here is the call graph for this function:

◆ append() [2/2]

template<typename... Args, typename T >
Tuple<Args..., T> visioncpp::internal::tools::tuple::append ( Tuple< Args... >  t,
a 
)

append

the deduction function for append_impl that automatically generates the Index_range.

Template Parameters
Args...the type of the elements inside the tuple t.
Tthe type of the new element that is going to be added at the end of the returned tuple.
Parameters
tthe tuple on which we want to append a.
athe new elements that are going to be added to the returned tuple.
Returns
Tuple<Args..., T>

Definition at line 235 of file tuple.hpp.

References append_impl().

Referenced by visioncpp::internal::CreatePyramidTuple< SatisfyingConds, Cols, Rows, LeafType, Depth, CurrentDepth, LHS >::create_tuple(), visioncpp::internal::Device_< backend::sycl, dv >::execute(), visioncpp::internal::LocalOutput< false, IsRoot, LC, LR, StnNoFilt< OP, Halo_T, Halo_L, Halo_B, Halo_R, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::LocalOutput< false, IsRoot, LC, LR, RUnOP< OP, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::LocalOutput< false, IsRoot, LC, LR, RDCN< OP, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::LocalOutput< false, IsRoot, LC, LR, StnFilt< OP, Halo_T, Halo_L, Halo_B, Halo_R, LHSExpr, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::LocalOutput< false, IsRoot, LC, LR, RBiOP< OP, LHSExpr, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::ExtractAccessor< expr_category::Binary, Assign< LHSExpr, RHSExpr, Cols, Rows, LeafType, LVL > >::getTuple(), visioncpp::internal::ExtractAccessor< expr_category::Binary, Expr >::getTuple(), and visioncpp::internal::ExtractAccessor< expr_category::Binary, ParallelCopy< LHSExpr, RHSExpr, Cols, Rows, OffsetColIn, OffsetRowIn, OffsetColOut, OffsetRowOut, LeafType, LVL > >::getTuple().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append_impl() [1/2]

template<typename... Args, typename T , size_t... I>
Tuple<Args..., T> visioncpp::internal::tools::tuple::append_impl ( internal::tools::tuple::Tuple< Args... >  t,
a,
internal::tools::tuple::Index_list< I... >   
)

append_impl

Unpacks the elements of the input tuple t and creates a new tuple by adding the element a at the end of it.

Template Parameters
Args...the type of the elements inside the tuple t.
Tthe type of the new element that is going to be added at the end of the returned tuple.
I...is the list of indices from [0 to sizeof...(t)) range.
Parameters
tthe tuple on which we want to append a.
athe new elements that are going to be added to the returned tuple.
Returns
Tuple<Args..., T>

Definition at line 220 of file tuple.hpp.

References make_tuple().

Referenced by append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append_impl() [2/2]

template<typename... Args1, typename... Args2, size_t... I1, size_t... I2>
Tuple<Args1..., Args2...> visioncpp::internal::tools::tuple::append_impl ( internal::tools::tuple::Tuple< Args1... >  t1,
internal::tools::tuple::Tuple< Args2... >  t2,
internal::tools::tuple::Index_list< I1... >  ,
internal::tools::tuple::Index_list< I2... >   
)

append_impl

This is a specialisation of the append_impl for the concatenation of the t2 tupe at the end of the t1 tuple. Both tuples are unpacked. Index_range is generated for each of them and output tuple T is created. The return tuple contains both elements of t1 and t2 tuples.

Template Parameters
Args1...The type of the t1 tuple.
Args2...The type of the t2 tuple.
I1...The list of the indices from [0 to sizeof...(t1)) range.
I2...The list of the indices from [0 to sizeof...(t2)) range.
Parameters
t1Is the tuple on which we want to append the t2 tuple.
t2Is the tuple to be appended.
Returns
Tuple<Args1..., Args2...>

Definition at line 254 of file tuple.hpp.

References make_tuple().

Here is the call graph for this function:

◆ get() [1/4]

template<size_t k, class T , class... Ts>
EnableIf< k != 0, const typename ElemTypeHolder<k, Tuple<T, Ts...> >::type &>::type visioncpp::internal::tools::tuple::get ( const Tuple< T, Ts... > &  t)

get

Extracts the Kth element from the tuple when the tuple and all the elements inside are const.

Template Parameters
Kis an integer value in [0,sizeof...(Types)) range.
Tis the (sizeof...(Types) -(K+1)) element in the tuple.
Ts...are the elements type in the tuple.
Parameters
tis the const tuple whose contents to extract.
Returns
const typename ElemTypeHolder<K, Tuple<Ts...>>::type &>::type

Definition at line 142 of file tuple.hpp.

References get(), and visioncpp::internal::tools::tuple::Tuple< T, Ts... >::tail.

Here is the call graph for this function:

◆ get() [2/4]

template<size_t k, class... Ts>
EnableIf<k == 0, const typename ElemTypeHolder<0, Tuple<Ts...> >::type &>::type visioncpp::internal::tools::tuple::get ( const Tuple< Ts... > &  t)

get

Extracts the first element from the tuple when the tuple and all the elements inside it are const. K=0 represents the first element of the tuple. The tuple cannot be empty.

Template Parameters
Ts...are the elements type in the tuple.
Parameters
tis the const tuple whose contents to extract.
Returns
const typename ElemTypeHolder<0, Tuple<Ts...>>::type &>::type

Definition at line 127 of file tuple.hpp.

◆ get() [3/4]

template<size_t k, class T , class... Ts>
EnableIf<k != 0, typename ElemTypeHolder<k, Tuple<T, Ts...> >::type &>::type visioncpp::internal::tools::tuple::get ( Tuple< T, Ts... > &  t)

get

Extracts the Kth element from the tuple.

Template Parameters
Kis an integer value in [0,sizeof...(Types)) range.
Tis the (sizeof...(Types) -(K+1)) element in the tuple.
Ts...are the elements type in the tuple.
Parameters
tis the tuple whose contents to extract.
Returns
typename ElemTypeHolder<K, Tuple<Ts...>>::type &>::type

Definition at line 113 of file tuple.hpp.

References get(), and visioncpp::internal::tools::tuple::Tuple< T, Ts... >::tail.

Here is the call graph for this function:

◆ get() [4/4]

template<size_t k, class... Ts>
EnableIf<k == 0, typename ElemTypeHolder<0, Tuple<Ts...> >::type &>::type visioncpp::internal::tools::tuple::get ( Tuple< Ts... > &  t)

get

Extracts the first element from the tuple. K=0 represents the first element of the tuple. The tuple cannot be empty.

Template Parameters
Ts...are the elements type in the tuple.
Parameters
tis the tuple whose contents to extract.
Returns
typename ElemTypeHolder<0, Tuple<Ts...>>::type &>::type

Definition at line 99 of file tuple.hpp.

Referenced by visioncpp::internal::EvalExpr< LeafNode< PlaceHolder< Memory_Type, N, Cols, Rows, Sc >, LVL >, Loc, Params... >::eval_neighbour(), visioncpp::internal::EvalExpr< Assign< LHS, RHS, Cols, Rows, LfType, LVL >, Loc, Params... >::eval_neighbour(), get(), and visioncpp::internal::ParallelCopy< LHS, RHS, Cols, Rows, OffsetColIn, OffsetRowIn, OffsetColOut, OffsetRowOut, LfType, LVL >::sub_expression_evaluation().

Here is the caller graph for this function:

◆ make_tuple()

template<typename... Args>
Tuple<Args...> visioncpp::internal::tools::tuple::make_tuple ( Args...  args)

◆ size()

template<typename... Args>
static constexpr size_t visioncpp::internal::tools::tuple::size ( Tuple< Args... > &  )
staticconstexpr

size

Returns the number of the elements in the tuple as a compile-time expression.

Template Parameters
Argsthe type of the arguments to construct the tuple from.
Returns
size_t

Definition at line 163 of file tuple.hpp.

Referenced by visioncpp::internal::Device_< backend::sycl, dv >::execute().

Here is the caller graph for this function: