quad_index.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2013 Damien Rohmer
4 **
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 
20 #ifndef _QUAD_INDEX_HPP_
21 #define _QUAD_INDEX_HPP_
22 
23 namespace cpe
24 {
26 {
27  public:
28 
29  // ********************************************* //
30  // ********************************************* //
31  // CONSTRUCTORS
32  // ********************************************* //
33  // ********************************************* //
34 
36  quad_index();
38  quad_index(const unsigned int& u0,const unsigned int& u1,const unsigned int& u2,const unsigned int& u3);
39 
40 
41  // ********************************************* //
42  // ********************************************* //
43  // Data access
44  // ********************************************* //
45  // ********************************************* //
46 
48  const unsigned int& u0() const;
50  const unsigned int& u1() const;
52  const unsigned int& u2() const;
54  const unsigned int& u3() const;
55 
57  unsigned int& u0();
59  unsigned int& u1();
61  unsigned int& u2();
63  unsigned int& u3();
64 
66  const unsigned int& operator[](const unsigned int& k_index) const;
68  unsigned int& operator[](const unsigned int& k_index);
69 
70  private:
71 
73  void assert_size(const unsigned int& k) const;
74 
76  unsigned int internal_u[4];
77 };
78 }
79 
80 #endif