SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
overfill_error.hh
Go to the documentation of this file.
1 namespace TooN{
2 namespace Internal{
3 
4 template<bool b> struct overfill;
5 template<> struct overfill<0>{};
6 
7 template<int N, int Size> struct CheckOverFill
8 {
9  static void check(int)
10  {
11  #ifdef TOON_TEST_INTERNALS
12  if(N >= Size)
13  throw StaticVectorOverfill();
14  #else
15  Internal::overfill<(N>=Size)> overfilled_vector;
16  #endif
17  };
18 };
19 
20 template<int N> struct CheckOverFill<N, -1>
21 {
22  static void check(int s)
23  {
24  #ifdef TOON_TEST_INTERNALS
25  if(N >= s)
26  throw VectorOverfill();
27  #elif !defined TOON_NDEBUG_FILL
28  if(N >= s)
29  {
30  std::cerr << "TooN overfilled vector" << std::endl;
31  std::abort();
32  }
33  #endif
34  };
35 };
36 
37 
38 template<int N, int R, int C, bool IsDynamic=(R==-1||C==-1)> struct CheckMOverFill
39 {
40  static void check(int)
41  {
42  #ifdef TOON_TEST_INTERNALS
43  if(N >= R*C)
44  throw StaticMatrixOverfill();
45  #else
46  Internal::overfill<(N>=R*C)>();
47  #endif
48  }
49 };
50 
51 template<int N, int R, int C> struct CheckMOverFill<N, R, C, 1>
52 {
53  static void check(int s)
54  {
55  #ifdef TOON_TEST_INTERNALS
56  if(N >= s)
57  throw StaticMatrixOverfill();
58  #else
59  if(N >= s)
60  {
61  std::cerr << "TooN overfilled matrix" << std::endl;
62  std::abort();
63  }
64  #endif
65  }
66 };
67 
68 }}
Everything lives inside this namespace.
Definition: allocator.hh:48