libmcell_dummy.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. // this is an empty implementation of some functions from libmcell
  12. // MCell executable (not mcell.so) references but not uses Callbacks class and other
  13. // functions and we do not want to link all the Python libraries it needs
  14. #include "api/reaction_info.h"
  15. #include "api/callbacks.h"
  16. #include "api/mol_wall_hit_info.h"
  17. #include "api/checkpoint_signals.h"
  18. #if PYTHON_VERSION == 39 && !defined(_MSC_VER)
  19. extern "C" {
  20. // including pybind11 with Python 3.9 requires this symbol, however, must not be used
  21. void __attribute__((weak)) _Py_Dealloc(PyObject*) {
  22. release_assert("must not be called");
  23. }
  24. }
  25. #endif
  26. namespace MCell {
  27. namespace API {
  28. void save_checkpoint_func(double, MCell::API::CheckpointSaveEventContext) {
  29. release_assert("must not be called");
  30. }
  31. Callbacks::Callbacks(Model*) {
  32. // empty
  33. }
  34. void Callbacks::do_mol_wall_hit_callbacks(std::shared_ptr<MolWallHitInfo>) {
  35. release_assert("must not be called");
  36. }
  37. // we also need some implementations for MolWallHitInfo
  38. bool GenMolWallHitInfo::__eq__(const MolWallHitInfo&) const {
  39. release_assert("must not be called");
  40. return false;
  41. }
  42. bool GenMolWallHitInfo::eq_nonarray_attributes(const MolWallHitInfo&, const bool) const {
  43. release_assert("must not be called");
  44. return false;
  45. }
  46. bool Callbacks::do_rxn_callback(std::shared_ptr<ReactionInfo>) {
  47. release_assert("must not be called");
  48. return false;
  49. }
  50. bool GenReactionInfo::__eq__(const ReactionInfo&) const {
  51. release_assert("must not be called");
  52. return false;
  53. }
  54. bool GenReactionInfo::eq_nonarray_attributes(const ReactionInfo&, const bool) const {
  55. release_assert("must not be called");
  56. return false;
  57. }
  58. } /* namespace API */
  59. } /* namespace MCell */