GCC Code Coverage Report


Directory: ./
File: include/pinocchio/algorithm/constraints/constraint-model-generic.hpp
Date: 2025-02-12 21:03:38
Exec Total Coverage
Lines: 3 3 100.0%
Branches: 1 2 50.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2023 INRIA
3 //
4
5 #ifndef __pinocchio_algorithm_constraint_model_generic_hpp__
6 #define __pinocchio_algorithm_constraint_model_generic_hpp__
7
8 #include "pinocchio/algorithm/constraints/fwd.hpp"
9 #include "pinocchio/algorithm/constraints/constraint-model-base.hpp"
10 #include "pinocchio/algorithm/constraints/constraint-data-generic.hpp"
11 #include "pinocchio/algorithm/constraints/visitors/constraint-model-visitor.hpp"
12
13 namespace pinocchio
14 {
15
16 template<
17 typename _Scalar,
18 int _Options,
19 template<typename S, int O> class ConstraintCollectionTpl>
20 struct traits<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>>
21 {
22 typedef _Scalar Scalar;
23 enum
24 {
25 Options = _Options
26 };
27 typedef ConstraintDataTpl<Scalar, Options, ConstraintCollectionTpl> ConstraintData;
28 };
29
30 template<
31 typename _Scalar,
32 int _Options,
33 template<typename S, int O> class ConstraintCollectionTpl>
34 struct ConstraintModelTpl
35 : ConstraintModelBase<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>>
36 , ConstraintCollectionTpl<_Scalar, _Options>::ConstraintModelVariant
37 {
38 typedef _Scalar Scalar;
39 enum
40 {
41 Options = _Options
42 };
43
44 typedef ConstraintModelBase<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>>
45 Base;
46 typedef ConstraintDataTpl<Scalar, Options, ConstraintCollectionTpl> ConstraintData;
47 typedef ConstraintCollectionTpl<Scalar, Options> ConstraintCollection;
48 typedef typename ConstraintCollection::ConstraintDataVariant ConstraintDataVariant;
49 typedef typename ConstraintCollection::ConstraintModelVariant ConstraintModelVariant;
50
51 ConstraintModelTpl()
52 : ConstraintModelVariant()
53 {
54 }
55
56 ConstraintModelTpl(const ConstraintModelVariant & cmodel_variant)
57 : ConstraintModelVariant(cmodel_variant)
58 {
59 }
60
61 template<typename ContraintModelDerived>
62 3 ConstraintModelTpl(const ConstraintModelBase<ContraintModelDerived> & cmodel)
63
1/2
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
3 : ConstraintModelVariant((ConstraintModelVariant)cmodel.derived())
64 {
65 BOOST_MPL_ASSERT(
66 (boost::mpl::contains<typename ConstraintModelVariant::types, ContraintModelDerived>));
67 3 }
68
69 ConstraintData createData() const
70 {
71 return ::pinocchio::createData<Scalar, Options, ConstraintCollectionTpl>(*this);
72 }
73 };
74
75 } // namespace pinocchio
76
77 #endif // ifndef __pinocchio_algorithm_constraint_model_generic_hpp__
78