DASH  0.3.0
Remote.h
1 #ifndef DASH__VIEW__REMOTE_H__INCLUDED
2 #define DASH__VIEW__REMOTE_H__INCLUDED
3 
4 #include <dash/Types.h>
5 #include <dash/Range.h>
6 
7 #include <dash/view/ViewTraits.h>
8 
9 
10 namespace dash {
11 
15 template <class ViewType>
16 constexpr auto
17 remote(dash::team_unit_t unit, const ViewType & v)
18 -> typename std::enable_if<
20  decltype(v.local())
21 // const typename ViewType::local_type
22  >::type {
23  return v.local();
24 }
25 
29 template <class ContainerType>
30 constexpr
31 typename std::enable_if<
33  const typename ContainerType::local_type &
34 >::type
35 remote(dash::team_unit_t unit, const ContainerType & c) {
36  return c.local;
37 }
38 
39 
40 } // namespace dash
41 
42 #endif // DASH__VIEW__REMOTE_H__INCLUDED
This class is a simple memory pool which holds allocates elements of size ValueType.
Definition: AllOf.h:8
View type traits.
Definition: ViewTraits.h:31
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
Definition: Types.h:319
constexpr auto remote(dash::team_unit_t unit, const ViewType &v) -> typename std::enable_if< dash::view_traits< ViewType >::is_view::value, decltype(v.local()) >::type
Definition: Remote.h:17