crtp.h
Go to the documentation of this file.
1 // Copyright 2014 Nicolas Mellado
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // -------------------------------------------------------------------------- //
16 //
17 // Authors: Gael Guennebaud
18 
19 #ifndef _OPENGR_UTILS_CRTP_H_
20 #define _OPENGR_UTILS_CRTP_H_
21 
22 
23 
24 namespace gr{
25  namespace Utils{
26 
27 #ifndef PARSED_BY_DOXYGEN
28  /// Internal namespace used for crtp implementation
29  namespace crtp {
30  struct EmptyBaseClass {};
31 
32  template<class Derived,
33  template <class,class> class... Bases>
34  struct make_base;
35 
36  template<class Derived,
37  template <class,class> class Base>
38  struct make_base<Derived,Base> {
39  typedef Base<Derived,EmptyBaseClass > type;
40  };
41 
42  template<class Derived,
43  template <class,class> class... Bases,
44  template <class,class> class Base0>
45  struct make_base<Derived,Base0,Bases...> {
46  typedef Base0<Derived,typename make_base<Derived,Bases...>::type> type;
47  };
48  }
49 #endif
50 
51  /// CRTP class designed by Gael Guennebaud
52  /// Source: http://disq.us/p/1tf4a7l
53  /// https://www.onlinegdb.com/rJEhwUc-m
54  template< template <class,class> class... Bases>
55  struct CRTP : public crtp::make_base<CRTP<Bases...>,Bases...>::type
56  {
57  using Base = typename crtp::make_base<CRTP,Bases...>::type;
58  };
59 
60  } // namespace Utils
61 } // namespace gr
62 
63 #endif // CRTP_H
CongruentSetExplorationBase< Traits, PointType, TransformVisitor, PairFilteringFunctor, OptExts... >::Scalar ComputeTransformation(const InputRange1 &P, const InputRange2 &Q, Eigen::Ref< typename CongruentSetExplorationBase< Traits, PointType, TransformVisitor, PairFilteringFunctor, OptExts... >::MatrixType > transformation, const Sampler< PointType > &sampler, TransformVisitor &v)
Definition: congruentSetExplorationBase.hpp:61
void get(int queryId, int nElPerDim, int, typename NeighborhoodType< 3 >::ptr first, typename NeighborhoodType< 3 >::ptr)
Definition: utils.h:279
CRTP class designed by Gael Guennebaud Source: http://disq.us/p/1tf4a7l https://www.onlinegdb.com/rJEhwUc-m.
Definition: crtp.h:55