Honeycomb  0.1
Component-Model Framework
Traits.h
Go to the documentation of this file.
1 // Honeycomb, Copyright (C) 2015 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
2 #pragma once
3 
4 #include "Honey/Math/Alge/Alge.h"
5 #include "Honey/String/Stream.h"
6 
7 namespace honey
8 {
9 
10 template<class Subclass> class MatrixBase;
11 template<sdt Rows, sdt Cols, class Real = Real, int Options = 0, class Alloc = std::allocator<int8>> class Matrix;
12 template<sdt Dim, class Real = Real, int Options = 0, class Alloc = std::allocator<int8>> class Vec;
13 
15 namespace matrix
16 {
18  namespace priv
19  {
20  template<class Subclass> struct Traits;
21  }
22 
23  static const sdt dynamic = -1;
24 
26  struct Option
27  {
28  enum t
29  {
31  align_mask = (1 << 4) - 1,
32  vecRow = 1 << 4
33  };
34 
36  template<szt Align> struct setAlign : mt::Value<int, (mt::log2Floor<Align>::value & align_mask) << align_shift> {};
37  template<int Options> struct getAlign : mt::Value<szt, 1 << ((Options >> align_shift) & align_mask)> {};
38  };
39 
40  template<class Matrix, sdt Rows = dynamic, sdt Cols = dynamic> class Block;
41 }
42 
44 namespace vec
45 {
47  namespace priv
48  {
49  template<class Vec, sdt Dim = matrix::dynamic> struct Segment;
50  }
51 }
52 
53 }
static const sdt dynamic
Definition: Traits.h:23
t
Definition: Traits.h:28
7 bit alignment stored as log2, so max alignment is 2^15 byte boundary
Definition: Traits.h:32
Definition: Traits.h:30
ptrdiff_t sdt
Size difference type, shorthand for ptrdiff_t.
Definition: Core.h:92
Alignment must be a power of 2.
Definition: Traits.h:36
std::integral_constant< T, val > Value
Holds a constant integral value.
Definition: Meta.h:29
Matrix type options.
Definition: Traits.h:26
N-dimensional vector.
Definition: Traits.h:12
Definition: Traits.h:20
Definition: Traits.h:31
Global Honeycomb namespace.