Skip to content

Commit

Permalink
Update RTTI macros for upcoming MRPT 2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 11, 2024
1 parent 32a7617 commit 062f95f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
13 changes: 9 additions & 4 deletions mola_kernel/include/mola_kernel/entities/EntityBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <mola_kernel/id.h>
#include <mrpt/core/Clock.h>
#include <mrpt/serialization/CSerializable.h>
#include <mrpt/version.h>

#include <map>

Expand All @@ -32,15 +33,19 @@ using annotations_data_t = std::map<std::string, LazyLoadResource>;
*/
class EntityBase : public mrpt::serialization::CSerializable
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_SERIALIZABLE(EntityBase);
#else
DEFINE_VIRTUAL_SERIALIZABLE(EntityBase, mola);
#endif

public:
EntityBase();
virtual ~EntityBase();

/** The unique ID of this entity in the world model.
* Stored here for convenience, notice that it is redundant since entities
* are already stored in the WorldModel indexed by ID.
* Stored here for convenience, notice that it is redundant since
* entities are already stored in the WorldModel indexed by ID.
*/
mola::id_t my_id_{mola::INVALID_ID};

Expand All @@ -55,8 +60,8 @@ class EntityBase : public mrpt::serialization::CSerializable
bool is_unloaded() const;

protected:
// Derived classes mus call these methods to serialize the common data in
// this base class:
// Derived classes mus call these methods to serialize the common data
// in this base class:
void baseSerializeTo(mrpt::serialization::CArchive& out) const;
void baseSerializeFrom(mrpt::serialization::CArchive& in);
};
Expand Down
5 changes: 5 additions & 0 deletions mola_kernel/include/mola_kernel/factors/FactorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <mola_kernel/id.h>
#include <mrpt/serialization/CSerializable.h>
#include <mrpt/version.h>

namespace mola
{
Expand All @@ -35,7 +36,11 @@ enum class Robust : uint8_t
*/
class FactorBase : public mrpt::serialization::CSerializable
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_SERIALIZABLE(FactorBase)
#else
DEFINE_VIRTUAL_SERIALIZABLE(FactorBase, mola)
#endif

public:
FactorBase() = default;
Expand Down
5 changes: 5 additions & 0 deletions mola_kernel/include/mola_kernel/interfaces/BackEndBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <mrpt/img/TCamera.h> // TODO: Remove after unused below
#include <mrpt/math/CMatrixFixed.h>
#include <mrpt/obs/CSensoryFrame.h>
#include <mrpt/version.h>

#include <future>
#include <optional>
Expand All @@ -32,7 +33,11 @@ namespace mola
* \ingroup mola_kernel_grp */
class BackEndBase : public ExecutableBase
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_MRPT_OBJECT(BackEndBase)
#else
DEFINE_VIRTUAL_MRPT_OBJECT(BackEndBase, mola)
#endif

public:
BackEndBase();
Expand Down
5 changes: 5 additions & 0 deletions mola_kernel/include/mola_kernel/interfaces/ExecutableBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <mrpt/rtti/CObject.h>
#include <mrpt/system/COutputLogger.h>
#include <mrpt/system/CTimeLogger.h>
#include <mrpt/version.h>

#include <functional>
#include <memory>
Expand All @@ -36,7 +37,11 @@ class ExecutableBase : public mrpt::system::COutputLogger, // for logging
std::enable_shared_from_this<ExecutableBase>
{
// This macro defines `Ptr=shared_ptr<T>`, among other types and methods.
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_MRPT_OBJECT(ExecutableBase)
#else
DEFINE_VIRTUAL_MRPT_OBJECT(ExecutableBase, mola)
#endif

public:
ExecutableBase();
Expand Down
6 changes: 5 additions & 1 deletion mola_kernel/include/mola_kernel/interfaces/FilterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <mola_kernel/interfaces/RawDataSourceBase.h>
#include <mrpt/core/WorkerThreadsPool.h>
#include <mrpt/system/COutputLogger.h>
#include <mrpt/version.h>

namespace mola
{
Expand All @@ -24,8 +25,11 @@ namespace mola
* \ingroup mola_kernel_grp */
class FilterBase : public RawDataSourceBase, RawDataConsumer
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_MRPT_OBJECT(FilterBase)

#else
DEFINE_VIRTUAL_MRPT_OBJECT(FilterBase, mola)
#endif
public:
FilterBase();

Expand Down
5 changes: 5 additions & 0 deletions mola_kernel/include/mola_kernel/interfaces/FrontEndBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <mola_kernel/interfaces/ExecutableBase.h>
#include <mola_kernel/interfaces/RawDataConsumer.h>
#include <mola_kernel/interfaces/VizInterface.h>
#include <mrpt/version.h>

namespace mola
{
Expand All @@ -33,7 +34,11 @@ namespace mola
* \ingroup mola_kernel_grp */
class FrontEndBase : public ExecutableBase, public RawDataConsumer
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_MRPT_OBJECT(FrontEndBase)
#else
DEFINE_VIRTUAL_MRPT_OBJECT(FrontEndBase, mola)
#endif

public:
FrontEndBase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <mrpt/core/pimpl.h>
#include <mrpt/io/CFileGZOutputStream.h>
#include <mrpt/obs/CObservation.h>
#include <mrpt/version.h>

namespace mola
{
Expand All @@ -29,7 +30,11 @@ using timestep_t = std::size_t;
* parsers,...) \ingroup mola_kernel_grp */
class RawDataSourceBase : public mola::ExecutableBase
{
#if MRPT_VERSION < 0x020e00
DEFINE_VIRTUAL_MRPT_OBJECT(RawDataSourceBase)
#else
DEFINE_VIRTUAL_MRPT_OBJECT(RawDataSourceBase, mola)
#endif

public:
RawDataSourceBase();
Expand Down

0 comments on commit 062f95f

Please sign in to comment.