$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
next/solve.hh
1 // Copyright (C) 2006, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
2 //
3 // This file is part of Olena.
4 //
5 // Olena is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation, version 2 of the License.
8 //
9 // Olena is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
16 //
17 // As a special exception, you may use this file as part of a free
18 // software project without restriction. Specifically, if other files
19 // instantiate templates or use macros or inline functions from this
20 // file, or you compile this file and link it with other files to produce
21 // an executable, this file does not by itself cause the resulting
22 // executable to be covered by the GNU General Public License. This
23 // exception does not however invalidate any other reasons why the
24 // executable file might be covered by the GNU General Public License.
25 
26 #ifndef MLN_TRAIT_NEXT_SOLVE_HH
27 # define MLN_TRAIT_NEXT_SOLVE_HH
28 
32 
33 # include <mln/core/category.hh>
34 # include <mln/metal/equal.hh>
35 # include <mln/metal/if.hh>
36 # include <mln/metal/ret.hh>
37 # include <mln/trait/solve.hh>
38 
39 
40 // FIXME: Just for the record (use it...)
41 
42 # ifndef MLN_DEBUG_TRAITS
43 # endif // ! MLN_DEBUG_TRAITS
44 
45 
46 # define mln_trait_nunary(Name, T) typename mln::trait::next::solve_unary< Name, T >::ret
47 # define mln_trait_nunary_(Name, T) mln::trait::next::solve_unary< Name, T >::ret
48 
49 # define mln_trait_nbinary(Name, T1, T2) typename mln::trait::next::solve_binary< Name, T1, T2 >::ret
50 # define mln_trait_nbinary_(Name, T1, T2) mln::trait::next::solve_binary< Name, T1, T2 >::ret
51 
52 
53 
54 namespace mln
55 {
56 
57  namespace trait
58  {
59 
60  namespace next
61  {
62 
63  // Unary case.
64 
65 
66  template < typename Name,
67  typename T >
68  struct set_precise_unary_
69  {
70  typedef undefined ret;
71  };
72 
73 
74  template < typename Name,
75  template <class> class Category_T, typename T >
76  struct set_unary_
77  {
78  typedef undefined ret;
79  };
80 
81  template < typename Name,
82  typename T >
83  struct set_unary_< Name, Unknown, T > // Blocker; top of inheritance.
84  {
85  typedef not_found ret;
86  };
87 
88 
89 
90 
91  // Binary case.
92 
93 
94  template < typename Name,
95  typename L,
96  typename R >
97  struct set_precise_binary_
98  {
99  typedef undefined ret;
100  };
101 
102 
103  template < typename Name,
104  template <class> class Category_L, typename L,
105  template <class> class Category_R, typename R >
106  struct set_binary_
107  {
108  typedef undefined ret;
109  };
110 
111  template < typename Name,
112  typename L,
113  template <class> class Category_R, typename R >
114  struct set_binary_< Name, Unknown, L, Category_R, R > // Left blocker.
115  {
116  typedef not_found ret;
117  };
118 
119  template < typename Name,
120  template <class> class Category_L, typename L,
121  typename R >
122  struct set_binary_< Name, Category_L, L, Unknown, R > // Right blocker.
123  {
124  typedef not_found ret;
125  };
126 
127  template < typename Name,
128  typename L,
129  typename R >
130  struct set_binary_< Name, Unknown, L, Unknown, R > // Blocker.
131  {
132  typedef not_found ret;
133  };
134 
135  } // end of namespace mln::trait::next
136 
137  } // end of namespace mln::trait
138 
139 } // end of namespace mln
140 
141 
142 # include <mln/trait/next/solve_unary.hh>
143 # include <mln/trait/next/solve_binary.hh>
144 # include <mln/trait/next/solve_proxy.hh>
145 
146 #endif // ! MLN_TRAIT_NEXT_SOLVE_HH