Skip to content

Commit

Permalink
Fix abstract class serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 11, 2024
1 parent 4ef61aa commit 7bb7aec
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ NOTE: Must be a clean build when generating a code coverage report. Also must bu
This package leverages boost serialization. When adding new classes which may be inherited from and then serialized as the base type it is imported to add the following macros for the base type and all derived types.

- Header
- `BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_common::JointLimits) // Only if abstract`
- `BOOST_CLASS_EXPORT_KEY(tesseract_common::JointLimits)`
- Abstract Class
- `BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_common::JointLimits)`
- Non-Abstract Class
- `BOOST_CLASS_EXPORT_KEY(tesseract_common::JointLimits)`
- Cpp
- `BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::JointLimits)`

Expand Down
4 changes: 2 additions & 2 deletions tesseract_common/include/tesseract_common/resource_locator.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ class BytesResource : public tesseract_common::Resource

} // namespace tesseract_common
BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_common::ResourceLocator)
BOOST_CLASS_EXPORT_KEY(tesseract_common::ResourceLocator)
BOOST_CLASS_EXPORT_KEY(tesseract_common::Resource)
BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_common::Resource)

BOOST_CLASS_EXPORT_KEY(tesseract_common::GeneralResourceLocator)
BOOST_CLASS_EXPORT_KEY(tesseract_common::SimpleLocatedResource)
BOOST_CLASS_EXPORT_KEY(tesseract_common::BytesResource)
Expand Down
2 changes: 0 additions & 2 deletions tesseract_common/src/resource_locator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ void BytesResource::serialize(Archive& ar, const unsigned int /*version*/)
} // namespace tesseract_common

#include <tesseract_common/serialization.h>
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::ResourceLocator)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::Resource)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::GeneralResourceLocator)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::SimpleLocatedResource)
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_common::BytesResource)
Expand Down
1 change: 0 additions & 1 deletion tesseract_geometry/include/tesseract_geometry/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@ using GeometrysConst = std::vector<Geometry::ConstPtr>;
} // namespace tesseract_geometry

BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_geometry::Geometry)
BOOST_CLASS_EXPORT_KEY(tesseract_geometry::Geometry)

#endif // TESSERACT_GEOMETRY_GEOMETRY_H
1 change: 0 additions & 1 deletion tesseract_geometry/src/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ void Geometry::serialize(Archive& ar, const unsigned int /*version*/)
} // namespace tesseract_geometry

#include <tesseract_common/serialization.h>
BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_geometry::Geometry)
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(tesseract_geometry::Geometry)

0 comments on commit 7bb7aec

Please sign in to comment.