SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
 All Classes Namespaces Files Functions Variables Typedefs Groups
Index.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011-2012 The SkelCL Team as listed in CREDITS.txt *
3  * http://skelcl.uni-muenster.de *
4  * *
5  * This file is part of SkelCL. *
6  * SkelCL is available under multiple licenses. *
7  * The different licenses are subject to terms and condition as provided *
8  * in the files specifying the license. See "LICENSE.txt" for details *
9  * *
10  *****************************************************************************
11  * *
12  * SkelCL is free software: you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation, either version 3 of the License, or *
15  * (at your option) any later version. See "LICENSE-gpl.txt" for details. *
16  * *
17  * SkelCL is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  *****************************************************************************
23  * *
24  * For non-commercial academic use see the license specified in the file *
25  * "LICENSE-academic.txt". *
26  * *
27  *****************************************************************************
28  * *
29  * If you are interested in other licensing models, including a commercial- *
30  * license, please contact the author at michel.steuwer@uni-muenster.de *
31  * *
32  *****************************************************************************/
33 
39 
40 #ifndef INDEX_H_
41 #define INDEX_H_
42 
43 #include "detail/skelclDll.h"
44 
45 #include <cstring>
46 #include <utility>
47 
48 namespace skelcl {
49 
54 class SKELCL_DLL Index {
55 public:
60  typedef size_t index_type;
61 
65  Index();
66 
72  Index(const index_type index);
73 
74  //Index(const Index& rhs) = default;
75  //Index(Index&& rhs) = default;
76  //Index& operator=(const Index& rhs) = default;
77  //Index& operator=(Index&& rhs) = default;
78  //~Index() = default;
79 
89  bool operator==(const Index& rhs) const;
90 
100  bool operator!=(const Index& rhs) const;
101 
108  operator index_type() const;
109 
116  index_type get() const;
117 
118 private:
119  index_type _index;
120 };
121 
122 
128 class SKELCL_DLL IndexPoint {
129 public:
134  typedef std::pair<Index, Index> indexPoint_type;
135 
139  IndexPoint();
140 
148  IndexPoint(const indexPoint_type& indexPoint);
149 
155  IndexPoint(const IndexPoint& rhs) = default;
156 
164  IndexPoint(const Index& row, const Index& column);
165 
173  IndexPoint(IndexPoint&& indexPoint);
174 
180  IndexPoint& operator=(IndexPoint&& rhs);
181 
187  IndexPoint& operator=(const IndexPoint& rhs);
188 
198  bool operator==(const IndexPoint& rhs) const;
199 
209  bool operator!=(const IndexPoint& rhs) const;
210 
218  operator indexPoint_type() const;
219 
226  indexPoint_type get() const;
227 
235  const Index& rowID() const;
236 
244  const Index& y() const;
245 
253  const Index& columnID() const;
254 
262  const Index& x() const;
263 
264 private:
265  indexPoint_type _indexPoint;
266 };
267 
268 } // namespace skelcl
269 
270 #endif // INDEX_H_
271 
This class defines an two-dimensional IndexPoint, i.e. a pair of unsigned integers representing a val...
Definition: Index.h:128
This class defines an Index, i.e. an unsigned integer representing a value in a one-dimensional index...
Definition: Index.h:54
std::pair< Index, Index > indexPoint_type
Actual type used to store the pair of unsigned integers representing the IndexPoint.
Definition: Index.h:134
size_t index_type
Actual type used to store the unsigned integer representing the Index.
Definition: Index.h:60