-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from bluescarni/pr/callable_fixes
Restore s11n capabilities for empty event and step callbacks
- Loading branch information
Showing
8 changed files
with
328 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#include <cstdint> | ||
|
||
#include <heyoka/callable.hpp> | ||
#include <heyoka/config.hpp> | ||
#include <heyoka/step_callback.hpp> | ||
#include <heyoka/taylor.hpp> | ||
|
||
#if defined(HEYOKA_HAVE_REAL128) | ||
|
||
#include <mp++/real128.hpp> | ||
|
||
#endif | ||
|
||
#if defined(HEYOKA_HAVE_REAL) | ||
|
||
#include <mp++/real.hpp> | ||
|
||
#endif | ||
|
||
// NOTE: this file contains the code for registering default-constructed | ||
// event and step callbacks in the serialisation system. | ||
|
||
// NOLINTBEGIN(cert-err58-cpp) | ||
|
||
// Scalar and batch event callbacks. | ||
#define HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(T) \ | ||
HEYOKA_S11N_CALLABLE_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, void, heyoka::taylor_adaptive<T> &, T, int) \ | ||
HEYOKA_S11N_CALLABLE_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, bool, heyoka::taylor_adaptive<T> &, bool, int) | ||
|
||
#define HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS(T) \ | ||
HEYOKA_S11N_CALLABLE_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, void, heyoka::taylor_adaptive_batch<T> &, T, \ | ||
int, std::uint32_t) \ | ||
HEYOKA_S11N_CALLABLE_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, bool, heyoka::taylor_adaptive_batch<T> &, \ | ||
bool, int, std::uint32_t) | ||
|
||
HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(float) | ||
HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(double) | ||
HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(long double) | ||
|
||
HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS(float) | ||
HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS(double) | ||
HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS(long double) | ||
|
||
#if defined(HEYOKA_HAVE_REAL128) | ||
|
||
HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(mppp::real128) | ||
HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS(mppp::real128) | ||
|
||
#endif | ||
|
||
#if defined(HEYOKA_HAVE_REAL) | ||
|
||
HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS(mppp::real) | ||
|
||
#endif | ||
|
||
#undef HEYOKA_S11N_IMPLEMENT_EVENT_CALLBACKS | ||
#undef HEYOKA_S11N_IMPLEMENT_BATCH_EVENT_CALLBACKS | ||
|
||
// Scalar and batch step callbacks. | ||
HEYOKA_S11N_STEP_CALLBACK_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, float) | ||
HEYOKA_S11N_STEP_CALLBACK_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, double) | ||
HEYOKA_S11N_STEP_CALLBACK_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, long double) | ||
|
||
HEYOKA_S11N_STEP_CALLBACK_BATCH_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, float) | ||
HEYOKA_S11N_STEP_CALLBACK_BATCH_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, double) | ||
HEYOKA_S11N_STEP_CALLBACK_BATCH_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, long double) | ||
|
||
#if defined(HEYOKA_HAVE_REAL128) | ||
|
||
HEYOKA_S11N_STEP_CALLBACK_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, mppp::real128) | ||
HEYOKA_S11N_STEP_CALLBACK_BATCH_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, mppp::real128) | ||
|
||
#endif | ||
|
||
#if defined(HEYOKA_HAVE_REAL) | ||
|
||
HEYOKA_S11N_STEP_CALLBACK_EXPORT_IMPLEMENT(heyoka::detail::empty_callable, mppp::real) | ||
|
||
#endif | ||
|
||
// NOLINTEND(cert-err58-cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.