YAPOG  0.0.1
Yet Another Pokemon Online Game
Matrix.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_MATRIX_HPP
2 # define YAPOG_MATRIX_HPP
3 
4 # include "YAPOG/Macros.hpp"
6 
7 namespace yap
8 {
9  namespace collection
10  {
11  template <typename T>
12  class Matrix
13  {
14  public:
15 
16  typedef T DataType;
18  typedef typename InnerType::SizeType SizeType;
19  typedef typename InnerType::ItType ItType;
21 
22  Matrix (SizeType width, SizeType height, const DataType& data);
23 
24  Matrix (const Matrix<T>& copy);
25  Matrix& operator= (const Matrix<T>& copy);
26 
27  ItType begin ();
28  ConstItType begin () const;
29  ItType Begin ();
30  ConstItType Begin () const;
31 
32  ItType end ();
33  ConstItType end () const;
34  ItType End ();
35  ConstItType End () const;
36 
37  void Resize (SizeType x, SizeType y, const T& data);
38 
39  void Set (SizeType x, SizeType y, const T& data);
40 
41  const T& operator() (SizeType x, SizeType y) const;
42  T& operator() (SizeType x, SizeType y);
43 
44  private:
45 
46  SizeType GetIndex (SizeType x, SizeType y) const;
47 
50 
52  };
53  } // namespace collection
54 } // namespace yap
55 
57 
58 #endif // YAPOG_MATRIX_HPP