atlas
array_fwd.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2013 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation
8  * nor does it submit to any jurisdiction.
9  */
10 
14 
17 
18 #pragma once
19 
20 #include <cstddef>
21 #include <type_traits>
22 #include "atlas/array/ArrayViewDefs.h"
23 
24 #define ENABLE_IF_NOT_CONST typename std::enable_if<!std::is_const<Value>::value, Value>::type* = nullptr
25 #define ENABLE_IF_CONST typename std::enable_if<std::is_const<Value>::value, Value>::type* = nullptr
26 
27 namespace atlas {
28 namespace array {
29 
30 class DataType;
31 
32 class ArraySpec;
33 
34 class ArrayShape;
35 
36 class ArrayStrides;
37 
38 class Array;
39 
40 template <typename Value>
41 class ArrayT;
42 
43 template <typename Value, int Rank>
44 class ArrayView;
45 
46 template <typename Value, int Rank>
47 class LocalView;
48 
49 template <typename Value, int Rank>
50 class IndexView;
51 
52 template <typename Value, int Rank>
53 ArrayView<Value, Rank> make_view( Array& array );
54 
55 template <typename Value, int Rank>
56 ArrayView<const Value, Rank> make_view( const Array& array );
57 
58 
59 template <class Value, int Rank, ENABLE_IF_NOT_CONST>
60 LocalView<Value, Rank> make_view( Value data[], const ArrayShape& shape );
61 
62 template <class Value, int Rank, ENABLE_IF_NOT_CONST>
63 LocalView<const Value, Rank> make_view( const Value data[], const ArrayShape& shape );
64 
65 template <class Value, int Rank, ENABLE_IF_CONST>
66 LocalView<Value, Rank> make_view( Value data[], const ArrayShape& shape );
67 
68 template <class Value, int Rank, ENABLE_IF_CONST>
69 LocalView<Value, Rank> make_view( typename std::remove_const<Value>::type data[], const ArrayShape& shape );
70 
71 //------------------------------------------------------------------------------------------------------
72 
73 template <typename Value, unsigned int Rank, ENABLE_IF_NOT_CONST>
74 LocalView<Value, Rank> make_view( Value data[], size_t size );
75 
76 template <typename Value, unsigned int Rank, ENABLE_IF_NOT_CONST>
77 LocalView<const Value, Rank> make_view( const Value data[], size_t size );
78 
79 template <typename Value, unsigned int Rank, ENABLE_IF_CONST>
80 LocalView<Value, Rank> make_view( Value data[], size_t size );
81 
82 template <typename Value, unsigned int Rank, ENABLE_IF_CONST>
83 LocalView<Value, Rank> make_view( typename std::remove_const<Value>::type data[], size_t size );
84 
85 template <typename Value, int Rank>
86 ArrayView<Value, Rank> make_host_view( Array& array );
87 
88 template <typename Value, int Rank>
89 ArrayView<const Value, Rank> make_host_view( const Array& array );
90 
91 template <typename Value, int Rank>
92 ArrayView<Value, Rank> make_device_view( Array& array );
93 
94 template <typename Value, int Rank>
95 ArrayView<const Value, Rank> make_device_view( const Array& array );
96 
97 
98 template <typename Value, int Rank>
99 IndexView<Value, Rank> make_indexview( Array& array );
100 
101 template <typename Value, int Rank>
102 IndexView<const Value, Rank> make_indexview( const Array& array );
103 
104 
105 template <typename Value, int Rank>
106 IndexView<Value, Rank> make_host_indexview( Array& array );
107 
108 template <typename Value, int Rank>
109 IndexView<const Value, Rank> make_host_indexview( const Array& array );
110 
111 // class Table;
112 
113 // template <bool ReadOnly>
114 // class TableView;
115 
116 // template <bool ReadOnly>
117 // class TableRow;
118 
119 // template <bool ReadOnly = true>
120 // TableView<ReadOnly> make_table_view( const Table& table );
121 
122 #undef ENABLE_IF_NOT_CONST
123 #undef ENABLE_IF_CONST
124 
125 
126 } // namespace array
127 } // namespace atlas
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33