xcoll 0.3.3__py3-none-any.whl → 0.3.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xcoll might be problematic. Click here for more details.

Files changed (317) hide show
  1. xcoll/beam_elements/__init__.py +5 -0
  2. xcoll/beam_elements/absorber.py +2 -1
  3. xcoll/beam_elements/base.py +32 -17
  4. xcoll/beam_elements/collimators_src/absorber.h +5 -0
  5. xcoll/beam_elements/everest.py +14 -25
  6. xcoll/colldb.py +50 -27
  7. xcoll/general.py +1 -1
  8. xcoll/headers/checks.h +7 -1
  9. xcoll/impacts/impacts.py +2 -1
  10. xcoll/impacts/impacts_src/impacts.h +1 -6
  11. xcoll/manager.py +5 -5
  12. xcoll/rf_sweep.py +90 -19
  13. xcoll/scattering_routines/everest/__init__.py +5 -0
  14. xcoll/scattering_routines/everest/everest.py +1 -1
  15. xcoll/scattering_routines/fluka/build_fluka_input.py +58 -0
  16. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  17. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
  18. xcoll/scattering_routines/fluka/flukaio/src/Connection.d +68 -48
  19. xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
  20. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +46 -37
  21. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
  22. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +28 -25
  23. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
  24. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +67 -47
  25. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
  26. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +39 -33
  27. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
  28. xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +66 -47
  29. xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
  30. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/METADATA +3 -2
  31. xcoll-0.3.5.dist-info/NOTICE +2 -0
  32. xcoll-0.3.5.dist-info/RECORD +111 -0
  33. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/WHEEL +1 -1
  34. xcoll/beam_elements/collimators_src/base_block.h +0 -14
  35. xcoll/beam_elements/collimators_src/base_collimator.h +0 -14
  36. xcoll/beam_elements/collimators_src/invalid_collimator.h +0 -15
  37. xcoll/install_collimators.py +0 -180
  38. xcoll/scattering_routines/geant4/collimasim/.git +0 -1
  39. xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
  40. xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
  41. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
  42. xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
  43. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
  44. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
  45. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
  46. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
  47. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
  48. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
  49. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
  50. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
  51. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
  52. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
  53. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
  54. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
  55. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
  281. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
  282. xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
  283. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
  284. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
  285. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -662
  286. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -110
  287. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
  288. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
  289. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
  290. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -475
  291. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
  292. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -20
  293. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
  296. xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
  297. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
  298. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
  299. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
  300. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
  301. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
  302. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
  303. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
  304. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
  305. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
  306. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
  307. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
  308. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
  309. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
  310. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
  311. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
  312. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
  313. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
  314. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
  315. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
  316. xcoll-0.3.3.dist-info/RECORD +0 -391
  317. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/LICENSE +0 -0
@@ -1,452 +0,0 @@
1
- /*
2
- tests/test_smart_ptr.cpp -- binding classes with custom reference counting,
3
- implicit conversions between types
4
-
5
- Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
6
-
7
- All rights reserved. Use of this source code is governed by a
8
- BSD-style license that can be found in the LICENSE file.
9
- */
10
-
11
- #if defined(_MSC_VER) && _MSC_VER < 1910 // VS 2015's MSVC
12
- # pragma warning(disable: 4702) // unreachable code in system header (xatomic.h(382))
13
- #endif
14
-
15
- #include "pybind11_tests.h"
16
- #include "object.h"
17
-
18
- namespace {
19
-
20
- // This is just a wrapper around unique_ptr, but with extra fields to deliberately bloat up the
21
- // holder size to trigger the non-simple-layout internal instance layout for single inheritance with
22
- // large holder type:
23
- template <typename T> class huge_unique_ptr {
24
- std::unique_ptr<T> ptr;
25
- uint64_t padding[10];
26
- public:
27
- explicit huge_unique_ptr(T *p) : ptr(p) {}
28
- T *get() { return ptr.get(); }
29
- };
30
-
31
- // Simple custom holder that works like unique_ptr
32
- template <typename T>
33
- class custom_unique_ptr {
34
- std::unique_ptr<T> impl;
35
- public:
36
- explicit custom_unique_ptr(T *p) : impl(p) {}
37
- T* get() const { return impl.get(); }
38
- T* release_ptr() { return impl.release(); }
39
- };
40
-
41
- // Simple custom holder that works like shared_ptr and has operator& overload
42
- // To obtain address of an instance of this holder pybind should use std::addressof
43
- // Attempt to get address via operator& may leads to segmentation fault
44
- template <typename T>
45
- class shared_ptr_with_addressof_operator {
46
- std::shared_ptr<T> impl;
47
- public:
48
- shared_ptr_with_addressof_operator( ) = default;
49
- explicit shared_ptr_with_addressof_operator(T *p) : impl(p) {}
50
- T* get() const { return impl.get(); }
51
- T** operator&() { throw std::logic_error("Call of overloaded operator& is not expected"); }
52
- };
53
-
54
- // Simple custom holder that works like unique_ptr and has operator& overload
55
- // To obtain address of an instance of this holder pybind should use std::addressof
56
- // Attempt to get address via operator& may leads to segmentation fault
57
- template <typename T>
58
- class unique_ptr_with_addressof_operator {
59
- std::unique_ptr<T> impl;
60
- public:
61
- unique_ptr_with_addressof_operator() = default;
62
- explicit unique_ptr_with_addressof_operator(T *p) : impl(p) {}
63
- T* get() const { return impl.get(); }
64
- T* release_ptr() { return impl.release(); }
65
- T** operator&() { throw std::logic_error("Call of overloaded operator& is not expected"); }
66
- };
67
-
68
- // Custom object with builtin reference counting (see 'object.h' for the implementation)
69
- class MyObject1 : public Object {
70
- public:
71
- explicit MyObject1(int value) : value(value) { print_created(this, toString()); }
72
- std::string toString() const override { return "MyObject1[" + std::to_string(value) + "]"; }
73
- protected:
74
- ~MyObject1() override { print_destroyed(this); }
75
- private:
76
- int value;
77
- };
78
-
79
- // Object managed by a std::shared_ptr<>
80
- class MyObject2 {
81
- public:
82
- MyObject2(const MyObject2 &) = default;
83
- explicit MyObject2(int value) : value(value) { print_created(this, toString()); }
84
- std::string toString() const { return "MyObject2[" + std::to_string(value) + "]"; }
85
- virtual ~MyObject2() { print_destroyed(this); }
86
- private:
87
- int value;
88
- };
89
-
90
- // Object managed by a std::shared_ptr<>, additionally derives from std::enable_shared_from_this<>
91
- class MyObject3 : public std::enable_shared_from_this<MyObject3> {
92
- public:
93
- MyObject3(const MyObject3 &) = default;
94
- explicit MyObject3(int value) : value(value) { print_created(this, toString()); }
95
- std::string toString() const { return "MyObject3[" + std::to_string(value) + "]"; }
96
- virtual ~MyObject3() { print_destroyed(this); }
97
- private:
98
- int value;
99
- };
100
-
101
- // test_unique_nodelete
102
- // Object with a private destructor
103
- class MyObject4;
104
- std::unordered_set<MyObject4 *> myobject4_instances;
105
- class MyObject4 {
106
- public:
107
- explicit MyObject4(int value) : value{value} {
108
- print_created(this);
109
- myobject4_instances.insert(this);
110
- }
111
- int value;
112
-
113
- static void cleanupAllInstances() {
114
- auto tmp = std::move(myobject4_instances);
115
- myobject4_instances.clear();
116
- for (auto o : tmp)
117
- delete o;
118
- }
119
- private:
120
- ~MyObject4() {
121
- myobject4_instances.erase(this);
122
- print_destroyed(this);
123
- }
124
- };
125
-
126
- // test_unique_deleter
127
- // Object with std::unique_ptr<T, D> where D is not matching the base class
128
- // Object with a protected destructor
129
- class MyObject4a;
130
- std::unordered_set<MyObject4a *> myobject4a_instances;
131
- class MyObject4a {
132
- public:
133
- explicit MyObject4a(int i) {
134
- value = i;
135
- print_created(this);
136
- myobject4a_instances.insert(this);
137
- };
138
- int value;
139
-
140
- static void cleanupAllInstances() {
141
- auto tmp = std::move(myobject4a_instances);
142
- myobject4a_instances.clear();
143
- for (auto o : tmp)
144
- delete o;
145
- }
146
- protected:
147
- virtual ~MyObject4a() {
148
- myobject4a_instances.erase(this);
149
- print_destroyed(this);
150
- }
151
- };
152
-
153
- // Object derived but with public destructor and no Deleter in default holder
154
- class MyObject4b : public MyObject4a {
155
- public:
156
- explicit MyObject4b(int i) : MyObject4a(i) { print_created(this); }
157
- ~MyObject4b() override { print_destroyed(this); }
158
- };
159
-
160
- // test_large_holder
161
- class MyObject5 { // managed by huge_unique_ptr
162
- public:
163
- explicit MyObject5(int value) : value{value} { print_created(this); }
164
- ~MyObject5() { print_destroyed(this); }
165
- int value;
166
- };
167
-
168
- // test_shared_ptr_and_references
169
- struct SharedPtrRef {
170
- struct A {
171
- A() { print_created(this); }
172
- A(const A &) { print_copy_created(this); }
173
- A(A &&) noexcept { print_move_created(this); }
174
- ~A() { print_destroyed(this); }
175
- };
176
-
177
- A value = {};
178
- std::shared_ptr<A> shared = std::make_shared<A>();
179
- };
180
-
181
- // test_shared_ptr_from_this_and_references
182
- struct SharedFromThisRef {
183
- struct B : std::enable_shared_from_this<B> {
184
- B() { print_created(this); }
185
- // NOLINTNEXTLINE(bugprone-copy-constructor-init)
186
- B(const B &) : std::enable_shared_from_this<B>() { print_copy_created(this); }
187
- B(B &&) noexcept : std::enable_shared_from_this<B>() { print_move_created(this); }
188
- ~B() { print_destroyed(this); }
189
- };
190
-
191
- B value = {};
192
- std::shared_ptr<B> shared = std::make_shared<B>();
193
- };
194
-
195
- // Issue #865: shared_from_this doesn't work with virtual inheritance
196
- struct SharedFromThisVBase : std::enable_shared_from_this<SharedFromThisVBase> {
197
- SharedFromThisVBase() = default;
198
- SharedFromThisVBase(const SharedFromThisVBase &) = default;
199
- virtual ~SharedFromThisVBase() = default;
200
- };
201
- struct SharedFromThisVirt : virtual SharedFromThisVBase {};
202
-
203
- // test_move_only_holder
204
- struct C {
205
- C() { print_created(this); }
206
- ~C() { print_destroyed(this); }
207
- };
208
-
209
- // test_holder_with_addressof_operator
210
- struct TypeForHolderWithAddressOf {
211
- TypeForHolderWithAddressOf() { print_created(this); }
212
- TypeForHolderWithAddressOf(const TypeForHolderWithAddressOf &) { print_copy_created(this); }
213
- TypeForHolderWithAddressOf(TypeForHolderWithAddressOf &&) noexcept {
214
- print_move_created(this);
215
- }
216
- ~TypeForHolderWithAddressOf() { print_destroyed(this); }
217
- std::string toString() const {
218
- return "TypeForHolderWithAddressOf[" + std::to_string(value) + "]";
219
- }
220
- int value = 42;
221
- };
222
-
223
- // test_move_only_holder_with_addressof_operator
224
- struct TypeForMoveOnlyHolderWithAddressOf {
225
- explicit TypeForMoveOnlyHolderWithAddressOf(int value) : value{value} { print_created(this); }
226
- ~TypeForMoveOnlyHolderWithAddressOf() { print_destroyed(this); }
227
- std::string toString() const {
228
- return "MoveOnlyHolderWithAddressOf[" + std::to_string(value) + "]";
229
- }
230
- int value;
231
- };
232
-
233
- // test_smart_ptr_from_default
234
- struct HeldByDefaultHolder { };
235
-
236
- // test_shared_ptr_gc
237
- // #187: issue involving std::shared_ptr<> return value policy & garbage collection
238
- struct ElementBase {
239
- virtual ~ElementBase() = default; /* Force creation of virtual table */
240
- ElementBase() = default;
241
- ElementBase(const ElementBase&) = delete;
242
- };
243
-
244
- struct ElementA : ElementBase {
245
- explicit ElementA(int v) : v(v) {}
246
- int value() const { return v; }
247
- int v;
248
- };
249
-
250
- struct ElementList {
251
- void add(const std::shared_ptr<ElementBase> &e) { l.push_back(e); }
252
- std::vector<std::shared_ptr<ElementBase>> l;
253
- };
254
-
255
- } // namespace
256
-
257
- // ref<T> is a wrapper for 'Object' which uses intrusive reference counting
258
- // It is always possible to construct a ref<T> from an Object* pointer without
259
- // possible inconsistencies, hence the 'true' argument at the end.
260
- // Make pybind11 aware of the non-standard getter member function
261
- namespace pybind11 { namespace detail {
262
- template <typename T>
263
- struct holder_helper<ref<T>> {
264
- static const T *get(const ref<T> &p) { return p.get_ptr(); }
265
- };
266
- } // namespace detail
267
- } // namespace pybind11
268
-
269
- // Make pybind aware of the ref-counted wrapper type (s):
270
- PYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true);
271
- // The following is not required anymore for std::shared_ptr, but it should compile without error:
272
- PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
273
- PYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>);
274
- PYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>);
275
- PYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>);
276
- PYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>);
277
-
278
- TEST_SUBMODULE(smart_ptr, m) {
279
- // Please do not interleave `struct` and `class` definitions with bindings code,
280
- // but implement `struct`s and `class`es in the anonymous namespace above.
281
- // This helps keeping the smart_holder branch in sync with master.
282
-
283
- // test_smart_ptr
284
-
285
- // Object implementation in `object.h`
286
- py::class_<Object, ref<Object>> obj(m, "Object");
287
- obj.def("getRefCount", &Object::getRefCount);
288
-
289
- py::class_<MyObject1, ref<MyObject1>>(m, "MyObject1", obj)
290
- .def(py::init<int>());
291
- py::implicitly_convertible<py::int_, MyObject1>();
292
-
293
- m.def("make_object_1", []() -> Object * { return new MyObject1(1); });
294
- m.def("make_object_2", []() -> ref<Object> { return ref<Object>(new MyObject1(2)); });
295
- m.def("make_myobject1_1", []() -> MyObject1 * { return new MyObject1(4); });
296
- m.def("make_myobject1_2", []() -> ref<MyObject1> { return ref<MyObject1>(new MyObject1(5)); });
297
- m.def("print_object_1", [](const Object *obj) { py::print(obj->toString()); });
298
- m.def("print_object_2", [](ref<Object> obj) { py::print(obj->toString()); });
299
- m.def("print_object_3", [](const ref<Object> &obj) { py::print(obj->toString()); });
300
- m.def("print_object_4", [](const ref<Object> *obj) { py::print((*obj)->toString()); });
301
- m.def("print_myobject1_1", [](const MyObject1 *obj) { py::print(obj->toString()); });
302
- m.def("print_myobject1_2", [](ref<MyObject1> obj) { py::print(obj->toString()); });
303
- m.def("print_myobject1_3", [](const ref<MyObject1> &obj) { py::print(obj->toString()); });
304
- m.def("print_myobject1_4", [](const ref<MyObject1> *obj) { py::print((*obj)->toString()); });
305
-
306
- // Expose constructor stats for the ref type
307
- m.def("cstats_ref", &ConstructorStats::get<ref_tag>);
308
-
309
- py::class_<MyObject2, std::shared_ptr<MyObject2>>(m, "MyObject2")
310
- .def(py::init<int>());
311
- m.def("make_myobject2_1", []() { return new MyObject2(6); });
312
- m.def("make_myobject2_2", []() { return std::make_shared<MyObject2>(7); });
313
- m.def("print_myobject2_1", [](const MyObject2 *obj) { py::print(obj->toString()); });
314
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
315
- m.def("print_myobject2_2", [](std::shared_ptr<MyObject2> obj) { py::print(obj->toString()); });
316
- m.def("print_myobject2_3", [](const std::shared_ptr<MyObject2> &obj) { py::print(obj->toString()); });
317
- m.def("print_myobject2_4", [](const std::shared_ptr<MyObject2> *obj) { py::print((*obj)->toString()); });
318
-
319
- py::class_<MyObject3, std::shared_ptr<MyObject3>>(m, "MyObject3")
320
- .def(py::init<int>());
321
- m.def("make_myobject3_1", []() { return new MyObject3(8); });
322
- m.def("make_myobject3_2", []() { return std::make_shared<MyObject3>(9); });
323
- m.def("print_myobject3_1", [](const MyObject3 *obj) { py::print(obj->toString()); });
324
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
325
- m.def("print_myobject3_2", [](std::shared_ptr<MyObject3> obj) { py::print(obj->toString()); });
326
- m.def("print_myobject3_3", [](const std::shared_ptr<MyObject3> &obj) { py::print(obj->toString()); });
327
- m.def("print_myobject3_4", [](const std::shared_ptr<MyObject3> *obj) { py::print((*obj)->toString()); });
328
-
329
- // test_smart_ptr_refcounting
330
- m.def("test_object1_refcounting", []() {
331
- auto o = ref<MyObject1>(new MyObject1(0));
332
- bool good = o->getRefCount() == 1;
333
- py::object o2 = py::cast(o, py::return_value_policy::reference);
334
- // always request (partial) ownership for objects with intrusive
335
- // reference counting even when using the 'reference' RVP
336
- good &= o->getRefCount() == 2;
337
- return good;
338
- });
339
-
340
- // test_unique_nodelete
341
- py::class_<MyObject4, std::unique_ptr<MyObject4, py::nodelete>>(m, "MyObject4")
342
- .def(py::init<int>())
343
- .def_readwrite("value", &MyObject4::value)
344
- .def_static("cleanup_all_instances", &MyObject4::cleanupAllInstances);
345
-
346
- // test_unique_deleter
347
- py::class_<MyObject4a, std::unique_ptr<MyObject4a, py::nodelete>>(m, "MyObject4a")
348
- .def(py::init<int>())
349
- .def_readwrite("value", &MyObject4a::value)
350
- .def_static("cleanup_all_instances", &MyObject4a::cleanupAllInstances);
351
-
352
- py::class_<MyObject4b, MyObject4a, std::unique_ptr<MyObject4b>>(m, "MyObject4b")
353
- .def(py::init<int>());
354
-
355
- // test_large_holder
356
- py::class_<MyObject5, huge_unique_ptr<MyObject5>>(m, "MyObject5")
357
- .def(py::init<int>())
358
- .def_readwrite("value", &MyObject5::value);
359
-
360
- // test_shared_ptr_and_references
361
- using A = SharedPtrRef::A;
362
- py::class_<A, std::shared_ptr<A>>(m, "A");
363
- py::class_<SharedPtrRef, std::unique_ptr<SharedPtrRef>>(m, "SharedPtrRef")
364
- .def(py::init<>())
365
- .def_readonly("ref", &SharedPtrRef::value)
366
- .def_property_readonly(
367
- "copy", [](const SharedPtrRef &s) { return s.value; }, py::return_value_policy::copy)
368
- .def_readonly("holder_ref", &SharedPtrRef::shared)
369
- .def_property_readonly(
370
- "holder_copy",
371
- [](const SharedPtrRef &s) { return s.shared; },
372
- py::return_value_policy::copy)
373
- .def("set_ref", [](SharedPtrRef &, const A &) { return true; })
374
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
375
- .def("set_holder", [](SharedPtrRef &, std::shared_ptr<A>) { return true; });
376
-
377
- // test_shared_ptr_from_this_and_references
378
- using B = SharedFromThisRef::B;
379
- py::class_<B, std::shared_ptr<B>>(m, "B");
380
- py::class_<SharedFromThisRef, std::unique_ptr<SharedFromThisRef>>(m, "SharedFromThisRef")
381
- .def(py::init<>())
382
- .def_readonly("bad_wp", &SharedFromThisRef::value)
383
- .def_property_readonly("ref",
384
- [](const SharedFromThisRef &s) -> const B & { return *s.shared; })
385
- .def_property_readonly(
386
- "copy",
387
- [](const SharedFromThisRef &s) { return s.value; },
388
- py::return_value_policy::copy)
389
- .def_readonly("holder_ref", &SharedFromThisRef::shared)
390
- .def_property_readonly(
391
- "holder_copy",
392
- [](const SharedFromThisRef &s) { return s.shared; },
393
- py::return_value_policy::copy)
394
- .def("set_ref", [](SharedFromThisRef &, const B &) { return true; })
395
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
396
- .def("set_holder", [](SharedFromThisRef &, std::shared_ptr<B>) { return true; });
397
-
398
- // Issue #865: shared_from_this doesn't work with virtual inheritance
399
- static std::shared_ptr<SharedFromThisVirt> sft(new SharedFromThisVirt());
400
- py::class_<SharedFromThisVirt, std::shared_ptr<SharedFromThisVirt>>(m, "SharedFromThisVirt")
401
- .def_static("get", []() { return sft.get(); });
402
-
403
- // test_move_only_holder
404
- py::class_<C, custom_unique_ptr<C>>(m, "TypeWithMoveOnlyHolder")
405
- .def_static("make", []() { return custom_unique_ptr<C>(new C); })
406
- .def_static("make_as_object", []() { return py::cast(custom_unique_ptr<C>(new C)); });
407
-
408
- // test_holder_with_addressof_operator
409
- using HolderWithAddressOf = shared_ptr_with_addressof_operator<TypeForHolderWithAddressOf>;
410
- py::class_<TypeForHolderWithAddressOf, HolderWithAddressOf>(m, "TypeForHolderWithAddressOf")
411
- .def_static("make", []() { return HolderWithAddressOf(new TypeForHolderWithAddressOf); })
412
- .def("get", [](const HolderWithAddressOf &self) { return self.get(); })
413
- .def("print_object_1",
414
- [](const TypeForHolderWithAddressOf *obj) { py::print(obj->toString()); })
415
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
416
- .def("print_object_2", [](HolderWithAddressOf obj) { py::print(obj.get()->toString()); })
417
- .def("print_object_3",
418
- [](const HolderWithAddressOf &obj) { py::print(obj.get()->toString()); })
419
- .def("print_object_4",
420
- [](const HolderWithAddressOf *obj) { py::print((*obj).get()->toString()); });
421
-
422
- // test_move_only_holder_with_addressof_operator
423
- using MoveOnlyHolderWithAddressOf = unique_ptr_with_addressof_operator<TypeForMoveOnlyHolderWithAddressOf>;
424
- py::class_<TypeForMoveOnlyHolderWithAddressOf, MoveOnlyHolderWithAddressOf>(m, "TypeForMoveOnlyHolderWithAddressOf")
425
- .def_static("make", []() { return MoveOnlyHolderWithAddressOf(new TypeForMoveOnlyHolderWithAddressOf(0)); })
426
- .def_readwrite("value", &TypeForMoveOnlyHolderWithAddressOf::value)
427
- .def("print_object", [](const TypeForMoveOnlyHolderWithAddressOf *obj) { py::print(obj->toString()); });
428
-
429
- // test_smart_ptr_from_default
430
- py::class_<HeldByDefaultHolder, std::unique_ptr<HeldByDefaultHolder>>(m, "HeldByDefaultHolder")
431
- .def(py::init<>())
432
- // NOLINTNEXTLINE(performance-unnecessary-value-param)
433
- .def_static("load_shared_ptr", [](std::shared_ptr<HeldByDefaultHolder>) {});
434
-
435
- // test_shared_ptr_gc
436
- // #187: issue involving std::shared_ptr<> return value policy & garbage collection
437
- py::class_<ElementBase, std::shared_ptr<ElementBase>>(m, "ElementBase");
438
-
439
- py::class_<ElementA, ElementBase, std::shared_ptr<ElementA>>(m, "ElementA")
440
- .def(py::init<int>())
441
- .def("value", &ElementA::value);
442
-
443
- py::class_<ElementList, std::shared_ptr<ElementList>>(m, "ElementList")
444
- .def(py::init<>())
445
- .def("add", &ElementList::add)
446
- .def("get", [](ElementList &el) {
447
- py::list list;
448
- for (auto &e : el.l)
449
- list.append(py::cast(e));
450
- return list;
451
- });
452
- }