1 #ifndef DASH__VIEW__VIEW_TRAITS_H__INCLUDED 2 #define DASH__VIEW__VIEW_TRAITS_H__INCLUDED 7 #include <dash/Range.h> 21 template <
class Viewable>
22 constexpr
typename Viewable::domain_type &
23 domain(
const Viewable & v);
30 template <
class ViewT>
33 typedef typename ViewT::domain_type domain_type;
34 typedef typename ViewT::image_type image_type;
35 typedef typename ViewT::origin_type origin_type;
36 typedef typename ViewT::local_type local_type;
37 typedef typename ViewT::global_type global_type;
39 typedef std::integral_constant<dim_t, value> rank;
41 typedef std::integral_constant<bool, value> is_origin;
42 typedef std::integral_constant<bool, value> is_view;
43 typedef std::integral_constant<bool, value> is_projection;
44 typedef std::integral_constant<bool, value> is_local;
49 template <
class ViewableType>
52 template <
class ViewType>
53 class IndexSetIdentity;
61 DASH__META__DEFINE_TRAIT__HAS_TYPE(domain_type)
62 DASH__META__DEFINE_TRAIT__HAS_TYPE(index_set_type)
70 template <
class ViewableType>
72 struct is_view : dash::detail::has_type_index_set_type<ViewableType> { };
84 struct _view_traits { };
89 template <
class ViewT>
96 typedef std::integral_constant<bool, false> is_projection;
97 typedef std::integral_constant<bool, true> is_view;
99 typedef std::integral_constant<bool, false> is_origin;
101 typedef typename ViewT::index_type index_type;
102 typedef typename ViewT::size_type size_type;
103 typedef typename ViewT::index_set_type index_set_type;
104 typedef typename ViewT::domain_type domain_type;
105 typedef std::integral_constant<bool,
107 ViewT::is_local::value ||
109 _view_traits<domain_type,
110 dash::is_view<domain_type>::value,
112 >::is_local::value > is_local;
114 typedef typename ViewT::local_type local_type;
115 typedef typename ViewT::global_type global_type;
116 typedef typename std::conditional<is_local::value,
118 global_type >::type image_type;
119 typedef typename dash::view_traits<domain_type>::origin_type origin_type;
121 typedef std::integral_constant<dim_t, ViewT::rank::value> rank;
130 template <
class ContainerT>
137 typedef ContainerT origin_type;
138 typedef ContainerT domain_type;
139 typedef ContainerT image_type;
140 typedef ContainerT global_type;
141 typedef typename ContainerT::local_type local_type;
142 typedef typename ContainerT::index_type index_type;
143 typedef typename ContainerT::size_type size_type;
144 typedef typename dash::IndexSetIdentity<ContainerT> index_set_type;
146 typedef typename ContainerT::pattern_type pattern_type;
150 typedef std::integral_constant<bool, false> is_projection;
151 typedef std::integral_constant<bool, false> is_view;
153 typedef std::integral_constant<bool, true> is_origin;
157 typedef std::integral_constant<bool, std::is_same<
159 typename ContainerT::local_type
162 typedef std::integral_constant<
dim_t,
163 ContainerT::rank::value> rank;
172 template <
class ViewableType>
174 : detail::_view_traits<
176 dash::is_view<ViewableType>::value,
177 dash::is_range<ViewableType>::value > {
184 #endif // DASH__VIEW__VIEW_TRAITS_H__INCLUDED This class is a simple memory pool which holds allocates elements of size ValueType.
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
Definition of type trait dash::is_range<T> with static member value indicating whether type T is a mo...
constexpr auto domain(ViewT &&view) -> typename std::enable_if< dash::detail::has_type_domain_type< ViewValueT >::value, decltype(std::forward< ViewT >(view).domain()) >::type