hpp-constraints: include/hpp/constraints/serialization.hh Source File

hpp-constraints 9.0.2 Definition of basic geometric constraints for motion planning

Loading...
Searching...
No Matches
serialization.hh
Go to the documentation of this file.
1// Copyright (c) 2020, Joseph Mirabel
2// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_CONSTRAINTS_SERIALIZATION_HH
30#define HPP_CONSTRAINTS_SERIALIZATION_HH
31
32#include <boost/serialization/serialization.hpp>
33#include <boost/serialization/utility.hpp>
34#include <boost/serialization/vector.hpp>
35#include <hpp/constraints/matrix-view.hh>
36
37 namespace boost {
38 namespace serialization {
39
40 template <class Archive>
41 inline void segments_serialize(Archive& ar, const char* n,
42 Eigen::BlockIndex::segments_t& s) {
43 ar& make_nvp(n, s);
44}
45 template <class Archive>
46 inline void segments_serialize(Archive&, const char*,
47 Eigen::internal::empty_struct&) {}
48
49 template <class Archive, bool _allRows, bool _allCols>
50 inline void serialize(Archive& ar, Eigen::MatrixBlocks<_allRows, _allCols>& b,
51 const unsigned int version) {
52 (void)version;
53 ar& make_nvp("nbRows", b.m_nbRows);
54 ar& make_nvp("nbCols", b.m_nbCols);
55 segments_serialize(ar, "rows", b.m_rows);
56 segments_serialize(ar, "cols", b.m_cols);
57}
58} // namespace serialization
59} // namespace boost
60
61#endif // HPP_CONSTRAINTS_SERIALIZATION_HH
Eigen::MatrixBlocks
Definition matrix-view.hh:547
Eigen::MatrixBlocks::m_nbCols
size_type m_nbCols
Definition matrix-view.hh:696
Eigen::MatrixBlocks::m_cols
ColIndices_t m_cols
Definition matrix-view.hh:698
Eigen::MatrixBlocks::m_rows
RowIndices_t m_rows
Definition matrix-view.hh:697
Eigen::MatrixBlocks::m_nbRows
size_type m_nbRows
Definition matrix-view.hh:696
matrix-view.hh
boost::serialization::segments_serialize
void segments_serialize(Archive &ar, const char *n, Eigen::BlockIndex::segments_t &s)
Definition serialization.hh:41
boost::serialization::serialize
void serialize(Archive &ar, Eigen::MatrixBlocks< _allRows, _allCols > &b, const unsigned int version)
Definition serialization.hh:50
boost
Eigen::BlockIndex::segments_t
hpp::constraints::segments_t segments_t
vector of segments
Definition matrix-view.hh:55
Eigen::internal::empty_struct
Definition matrix-view.hh:168