type_gentype.hpp
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 #ifndef glm_core_type_gentype
30 #define glm_core_type_gentype
31 
32 #include "type_size.hpp"
33 
34 namespace glm
35 {
36  enum profile
37  {
38  nice,
39  fast,
40  simd
41  };
42 
43 namespace detail
44 {
45  template
46  <
47  typename VALTYPE,
48  template <typename> class TYPE
49  >
50  struct genType
51  {
52  public:
53  enum ctor{null};
54 
55  typedef VALTYPE value_type;
56  typedef VALTYPE & value_reference;
57  typedef VALTYPE * value_pointer;
58  typedef VALTYPE const * value_const_pointer;
59  typedef TYPE<bool> bool_type;
60 
61  typedef sizeType size_type;
62  static bool is_vector();
63  static bool is_matrix();
64 
65  typedef TYPE<VALTYPE> type;
66  typedef TYPE<VALTYPE> * pointer;
67  typedef TYPE<VALTYPE> const * const_pointer;
68  typedef TYPE<VALTYPE> const * const const_pointer_const;
69  typedef TYPE<VALTYPE> * const pointer_const;
70  typedef TYPE<VALTYPE> & reference;
71  typedef TYPE<VALTYPE> const & const_reference;
72  typedef TYPE<VALTYPE> const & param_type;
73 
75  // Address (Implementation details)
76 
77  value_const_pointer value_address() const{return value_pointer(this);}
78  value_pointer value_address(){return value_pointer(this);}
79 
80  //protected:
81  // enum kind
82  // {
83  // GEN_TYPE,
84  // VEC_TYPE,
85  // MAT_TYPE
86  // };
87 
88  // typedef typename TYPE::kind kind;
89  };
90 
91  template
92  <
93  typename VALTYPE,
94  template <typename> class TYPE
95  >
96  bool genType<VALTYPE, TYPE>::is_vector()
97  {
98  return true;
99  }
100 /*
101  template <typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice>
102  class base
103  {
104  public:
106  // Traits
107 
108  typedef sizeType size_type;
109  typedef valTypeT value_type;
110 
111  typedef base<value_type, colT, rowT> class_type;
112 
113  typedef base<bool, colT, rowT> bool_type;
114  typedef base<value_type, rowT, 1> col_type;
115  typedef base<value_type, colT, 1> row_type;
116  typedef base<value_type, rowT, colT> transpose_type;
117 
118  static size_type col_size();
119  static size_type row_size();
120  static size_type value_size();
121  static bool is_scalar();
122  static bool is_vector();
123  static bool is_matrix();
124 
125  private:
126  // Data
127  col_type value[colT];
128 
129  public:
131  // Constructors
132  base();
133  base(class_type const & m);
134 
135  explicit base(value_type const & x);
136  explicit base(value_type const * const x);
137  explicit base(col_type const * const x);
138 
140  // Conversions
141  template <typename vU, uint cU, uint rU, profile pU>
142  explicit base(base<vU, cU, rU, pU> const & m);
143 
145  // Accesses
146  col_type& operator[](size_type i);
147  col_type const & operator[](size_type i) const;
148 
150  // Unary updatable operators
151  class_type& operator= (class_type const & x);
152  class_type& operator+= (value_type const & x);
153  class_type& operator+= (class_type const & x);
154  class_type& operator-= (value_type const & x);
155  class_type& operator-= (class_type const & x);
156  class_type& operator*= (value_type const & x);
157  class_type& operator*= (class_type const & x);
158  class_type& operator/= (value_type const & x);
159  class_type& operator/= (class_type const & x);
160  class_type& operator++ ();
161  class_type& operator-- ();
162  };
163 */
164  }//namespace detail
165 }//namespace glm
166 
167 //#include "type_gentype.inl"
168 
169 #endif//glm_core_type_gentype