Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2015-2023 CNRS INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef __pinocchio_multibody_visitor_fusion_hpp__ |
6 |
|
|
#define __pinocchio_multibody_visitor_fusion_hpp__ |
7 |
|
|
|
8 |
|
|
#define BOOST_FUSION_INVOKE_MAX_ARITY 12 |
9 |
|
|
|
10 |
|
|
#include <boost/variant/static_visitor.hpp> |
11 |
|
|
#include <boost/fusion/include/invoke.hpp> |
12 |
|
|
#include <boost/fusion/container/generation/make_vector.hpp> |
13 |
|
|
|
14 |
|
|
namespace pinocchio |
15 |
|
|
{ |
16 |
|
|
namespace fusion |
17 |
|
|
{ |
18 |
|
|
|
19 |
|
|
namespace bf = boost::fusion; |
20 |
|
|
typedef boost::blank NoArg; |
21 |
|
|
|
22 |
|
|
} // namespace fusion |
23 |
|
|
} // namespace pinocchio |
24 |
|
|
|
25 |
|
|
namespace boost |
26 |
|
|
{ |
27 |
|
|
namespace fusion |
28 |
|
|
{ |
29 |
|
|
|
30 |
|
|
/// \brief Append the element T at the front of boost fusion vector V. |
31 |
|
|
template<typename T, typename V> |
32 |
|
268177 |
typename result_of::push_front<V const, T>::type append(T const & t, V const & v) |
33 |
|
|
{ |
34 |
|
268177 |
return push_front(v, t); |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
/// \brief Append the elements T1 and T2 at the front of boost fusion vector V. |
38 |
|
|
template<typename T1, typename T2, typename V> |
39 |
|
|
typename result_of::push_front<typename result_of::push_front<V const, T2>::type const, T1>:: |
40 |
|
|
type |
41 |
|
700734 |
append(T1 const & t1, T2 const & t2, V const & v) |
42 |
|
|
{ |
43 |
1/2
✓ Branch 2 taken 52 times.
✗ Branch 3 not taken.
|
700734 |
return push_front(push_front(v, t2), t1); |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
/// \brief Append the elements T1, T2 and T3 at the front of boost fusion vector V. |
47 |
|
|
template<typename T1, typename T2, typename T3, typename V> |
48 |
|
|
typename result_of::push_front< |
49 |
|
|
typename result_of::push_front<typename result_of::push_front<V const, T3>::type const, T2>:: |
50 |
|
|
type const, |
51 |
|
|
T1>::type |
52 |
|
|
append(T1 const & t1, T2 const & t2, T3 const & t3, V const & v) |
53 |
|
|
{ |
54 |
|
|
return push_front(push_front(push_front(v, t3), t2), t1); |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
/// \brief Append the elements T1, T2, T3 and T4 at the front of boost fusion vector V. |
58 |
|
|
template<typename T1, typename T2, typename T3, typename T4, typename V> |
59 |
|
|
typename result_of::push_front< |
60 |
|
|
typename result_of::push_front< |
61 |
|
|
typename result_of:: |
62 |
|
|
push_front<typename result_of::push_front<V const, T4>::type const, T3>::type const, |
63 |
|
|
T2>::type const, |
64 |
|
|
T1>::type |
65 |
|
26 |
append(T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, V const & v) |
66 |
|
|
{ |
67 |
|
26 |
return push_front(push_front(push_front(push_front(v, t4), t3), t2), t1); |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
/// \brief Append the elements T1, T2, T3, T4 and T5 at the front of boost fusion vector V. |
71 |
|
|
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename V> |
72 |
|
|
typename result_of::push_front< |
73 |
|
|
typename result_of::push_front< |
74 |
|
|
typename result_of::push_front< |
75 |
|
|
typename result_of:: |
76 |
|
|
push_front<typename result_of::push_front<V const, T5>::type const, T4>::type const, |
77 |
|
|
T3>::type const, |
78 |
|
|
T2>::type const, |
79 |
|
|
T1>::type |
80 |
|
|
append(T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, V const & v) |
81 |
|
|
{ |
82 |
|
|
return push_front(push_front(push_front(push_front(push_front(v, t5), t4), t3), t2), t1); |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
} // namespace fusion |
86 |
|
|
} // namespace boost |
87 |
|
|
|
88 |
|
|
#endif // ifndef __pinocchio_multibody_visitor_fusion_hpp__ |
89 |
|
|
|