Directory: | ./ |
---|---|
File: | src/distance/serialization.cc |
Date: | 2024-08-10 11:29:48 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 11 | 23 | 47.8% |
Branches: | 4 | 28 | 14.3% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2020 CNRS | ||
3 | // Authors: Joseph Mirabel | ||
4 | // | ||
5 | |||
6 | // Redistribution and use in source and binary forms, with or without | ||
7 | // modification, are permitted provided that the following conditions are | ||
8 | // met: | ||
9 | // | ||
10 | // 1. Redistributions of source code must retain the above copyright | ||
11 | // notice, this list of conditions and the following disclaimer. | ||
12 | // | ||
13 | // 2. Redistributions in binary form must reproduce the above copyright | ||
14 | // notice, this list of conditions and the following disclaimer in the | ||
15 | // documentation and/or other materials provided with the distribution. | ||
16 | // | ||
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
21 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
28 | // DAMAGE. | ||
29 | |||
30 | #include <boost/serialization/weak_ptr.hpp> | ||
31 | #include <hpp/core/distance.hh> | ||
32 | #include <hpp/core/distance/reeds-shepp.hh> | ||
33 | #include <hpp/core/weighed-distance.hh> | ||
34 | #include <hpp/pinocchio/device.hh> | ||
35 | #include <hpp/pinocchio/joint.hh> | ||
36 | #include <hpp/pinocchio/serialization.hh> // For serialization of Device | ||
37 | #include <hpp/util/serialization.hh> | ||
38 | #include <pinocchio/serialization/eigen.hpp> | ||
39 | |||
40 | 18 | BOOST_CLASS_EXPORT(hpp::core::WeighedDistance) | |
41 | 18 | BOOST_CLASS_EXPORT(hpp::core::distance::ReedsShepp) | |
42 | |||
43 | namespace hpp { | ||
44 | namespace core { | ||
45 | |||
46 | template <typename Archive> | ||
47 | 12 | inline void Distance::serialize(Archive& ar, const unsigned int version) { | |
48 | (void)version; | ||
49 | (void)ar; | ||
50 | 12 | } | |
51 | |||
52 | template <typename Archive> | ||
53 | 12 | inline void WeighedDistance::serialize(Archive& ar, | |
54 | const unsigned int version) { | ||
55 | (void)version; | ||
56 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
12 | ar& boost::serialization::make_nvp( |
57 | 12 | "base", boost::serialization::base_object<Distance>(*this)); | |
58 |
1/2✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
12 | ar& BOOST_SERIALIZATION_NVP(robot_); |
59 |
1/2✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
12 | ar& BOOST_SERIALIZATION_NVP(weights_); |
60 |
1/2✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
12 | ar& BOOST_SERIALIZATION_NVP(weak_); |
61 | 12 | } | |
62 | |||
63 | HPP_SERIALIZATION_IMPLEMENT(WeighedDistance); | ||
64 | |||
65 | namespace distance { | ||
66 | |||
67 | template <typename Archive> | ||
68 | ✗ | inline void ReedsShepp::serialize(Archive& ar, const unsigned int version) { | |
69 | (void)version; | ||
70 | ✗ | ar& boost::serialization::make_nvp( | |
71 | ✗ | "base", boost::serialization::base_object<Distance>(*this)); | |
72 | ✗ | ar& BOOST_SERIALIZATION_NVP(weighedDistance_); | |
73 | ✗ | ar& BOOST_SERIALIZATION_NVP(device_); | |
74 | ✗ | ar& BOOST_SERIALIZATION_NVP(rho_); | |
75 | ✗ | ar& BOOST_SERIALIZATION_NVP(xy_); | |
76 | ✗ | ar& BOOST_SERIALIZATION_NVP(rz_); | |
77 | ✗ | ar& BOOST_SERIALIZATION_NVP(xyId_); | |
78 | ✗ | ar& BOOST_SERIALIZATION_NVP(rzId_); | |
79 | ✗ | ar& BOOST_SERIALIZATION_NVP(wheels_); | |
80 | ✗ | ar& BOOST_SERIALIZATION_NVP(weak_); | |
81 | } | ||
82 | |||
83 | HPP_SERIALIZATION_IMPLEMENT(ReedsShepp); | ||
84 | |||
85 | } // namespace distance | ||
86 | |||
87 | } // namespace core | ||
88 | } // namespace hpp | ||
89 |