source: src/base/tuple.hpp@ dfed1c

Last change on this file since dfed1c was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 877 bytes
Line 
1/**
2 * @file tuple.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Wed May 18 16:48:46 2011
5 *
6 * @brief Templated class for storing tuples.
7 *
8 */
9
10namespace VMG
11{
12
13template<class T>
14class Tuple
15{
16public:
17 T& Left() {return left;}
18 T& Right() {return right;}
19
20 const T& Left() const {return left;}
21 const T& Right() const {return right;}
22
23private:
24 T left, right;
25};
26
27template <class T>
28class Tuple3
29{
30public:
31 Tuple<T>& operator[](const int& index) {return tuples[index];}
32 Tuple<T>& X() {return tuples[0];}
33 Tuple<T>& Y() {return tuples[1];}
34 Tuple<T>& Z() {return tuples[2];}
35
36 const Tuple<T>& operator[](const int& index) const {return tuples[index];}
37 const Tuple<T>& X() const {return tuples[0];}
38 const Tuple<T>& Y() const {return tuples[1];}
39 const Tuple<T>& Z() const {return tuples[2];}
40
41private:
42 Tuple<T> tuples[3];
43};
44
45}
Note: See TracBrowser for help on using the repository browser.