@dittolive/ditto 4.5.0 → 4.5.1-experimental.aarch64-linux.1.aarch64

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.
Files changed (289) hide show
  1. package/README.md +2 -2
  2. package/node/ditto.cjs.js +2 -9620
  3. package/node/{ditto.linux-x64.node → ditto.linux-arm64.node} +0 -0
  4. package/package.json +38 -34
  5. package/types/ditto.d.ts +0 -2
  6. package/web/ditto.es6.js +1 -1
  7. package/web/ditto.umd.js +1 -1
  8. package/web/ditto.wasm +0 -0
  9. package/DittoReactNative.podspec +0 -27
  10. package/node/ditto.darwin-arm64.node +0 -0
  11. package/node/ditto.darwin-x64.node +0 -0
  12. package/node/ditto.linux-arm.node +0 -0
  13. package/node/ditto.win32-x64.node +0 -0
  14. package/node/transports.darwin-arm64.node +0 -0
  15. package/node/transports.darwin-x64.node +0 -0
  16. package/react-native/android/CMakeLists.txt +0 -37
  17. package/react-native/android/build.gradle +0 -203
  18. package/react-native/android/cpp-adapter.cpp +0 -254
  19. package/react-native/android/gradle.properties +0 -5
  20. package/react-native/android/src/main/AndroidManifest.xml +0 -4
  21. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +0 -85
  22. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +0 -28
  23. package/react-native/boost/boost/assert.hpp +0 -85
  24. package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
  25. package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
  26. package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
  27. package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
  28. package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
  29. package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
  30. package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
  31. package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
  32. package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
  33. package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
  34. package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
  35. package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
  36. package/react-native/boost/boost/config/auto_link.hpp +0 -525
  37. package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
  38. package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
  39. package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
  40. package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
  41. package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
  42. package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
  43. package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
  44. package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
  45. package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
  46. package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
  47. package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
  48. package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
  49. package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
  50. package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
  51. package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
  52. package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
  53. package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
  54. package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
  55. package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
  56. package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
  57. package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
  58. package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
  59. package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
  60. package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
  61. package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
  62. package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
  63. package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
  64. package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
  65. package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
  66. package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
  67. package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
  68. package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
  69. package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
  70. package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
  71. package/react-native/boost/boost/config/helper_macros.hpp +0 -37
  72. package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
  73. package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
  74. package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
  75. package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
  76. package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
  77. package/react-native/boost/boost/config/platform/aix.hpp +0 -33
  78. package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
  79. package/react-native/boost/boost/config/platform/beos.hpp +0 -26
  80. package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
  81. package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
  82. package/react-native/boost/boost/config/platform/cray.hpp +0 -18
  83. package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
  84. package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
  85. package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
  86. package/react-native/boost/boost/config/platform/irix.hpp +0 -31
  87. package/react-native/boost/boost/config/platform/linux.hpp +0 -106
  88. package/react-native/boost/boost/config/platform/macos.hpp +0 -87
  89. package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
  90. package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
  91. package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
  92. package/react-native/boost/boost/config/platform/vms.hpp +0 -25
  93. package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
  94. package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
  95. package/react-native/boost/boost/config/platform/win32.hpp +0 -90
  96. package/react-native/boost/boost/config/platform/zos.hpp +0 -32
  97. package/react-native/boost/boost/config/pragma_message.hpp +0 -31
  98. package/react-native/boost/boost/config/requires_threads.hpp +0 -92
  99. package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
  100. package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
  101. package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
  102. package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
  103. package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
  104. package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
  105. package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
  106. package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
  107. package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
  108. package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
  109. package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
  110. package/react-native/boost/boost/config/user.hpp +0 -133
  111. package/react-native/boost/boost/config/warning_disable.hpp +0 -47
  112. package/react-native/boost/boost/config/workaround.hpp +0 -305
  113. package/react-native/boost/boost/config.hpp +0 -67
  114. package/react-native/boost/boost/cstdint.hpp +0 -556
  115. package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
  116. package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
  117. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
  118. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
  119. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
  120. package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
  121. package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
  122. package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
  123. package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
  124. package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
  125. package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
  126. package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
  127. package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
  128. package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
  129. package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
  130. package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
  131. package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
  132. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
  133. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
  134. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
  135. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
  136. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
  137. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
  138. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
  139. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
  140. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
  141. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
  142. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
  143. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
  144. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
  145. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
  146. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
  147. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
  148. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
  149. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
  150. package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
  151. package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
  152. package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
  153. package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
  154. package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
  155. package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
  156. package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
  157. package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
  158. package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
  159. package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
  160. package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
  161. package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
  162. package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
  163. package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
  164. package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
  165. package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
  166. package/react-native/cpp/include/Attachment.h +0 -16
  167. package/react-native/cpp/include/Authentication.h +0 -23
  168. package/react-native/cpp/include/Collection.h +0 -13
  169. package/react-native/cpp/include/DQL.h +0 -21
  170. package/react-native/cpp/include/Document.h +0 -17
  171. package/react-native/cpp/include/Identity.h +0 -17
  172. package/react-native/cpp/include/Lifecycle.h +0 -16
  173. package/react-native/cpp/include/LiveQuery.h +0 -17
  174. package/react-native/cpp/include/Logger.h +0 -22
  175. package/react-native/cpp/include/Misc.h +0 -26
  176. package/react-native/cpp/include/Presence.h +0 -14
  177. package/react-native/cpp/include/RetainableState.h +0 -24
  178. package/react-native/cpp/include/SmallPeerInfo.h +0 -17
  179. package/react-native/cpp/include/Transports.h +0 -25
  180. package/react-native/cpp/include/TypedArray.hpp +0 -167
  181. package/react-native/cpp/include/Utils.h +0 -61
  182. package/react-native/cpp/include/main.h +0 -10
  183. package/react-native/cpp/src/Attachment.cpp +0 -86
  184. package/react-native/cpp/src/Authentication.cpp +0 -224
  185. package/react-native/cpp/src/Collection.cpp +0 -54
  186. package/react-native/cpp/src/DQL.cpp +0 -254
  187. package/react-native/cpp/src/Document.cpp +0 -146
  188. package/react-native/cpp/src/Identity.cpp +0 -123
  189. package/react-native/cpp/src/Lifecycle.cpp +0 -75
  190. package/react-native/cpp/src/LiveQuery.cpp +0 -64
  191. package/react-native/cpp/src/Logger.cpp +0 -200
  192. package/react-native/cpp/src/Misc.cpp +0 -271
  193. package/react-native/cpp/src/Presence.cpp +0 -77
  194. package/react-native/cpp/src/RetainableState.cpp +0 -15
  195. package/react-native/cpp/src/SmallPeerInfo.cpp +0 -108
  196. package/react-native/cpp/src/Transports.cpp +0 -270
  197. package/react-native/cpp/src/TypedArray.cpp +0 -303
  198. package/react-native/cpp/src/Utils.cpp +0 -138
  199. package/react-native/cpp/src/main.cpp +0 -149
  200. package/react-native/dittoffi/dittoffi.h +0 -4698
  201. package/react-native/dittoffi/ifaddrs.cpp +0 -385
  202. package/react-native/dittoffi/ifaddrs.h +0 -206
  203. package/react-native/ios/DittoRNSDK.h +0 -7
  204. package/react-native/ios/DittoRNSDK.mm +0 -107
  205. package/react-native/ios/YeetJSIUtils.h +0 -60
  206. package/react-native/ios/YeetJSIUtils.mm +0 -196
  207. package/react-native/lib/commonjs/ditto.rn.js +0 -93
  208. package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
  209. package/react-native/lib/commonjs/index.js +0 -14
  210. package/react-native/lib/commonjs/index.js.map +0 -1
  211. package/react-native/lib/module/ditto.rn.js +0 -83
  212. package/react-native/lib/module/ditto.rn.js.map +0 -1
  213. package/react-native/lib/module/index.js +0 -13
  214. package/react-native/lib/module/index.js.map +0 -1
  215. package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
  216. package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
  217. package/react-native/lib/typescript/index.d.ts +0 -1
  218. package/react-native/lib/typescript/index.d.ts.map +0 -1
  219. package/react-native/scripts/ruby/include_local_boost.rb +0 -78
  220. package/react-native/src/ditto.rn.ts +0 -91
  221. package/react-native/src/environment/environment.fallback.ts +0 -4
  222. package/react-native/src/index.ts +0 -26
  223. package/react-native/src/sources/@cbor-redux.ts +0 -2
  224. package/react-native/src/sources/@ditto.core.ts +0 -1
  225. package/react-native/src/sources/@environment.ts +0 -2
  226. package/react-native/src/sources/attachment-fetch-event.ts +0 -54
  227. package/react-native/src/sources/attachment-fetcher-manager.ts +0 -129
  228. package/react-native/src/sources/attachment-fetcher.ts +0 -124
  229. package/react-native/src/sources/attachment-token.ts +0 -48
  230. package/react-native/src/sources/attachment.ts +0 -59
  231. package/react-native/src/sources/augment.ts +0 -89
  232. package/react-native/src/sources/authenticator.ts +0 -314
  233. package/react-native/src/sources/base-pending-cursor-operation.ts +0 -237
  234. package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -109
  235. package/react-native/src/sources/bridge.ts +0 -549
  236. package/react-native/src/sources/build-time-constants.ts +0 -4
  237. package/react-native/src/sources/cbor.ts +0 -35
  238. package/react-native/src/sources/collection-interface.ts +0 -67
  239. package/react-native/src/sources/collection.ts +0 -212
  240. package/react-native/src/sources/collections-event.ts +0 -99
  241. package/react-native/src/sources/counter.ts +0 -77
  242. package/react-native/src/sources/ditto.ts +0 -945
  243. package/react-native/src/sources/document-id.ts +0 -159
  244. package/react-native/src/sources/document-path.ts +0 -303
  245. package/react-native/src/sources/document.ts +0 -192
  246. package/react-native/src/sources/epilogue.ts +0 -24
  247. package/react-native/src/sources/error-codes.ts +0 -52
  248. package/react-native/src/sources/error.ts +0 -203
  249. package/react-native/src/sources/essentials.ts +0 -53
  250. package/react-native/src/sources/ffi-error.ts +0 -117
  251. package/react-native/src/sources/ffi.ts +0 -1972
  252. package/react-native/src/sources/identity.ts +0 -163
  253. package/react-native/src/sources/init.ts +0 -70
  254. package/react-native/src/sources/internal.ts +0 -113
  255. package/react-native/src/sources/keep-alive.ts +0 -69
  256. package/react-native/src/sources/key-path.ts +0 -195
  257. package/react-native/src/sources/live-query-event.ts +0 -208
  258. package/react-native/src/sources/live-query-manager.ts +0 -101
  259. package/react-native/src/sources/live-query.ts +0 -164
  260. package/react-native/src/sources/logger.ts +0 -196
  261. package/react-native/src/sources/observer-manager.ts +0 -175
  262. package/react-native/src/sources/observer.ts +0 -77
  263. package/react-native/src/sources/pending-collections-operation.ts +0 -232
  264. package/react-native/src/sources/pending-cursor-operation.ts +0 -218
  265. package/react-native/src/sources/pending-id-specific-operation.ts +0 -216
  266. package/react-native/src/sources/presence-manager.ts +0 -160
  267. package/react-native/src/sources/presence.ts +0 -238
  268. package/react-native/src/sources/query-result-item.ts +0 -116
  269. package/react-native/src/sources/query-result.ts +0 -55
  270. package/react-native/src/sources/register.ts +0 -92
  271. package/react-native/src/sources/small-peer-info.ts +0 -176
  272. package/react-native/src/sources/static-tcp-client.ts +0 -6
  273. package/react-native/src/sources/store-observer.ts +0 -176
  274. package/react-native/src/sources/store.ts +0 -365
  275. package/react-native/src/sources/subscription-manager.ts +0 -98
  276. package/react-native/src/sources/subscription.ts +0 -88
  277. package/react-native/src/sources/sync-subscription.ts +0 -90
  278. package/react-native/src/sources/sync.ts +0 -495
  279. package/react-native/src/sources/test-helpers.ts +0 -24
  280. package/react-native/src/sources/transport-conditions-manager.ts +0 -104
  281. package/react-native/src/sources/transport-config.ts +0 -428
  282. package/react-native/src/sources/update-result.ts +0 -66
  283. package/react-native/src/sources/update-results-map.ts +0 -57
  284. package/react-native/src/sources/websocket-client.ts +0 -6
  285. package/react-native/src/sources/write-transaction-collection.ts +0 -122
  286. package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
  287. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -72
  288. package/react-native/src/sources/write-transaction.ts +0 -119
  289. package/react-native.config.js +0 -9
@@ -1,707 +0,0 @@
1
- #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
2
- #define BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
3
-
4
- // MS compatible compilers support #pragma once
5
-
6
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
7
- # pragma once
8
- #endif
9
-
10
- //
11
- // detail/shared_count.hpp
12
- //
13
- // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
14
- // Copyright 2004-2005 Peter Dimov
15
- //
16
- // Distributed under the Boost Software License, Version 1.0. (See
17
- // accompanying file LICENSE_1_0.txt or copy at
18
- // http://www.boost.org/LICENSE_1_0.txt)
19
- //
20
-
21
- #if defined(__BORLANDC__) && !defined(__clang__)
22
- # pragma warn -8027 // Functions containing try are not expanded inline
23
- #endif
24
-
25
- #include <boost/smart_ptr/bad_weak_ptr.hpp>
26
- #include <boost/smart_ptr/detail/sp_counted_base.hpp>
27
- #include <boost/smart_ptr/detail/sp_counted_impl.hpp>
28
- #include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
29
- #include <boost/smart_ptr/detail/sp_noexcept.hpp>
30
- #include <boost/core/checked_delete.hpp>
31
- #include <boost/throw_exception.hpp>
32
- #include <boost/core/addressof.hpp>
33
- #include <boost/config.hpp>
34
- #include <boost/config/workaround.hpp>
35
- #include <boost/cstdint.hpp>
36
- #include <memory> // std::auto_ptr
37
- #include <functional> // std::less
38
- #include <cstddef> // std::size_t
39
-
40
- #ifdef BOOST_NO_EXCEPTIONS
41
- # include <new> // std::bad_alloc
42
- #endif
43
-
44
- #if defined( BOOST_SP_DISABLE_DEPRECATED )
45
- #pragma GCC diagnostic push
46
- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
47
- #endif
48
-
49
- namespace boost
50
- {
51
-
52
- namespace movelib
53
- {
54
-
55
- template< class T, class D > class unique_ptr;
56
-
57
- } // namespace movelib
58
-
59
- namespace detail
60
- {
61
-
62
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
63
-
64
- int const shared_count_id = 0x2C35F101;
65
- int const weak_count_id = 0x298C38A4;
66
-
67
- #endif
68
-
69
- struct sp_nothrow_tag {};
70
-
71
- template< class D > struct sp_inplace_tag
72
- {
73
- };
74
-
75
- template< class T > class sp_reference_wrapper
76
- {
77
- public:
78
-
79
- explicit sp_reference_wrapper( T & t): t_( boost::addressof( t ) )
80
- {
81
- }
82
-
83
- template< class Y > void operator()( Y * p ) const
84
- {
85
- (*t_)( p );
86
- }
87
-
88
- private:
89
-
90
- T * t_;
91
- };
92
-
93
- template< class D > struct sp_convert_reference
94
- {
95
- typedef D type;
96
- };
97
-
98
- template< class D > struct sp_convert_reference< D& >
99
- {
100
- typedef sp_reference_wrapper< D > type;
101
- };
102
-
103
- template<class T> std::size_t sp_hash_pointer( T* p ) BOOST_NOEXCEPT
104
- {
105
- boost::uintptr_t v = reinterpret_cast<boost::uintptr_t>( p );
106
-
107
- // match boost::hash<T*>
108
- return static_cast<std::size_t>( v + ( v >> 3 ) );
109
- }
110
-
111
- class weak_count;
112
-
113
- class shared_count
114
- {
115
- private:
116
-
117
- sp_counted_base * pi_;
118
-
119
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
120
- int id_;
121
- #endif
122
-
123
- friend class weak_count;
124
-
125
- public:
126
-
127
- BOOST_CONSTEXPR shared_count() BOOST_SP_NOEXCEPT: pi_(0)
128
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
129
- , id_(shared_count_id)
130
- #endif
131
- {
132
- }
133
-
134
- BOOST_CONSTEXPR explicit shared_count( sp_counted_base * pi ) BOOST_SP_NOEXCEPT: pi_( pi )
135
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
136
- , id_(shared_count_id)
137
- #endif
138
- {
139
- }
140
-
141
- template<class Y> explicit shared_count( Y * p ): pi_( 0 )
142
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
143
- , id_(shared_count_id)
144
- #endif
145
- {
146
- #ifndef BOOST_NO_EXCEPTIONS
147
-
148
- try
149
- {
150
- pi_ = new sp_counted_impl_p<Y>( p );
151
- }
152
- catch(...)
153
- {
154
- boost::checked_delete( p );
155
- throw;
156
- }
157
-
158
- #else
159
-
160
- pi_ = new sp_counted_impl_p<Y>( p );
161
-
162
- if( pi_ == 0 )
163
- {
164
- boost::checked_delete( p );
165
- boost::throw_exception( std::bad_alloc() );
166
- }
167
-
168
- #endif
169
- }
170
-
171
- #if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 )
172
- template<class Y, class D> shared_count( Y * p, D d ): pi_(0)
173
- #else
174
- template<class P, class D> shared_count( P p, D d ): pi_(0)
175
- #endif
176
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
177
- , id_(shared_count_id)
178
- #endif
179
- {
180
- #if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 )
181
- typedef Y* P;
182
- #endif
183
- #ifndef BOOST_NO_EXCEPTIONS
184
-
185
- try
186
- {
187
- pi_ = new sp_counted_impl_pd<P, D>(p, d);
188
- }
189
- catch(...)
190
- {
191
- d(p); // delete p
192
- throw;
193
- }
194
-
195
- #else
196
-
197
- pi_ = new sp_counted_impl_pd<P, D>(p, d);
198
-
199
- if(pi_ == 0)
200
- {
201
- d(p); // delete p
202
- boost::throw_exception(std::bad_alloc());
203
- }
204
-
205
- #endif
206
- }
207
-
208
- #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
209
-
210
- template< class P, class D > shared_count( P p, sp_inplace_tag<D> ): pi_( 0 )
211
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
212
- , id_(shared_count_id)
213
- #endif
214
- {
215
- #ifndef BOOST_NO_EXCEPTIONS
216
-
217
- try
218
- {
219
- pi_ = new sp_counted_impl_pd< P, D >( p );
220
- }
221
- catch( ... )
222
- {
223
- D::operator_fn( p ); // delete p
224
- throw;
225
- }
226
-
227
- #else
228
-
229
- pi_ = new sp_counted_impl_pd< P, D >( p );
230
-
231
- if( pi_ == 0 )
232
- {
233
- D::operator_fn( p ); // delete p
234
- boost::throw_exception( std::bad_alloc() );
235
- }
236
-
237
- #endif // #ifndef BOOST_NO_EXCEPTIONS
238
- }
239
-
240
- #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
241
-
242
- template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 )
243
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
244
- , id_(shared_count_id)
245
- #endif
246
- {
247
- typedef sp_counted_impl_pda<P, D, A> impl_type;
248
-
249
- #if !defined( BOOST_NO_CXX11_ALLOCATOR )
250
-
251
- typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2;
252
-
253
- #else
254
-
255
- typedef typename A::template rebind< impl_type >::other A2;
256
-
257
- #endif
258
-
259
- A2 a2( a );
260
-
261
- #ifndef BOOST_NO_EXCEPTIONS
262
-
263
- try
264
- {
265
- pi_ = a2.allocate( 1 );
266
- ::new( static_cast< void* >( pi_ ) ) impl_type( p, d, a );
267
- }
268
- catch(...)
269
- {
270
- d( p );
271
-
272
- if( pi_ != 0 )
273
- {
274
- a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
275
- }
276
-
277
- throw;
278
- }
279
-
280
- #else
281
-
282
- pi_ = a2.allocate( 1 );
283
-
284
- if( pi_ != 0 )
285
- {
286
- ::new( static_cast< void* >( pi_ ) ) impl_type( p, d, a );
287
- }
288
- else
289
- {
290
- d( p );
291
- boost::throw_exception( std::bad_alloc() );
292
- }
293
-
294
- #endif
295
- }
296
-
297
- #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
298
-
299
- template< class P, class D, class A > shared_count( P p, sp_inplace_tag< D >, A a ): pi_( 0 )
300
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
301
- , id_(shared_count_id)
302
- #endif
303
- {
304
- typedef sp_counted_impl_pda< P, D, A > impl_type;
305
-
306
- #if !defined( BOOST_NO_CXX11_ALLOCATOR )
307
-
308
- typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2;
309
-
310
- #else
311
-
312
- typedef typename A::template rebind< impl_type >::other A2;
313
-
314
- #endif
315
-
316
- A2 a2( a );
317
-
318
- #ifndef BOOST_NO_EXCEPTIONS
319
-
320
- try
321
- {
322
- pi_ = a2.allocate( 1 );
323
- ::new( static_cast< void* >( pi_ ) ) impl_type( p, a );
324
- }
325
- catch(...)
326
- {
327
- D::operator_fn( p );
328
-
329
- if( pi_ != 0 )
330
- {
331
- a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
332
- }
333
-
334
- throw;
335
- }
336
-
337
- #else
338
-
339
- pi_ = a2.allocate( 1 );
340
-
341
- if( pi_ != 0 )
342
- {
343
- ::new( static_cast< void* >( pi_ ) ) impl_type( p, a );
344
- }
345
- else
346
- {
347
- D::operator_fn( p );
348
- boost::throw_exception( std::bad_alloc() );
349
- }
350
-
351
- #endif // #ifndef BOOST_NO_EXCEPTIONS
352
- }
353
-
354
- #endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
355
-
356
- #ifndef BOOST_NO_AUTO_PTR
357
-
358
- // auto_ptr<Y> is special cased to provide the strong guarantee
359
-
360
- template<class Y>
361
- explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
362
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
363
- , id_(shared_count_id)
364
- #endif
365
- {
366
- #ifdef BOOST_NO_EXCEPTIONS
367
-
368
- if( pi_ == 0 )
369
- {
370
- boost::throw_exception(std::bad_alloc());
371
- }
372
-
373
- #endif
374
-
375
- r.release();
376
- }
377
-
378
- #endif
379
-
380
- #if !defined( BOOST_NO_CXX11_SMART_PTR )
381
-
382
- template<class Y, class D>
383
- explicit shared_count( std::unique_ptr<Y, D> & r ): pi_( 0 )
384
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
385
- , id_(shared_count_id)
386
- #endif
387
- {
388
- typedef typename sp_convert_reference<D>::type D2;
389
-
390
- D2 d2( static_cast<D&&>( r.get_deleter() ) );
391
- pi_ = new sp_counted_impl_pd< typename std::unique_ptr<Y, D>::pointer, D2 >( r.get(), d2 );
392
-
393
- #ifdef BOOST_NO_EXCEPTIONS
394
-
395
- if( pi_ == 0 )
396
- {
397
- boost::throw_exception( std::bad_alloc() );
398
- }
399
-
400
- #endif
401
-
402
- r.release();
403
- }
404
-
405
- #endif
406
-
407
- template<class Y, class D>
408
- explicit shared_count( boost::movelib::unique_ptr<Y, D> & r ): pi_( 0 )
409
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
410
- , id_(shared_count_id)
411
- #endif
412
- {
413
- typedef typename sp_convert_reference<D>::type D2;
414
-
415
- D2 d2( r.get_deleter() );
416
- pi_ = new sp_counted_impl_pd< typename boost::movelib::unique_ptr<Y, D>::pointer, D2 >( r.get(), d2 );
417
-
418
- #ifdef BOOST_NO_EXCEPTIONS
419
-
420
- if( pi_ == 0 )
421
- {
422
- boost::throw_exception( std::bad_alloc() );
423
- }
424
-
425
- #endif
426
-
427
- r.release();
428
- }
429
-
430
- ~shared_count() /*BOOST_SP_NOEXCEPT*/
431
- {
432
- if( pi_ != 0 ) pi_->release();
433
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
434
- id_ = 0;
435
- #endif
436
- }
437
-
438
- shared_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
439
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
440
- , id_(shared_count_id)
441
- #endif
442
- {
443
- if( pi_ != 0 ) pi_->add_ref_copy();
444
- }
445
-
446
- #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
447
-
448
- shared_count(shared_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
449
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
450
- , id_(shared_count_id)
451
- #endif
452
- {
453
- r.pi_ = 0;
454
- }
455
-
456
- #endif
457
-
458
- explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
459
- shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT; // constructs an empty *this when r.use_count() == 0
460
-
461
- shared_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT
462
- {
463
- sp_counted_base * tmp = r.pi_;
464
-
465
- if( tmp != pi_ )
466
- {
467
- if( tmp != 0 ) tmp->add_ref_copy();
468
- if( pi_ != 0 ) pi_->release();
469
- pi_ = tmp;
470
- }
471
-
472
- return *this;
473
- }
474
-
475
- void swap(shared_count & r) BOOST_SP_NOEXCEPT
476
- {
477
- sp_counted_base * tmp = r.pi_;
478
- r.pi_ = pi_;
479
- pi_ = tmp;
480
- }
481
-
482
- long use_count() const BOOST_SP_NOEXCEPT
483
- {
484
- return pi_ != 0? pi_->use_count(): 0;
485
- }
486
-
487
- bool unique() const BOOST_SP_NOEXCEPT
488
- {
489
- return use_count() == 1;
490
- }
491
-
492
- bool empty() const BOOST_SP_NOEXCEPT
493
- {
494
- return pi_ == 0;
495
- }
496
-
497
- bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT
498
- {
499
- return pi_ == r.pi_;
500
- }
501
-
502
- bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT;
503
-
504
- bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT
505
- {
506
- return std::less<sp_counted_base *>()( pi_, r.pi_ );
507
- }
508
-
509
- bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT;
510
-
511
- void * get_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT
512
- {
513
- return pi_? pi_->get_deleter( ti ): 0;
514
- }
515
-
516
- void * get_local_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT
517
- {
518
- return pi_? pi_->get_local_deleter( ti ): 0;
519
- }
520
-
521
- void * get_untyped_deleter() const BOOST_SP_NOEXCEPT
522
- {
523
- return pi_? pi_->get_untyped_deleter(): 0;
524
- }
525
-
526
- std::size_t hash_value() const BOOST_SP_NOEXCEPT
527
- {
528
- return sp_hash_pointer( pi_ );
529
- }
530
- };
531
-
532
-
533
- class weak_count
534
- {
535
- private:
536
-
537
- sp_counted_base * pi_;
538
-
539
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
540
- int id_;
541
- #endif
542
-
543
- friend class shared_count;
544
-
545
- public:
546
-
547
- BOOST_CONSTEXPR weak_count() BOOST_SP_NOEXCEPT: pi_(0)
548
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
549
- , id_(weak_count_id)
550
- #endif
551
- {
552
- }
553
-
554
- weak_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
555
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
556
- , id_(weak_count_id)
557
- #endif
558
- {
559
- if(pi_ != 0) pi_->weak_add_ref();
560
- }
561
-
562
- weak_count(weak_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
563
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
564
- , id_(weak_count_id)
565
- #endif
566
- {
567
- if(pi_ != 0) pi_->weak_add_ref();
568
- }
569
-
570
- // Move support
571
-
572
- #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
573
-
574
- weak_count(weak_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
575
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
576
- , id_(weak_count_id)
577
- #endif
578
- {
579
- r.pi_ = 0;
580
- }
581
-
582
- #endif
583
-
584
- ~weak_count() /*BOOST_SP_NOEXCEPT*/
585
- {
586
- if(pi_ != 0) pi_->weak_release();
587
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
588
- id_ = 0;
589
- #endif
590
- }
591
-
592
- weak_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT
593
- {
594
- sp_counted_base * tmp = r.pi_;
595
-
596
- if( tmp != pi_ )
597
- {
598
- if(tmp != 0) tmp->weak_add_ref();
599
- if(pi_ != 0) pi_->weak_release();
600
- pi_ = tmp;
601
- }
602
-
603
- return *this;
604
- }
605
-
606
- weak_count & operator= (weak_count const & r) BOOST_SP_NOEXCEPT
607
- {
608
- sp_counted_base * tmp = r.pi_;
609
-
610
- if( tmp != pi_ )
611
- {
612
- if(tmp != 0) tmp->weak_add_ref();
613
- if(pi_ != 0) pi_->weak_release();
614
- pi_ = tmp;
615
- }
616
-
617
- return *this;
618
- }
619
-
620
- void swap(weak_count & r) BOOST_SP_NOEXCEPT
621
- {
622
- sp_counted_base * tmp = r.pi_;
623
- r.pi_ = pi_;
624
- pi_ = tmp;
625
- }
626
-
627
- long use_count() const BOOST_SP_NOEXCEPT
628
- {
629
- return pi_ != 0? pi_->use_count(): 0;
630
- }
631
-
632
- bool empty() const BOOST_SP_NOEXCEPT
633
- {
634
- return pi_ == 0;
635
- }
636
-
637
- bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT
638
- {
639
- return pi_ == r.pi_;
640
- }
641
-
642
- bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT
643
- {
644
- return pi_ == r.pi_;
645
- }
646
-
647
- bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT
648
- {
649
- return std::less<sp_counted_base *>()( pi_, r.pi_ );
650
- }
651
-
652
- bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT
653
- {
654
- return std::less<sp_counted_base *>()( pi_, r.pi_ );
655
- }
656
-
657
- std::size_t hash_value() const BOOST_SP_NOEXCEPT
658
- {
659
- return sp_hash_pointer( pi_ );
660
- }
661
- };
662
-
663
- inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ )
664
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
665
- , id_(shared_count_id)
666
- #endif
667
- {
668
- if( pi_ == 0 || !pi_->add_ref_lock() )
669
- {
670
- boost::throw_exception( boost::bad_weak_ptr() );
671
- }
672
- }
673
-
674
- inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT: pi_( r.pi_ )
675
- #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
676
- , id_(shared_count_id)
677
- #endif
678
- {
679
- if( pi_ != 0 && !pi_->add_ref_lock() )
680
- {
681
- pi_ = 0;
682
- }
683
- }
684
-
685
- inline bool shared_count::operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT
686
- {
687
- return pi_ == r.pi_;
688
- }
689
-
690
- inline bool shared_count::operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT
691
- {
692
- return std::less<sp_counted_base *>()( pi_, r.pi_ );
693
- }
694
-
695
- } // namespace detail
696
-
697
- } // namespace boost
698
-
699
- #if defined( BOOST_SP_DISABLE_DEPRECATED )
700
- #pragma GCC diagnostic pop
701
- #endif
702
-
703
- #if defined(__BORLANDC__) && !defined(__clang__)
704
- # pragma warn .8027 // Functions containing try are not expanded inline
705
- #endif
706
-
707
- #endif // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED