@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.
- package/README.md +2 -2
- package/node/ditto.cjs.js +2 -9620
- package/node/{ditto.linux-x64.node → ditto.linux-arm64.node} +0 -0
- package/package.json +38 -34
- package/types/ditto.d.ts +0 -2
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
- package/DittoReactNative.podspec +0 -27
- package/node/ditto.darwin-arm64.node +0 -0
- package/node/ditto.darwin-x64.node +0 -0
- package/node/ditto.linux-arm.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/node/transports.darwin-arm64.node +0 -0
- package/node/transports.darwin-x64.node +0 -0
- package/react-native/android/CMakeLists.txt +0 -37
- package/react-native/android/build.gradle +0 -203
- package/react-native/android/cpp-adapter.cpp +0 -254
- package/react-native/android/gradle.properties +0 -5
- package/react-native/android/src/main/AndroidManifest.xml +0 -4
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +0 -85
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +0 -28
- package/react-native/boost/boost/assert.hpp +0 -85
- package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
- package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
- package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
- package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
- package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
- package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
- package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
- package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
- package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
- package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
- package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
- package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
- package/react-native/boost/boost/config/auto_link.hpp +0 -525
- package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
- package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
- package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
- package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
- package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
- package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
- package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
- package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
- package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
- package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
- package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
- package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
- package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
- package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
- package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
- package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
- package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
- package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
- package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
- package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
- package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
- package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
- package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
- package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
- package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
- package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
- package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
- package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
- package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
- package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
- package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
- package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
- package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
- package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
- package/react-native/boost/boost/config/helper_macros.hpp +0 -37
- package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
- package/react-native/boost/boost/config/platform/aix.hpp +0 -33
- package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
- package/react-native/boost/boost/config/platform/beos.hpp +0 -26
- package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
- package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
- package/react-native/boost/boost/config/platform/cray.hpp +0 -18
- package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
- package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
- package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
- package/react-native/boost/boost/config/platform/irix.hpp +0 -31
- package/react-native/boost/boost/config/platform/linux.hpp +0 -106
- package/react-native/boost/boost/config/platform/macos.hpp +0 -87
- package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
- package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
- package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
- package/react-native/boost/boost/config/platform/vms.hpp +0 -25
- package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
- package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
- package/react-native/boost/boost/config/platform/win32.hpp +0 -90
- package/react-native/boost/boost/config/platform/zos.hpp +0 -32
- package/react-native/boost/boost/config/pragma_message.hpp +0 -31
- package/react-native/boost/boost/config/requires_threads.hpp +0 -92
- package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
- package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
- package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
- package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
- package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
- package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
- package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
- package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
- package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
- package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
- package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
- package/react-native/boost/boost/config/user.hpp +0 -133
- package/react-native/boost/boost/config/warning_disable.hpp +0 -47
- package/react-native/boost/boost/config/workaround.hpp +0 -305
- package/react-native/boost/boost/config.hpp +0 -67
- package/react-native/boost/boost/cstdint.hpp +0 -556
- package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
- package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
- package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
- package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
- package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
- package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
- package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
- package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
- package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
- package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
- package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
- package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
- package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
- package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
- package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
- package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
- package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
- package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
- package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
- package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
- package/react-native/cpp/include/Attachment.h +0 -16
- package/react-native/cpp/include/Authentication.h +0 -23
- package/react-native/cpp/include/Collection.h +0 -13
- package/react-native/cpp/include/DQL.h +0 -21
- package/react-native/cpp/include/Document.h +0 -17
- package/react-native/cpp/include/Identity.h +0 -17
- package/react-native/cpp/include/Lifecycle.h +0 -16
- package/react-native/cpp/include/LiveQuery.h +0 -17
- package/react-native/cpp/include/Logger.h +0 -22
- package/react-native/cpp/include/Misc.h +0 -26
- package/react-native/cpp/include/Presence.h +0 -14
- package/react-native/cpp/include/RetainableState.h +0 -24
- package/react-native/cpp/include/SmallPeerInfo.h +0 -17
- package/react-native/cpp/include/Transports.h +0 -25
- package/react-native/cpp/include/TypedArray.hpp +0 -167
- package/react-native/cpp/include/Utils.h +0 -61
- package/react-native/cpp/include/main.h +0 -10
- package/react-native/cpp/src/Attachment.cpp +0 -86
- package/react-native/cpp/src/Authentication.cpp +0 -224
- package/react-native/cpp/src/Collection.cpp +0 -54
- package/react-native/cpp/src/DQL.cpp +0 -254
- package/react-native/cpp/src/Document.cpp +0 -146
- package/react-native/cpp/src/Identity.cpp +0 -123
- package/react-native/cpp/src/Lifecycle.cpp +0 -75
- package/react-native/cpp/src/LiveQuery.cpp +0 -64
- package/react-native/cpp/src/Logger.cpp +0 -200
- package/react-native/cpp/src/Misc.cpp +0 -271
- package/react-native/cpp/src/Presence.cpp +0 -77
- package/react-native/cpp/src/RetainableState.cpp +0 -15
- package/react-native/cpp/src/SmallPeerInfo.cpp +0 -108
- package/react-native/cpp/src/Transports.cpp +0 -270
- package/react-native/cpp/src/TypedArray.cpp +0 -303
- package/react-native/cpp/src/Utils.cpp +0 -138
- package/react-native/cpp/src/main.cpp +0 -149
- package/react-native/dittoffi/dittoffi.h +0 -4698
- package/react-native/dittoffi/ifaddrs.cpp +0 -385
- package/react-native/dittoffi/ifaddrs.h +0 -206
- package/react-native/ios/DittoRNSDK.h +0 -7
- package/react-native/ios/DittoRNSDK.mm +0 -107
- package/react-native/ios/YeetJSIUtils.h +0 -60
- package/react-native/ios/YeetJSIUtils.mm +0 -196
- package/react-native/lib/commonjs/ditto.rn.js +0 -93
- package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
- package/react-native/lib/commonjs/index.js +0 -14
- package/react-native/lib/commonjs/index.js.map +0 -1
- package/react-native/lib/module/ditto.rn.js +0 -83
- package/react-native/lib/module/ditto.rn.js.map +0 -1
- package/react-native/lib/module/index.js +0 -13
- package/react-native/lib/module/index.js.map +0 -1
- package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
- package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
- package/react-native/lib/typescript/index.d.ts +0 -1
- package/react-native/lib/typescript/index.d.ts.map +0 -1
- package/react-native/scripts/ruby/include_local_boost.rb +0 -78
- package/react-native/src/ditto.rn.ts +0 -91
- package/react-native/src/environment/environment.fallback.ts +0 -4
- package/react-native/src/index.ts +0 -26
- package/react-native/src/sources/@cbor-redux.ts +0 -2
- package/react-native/src/sources/@ditto.core.ts +0 -1
- package/react-native/src/sources/@environment.ts +0 -2
- package/react-native/src/sources/attachment-fetch-event.ts +0 -54
- package/react-native/src/sources/attachment-fetcher-manager.ts +0 -129
- package/react-native/src/sources/attachment-fetcher.ts +0 -124
- package/react-native/src/sources/attachment-token.ts +0 -48
- package/react-native/src/sources/attachment.ts +0 -59
- package/react-native/src/sources/augment.ts +0 -89
- package/react-native/src/sources/authenticator.ts +0 -314
- package/react-native/src/sources/base-pending-cursor-operation.ts +0 -237
- package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -109
- package/react-native/src/sources/bridge.ts +0 -549
- package/react-native/src/sources/build-time-constants.ts +0 -4
- package/react-native/src/sources/cbor.ts +0 -35
- package/react-native/src/sources/collection-interface.ts +0 -67
- package/react-native/src/sources/collection.ts +0 -212
- package/react-native/src/sources/collections-event.ts +0 -99
- package/react-native/src/sources/counter.ts +0 -77
- package/react-native/src/sources/ditto.ts +0 -945
- package/react-native/src/sources/document-id.ts +0 -159
- package/react-native/src/sources/document-path.ts +0 -303
- package/react-native/src/sources/document.ts +0 -192
- package/react-native/src/sources/epilogue.ts +0 -24
- package/react-native/src/sources/error-codes.ts +0 -52
- package/react-native/src/sources/error.ts +0 -203
- package/react-native/src/sources/essentials.ts +0 -53
- package/react-native/src/sources/ffi-error.ts +0 -117
- package/react-native/src/sources/ffi.ts +0 -1972
- package/react-native/src/sources/identity.ts +0 -163
- package/react-native/src/sources/init.ts +0 -70
- package/react-native/src/sources/internal.ts +0 -113
- package/react-native/src/sources/keep-alive.ts +0 -69
- package/react-native/src/sources/key-path.ts +0 -195
- package/react-native/src/sources/live-query-event.ts +0 -208
- package/react-native/src/sources/live-query-manager.ts +0 -101
- package/react-native/src/sources/live-query.ts +0 -164
- package/react-native/src/sources/logger.ts +0 -196
- package/react-native/src/sources/observer-manager.ts +0 -175
- package/react-native/src/sources/observer.ts +0 -77
- package/react-native/src/sources/pending-collections-operation.ts +0 -232
- package/react-native/src/sources/pending-cursor-operation.ts +0 -218
- package/react-native/src/sources/pending-id-specific-operation.ts +0 -216
- package/react-native/src/sources/presence-manager.ts +0 -160
- package/react-native/src/sources/presence.ts +0 -238
- package/react-native/src/sources/query-result-item.ts +0 -116
- package/react-native/src/sources/query-result.ts +0 -55
- package/react-native/src/sources/register.ts +0 -92
- package/react-native/src/sources/small-peer-info.ts +0 -176
- package/react-native/src/sources/static-tcp-client.ts +0 -6
- package/react-native/src/sources/store-observer.ts +0 -176
- package/react-native/src/sources/store.ts +0 -365
- package/react-native/src/sources/subscription-manager.ts +0 -98
- package/react-native/src/sources/subscription.ts +0 -88
- package/react-native/src/sources/sync-subscription.ts +0 -90
- package/react-native/src/sources/sync.ts +0 -495
- package/react-native/src/sources/test-helpers.ts +0 -24
- package/react-native/src/sources/transport-conditions-manager.ts +0 -104
- package/react-native/src/sources/transport-config.ts +0 -428
- package/react-native/src/sources/update-result.ts +0 -66
- package/react-native/src/sources/update-results-map.ts +0 -57
- package/react-native/src/sources/websocket-client.ts +0 -6
- package/react-native/src/sources/write-transaction-collection.ts +0 -122
- package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
- package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -72
- package/react-native/src/sources/write-transaction.ts +0 -119
- package/react-native.config.js +0 -9
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SNC_PS3_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SNC_PS3_HPP_INCLUDED
|
|
3
|
-
|
|
4
|
-
// MS compatible compilers support #pragma once
|
|
5
|
-
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
6
|
-
# pragma once
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
// detail/sp_counted_base_gcc_snc_ps3.hpp - PS3 Cell
|
|
10
|
-
//
|
|
11
|
-
// Copyright (c) 2006 Piotr Wyderski
|
|
12
|
-
// Copyright (c) 2006 Tomas Puverle
|
|
13
|
-
// Copyright (c) 2006 Peter Dimov
|
|
14
|
-
// Copyright (c) 2011 Emil Dotchevski
|
|
15
|
-
//
|
|
16
|
-
// Distributed under the Boost Software License, Version 1.0.
|
|
17
|
-
// See accompanying file LICENSE_1_0.txt or copy at
|
|
18
|
-
// http://www.boost.org/LICENSE_1_0.txt
|
|
19
|
-
//
|
|
20
|
-
// Thanks to Michael van der Westhuizen
|
|
21
|
-
|
|
22
|
-
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
|
23
|
-
#include <boost/smart_ptr/detail/sp_obsolete.hpp>
|
|
24
|
-
#include <boost/config.hpp>
|
|
25
|
-
#include <inttypes.h> // uint32_t
|
|
26
|
-
|
|
27
|
-
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
28
|
-
|
|
29
|
-
#include <boost/config/pragma_message.hpp>
|
|
30
|
-
BOOST_PRAGMA_MESSAGE("Using PS3 sp_counted_base")
|
|
31
|
-
|
|
32
|
-
#endif
|
|
33
|
-
|
|
34
|
-
BOOST_SP_OBSOLETE()
|
|
35
|
-
|
|
36
|
-
namespace boost
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
namespace detail
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
inline uint32_t compare_and_swap( uint32_t * dest_, uint32_t compare_, uint32_t swap_ )
|
|
43
|
-
{
|
|
44
|
-
return __builtin_cellAtomicCompareAndSwap32(dest_,compare_,swap_);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
inline uint32_t atomic_fetch_and_add( uint32_t * pw, uint32_t dv )
|
|
48
|
-
{
|
|
49
|
-
// long r = *pw;
|
|
50
|
-
// *pw += dv;
|
|
51
|
-
// return r;
|
|
52
|
-
|
|
53
|
-
for( ;; )
|
|
54
|
-
{
|
|
55
|
-
uint32_t r = *pw;
|
|
56
|
-
|
|
57
|
-
if( __builtin_expect((compare_and_swap(pw, r, r + dv) == r), 1) )
|
|
58
|
-
{
|
|
59
|
-
return r;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
inline void atomic_increment( uint32_t * pw )
|
|
65
|
-
{
|
|
66
|
-
(void) __builtin_cellAtomicIncr32( pw );
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
inline uint32_t atomic_decrement( uint32_t * pw )
|
|
70
|
-
{
|
|
71
|
-
return __builtin_cellAtomicDecr32( pw );
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
inline uint32_t atomic_conditional_increment( uint32_t * pw )
|
|
75
|
-
{
|
|
76
|
-
// long r = *pw;
|
|
77
|
-
// if( r != 0 ) ++*pw;
|
|
78
|
-
// return r;
|
|
79
|
-
|
|
80
|
-
for( ;; )
|
|
81
|
-
{
|
|
82
|
-
uint32_t r = *pw;
|
|
83
|
-
|
|
84
|
-
if( r == 0 )
|
|
85
|
-
{
|
|
86
|
-
return r;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if( __builtin_expect( ( compare_and_swap( pw, r, r + 1 ) == r ), 1 ) )
|
|
90
|
-
{
|
|
91
|
-
return r;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
class BOOST_SYMBOL_VISIBLE sp_counted_base
|
|
97
|
-
{
|
|
98
|
-
private:
|
|
99
|
-
|
|
100
|
-
sp_counted_base( sp_counted_base const & );
|
|
101
|
-
sp_counted_base & operator= ( sp_counted_base const & );
|
|
102
|
-
|
|
103
|
-
uint32_t use_count_; // #shared
|
|
104
|
-
uint32_t weak_count_; // #weak + (#shared != 0)
|
|
105
|
-
|
|
106
|
-
public:
|
|
107
|
-
|
|
108
|
-
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
|
109
|
-
{
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
virtual ~sp_counted_base() // nothrow
|
|
113
|
-
{
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// dispose() is called when use_count_ drops to zero, to release
|
|
117
|
-
// the resources managed by *this.
|
|
118
|
-
|
|
119
|
-
virtual void dispose() = 0; // nothrow
|
|
120
|
-
|
|
121
|
-
// destroy() is called when weak_count_ drops to zero.
|
|
122
|
-
|
|
123
|
-
virtual void destroy() // nothrow
|
|
124
|
-
{
|
|
125
|
-
delete this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
virtual void * get_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
129
|
-
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
130
|
-
virtual void * get_untyped_deleter() = 0;
|
|
131
|
-
|
|
132
|
-
void add_ref_copy()
|
|
133
|
-
{
|
|
134
|
-
atomic_increment( &use_count_ );
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
bool add_ref_lock() // true on success
|
|
138
|
-
{
|
|
139
|
-
return atomic_conditional_increment( &use_count_ ) != 0;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
void release() // nothrow
|
|
143
|
-
{
|
|
144
|
-
if( atomic_decrement( &use_count_ ) == 1 )
|
|
145
|
-
{
|
|
146
|
-
dispose();
|
|
147
|
-
weak_release();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
void weak_add_ref() // nothrow
|
|
152
|
-
{
|
|
153
|
-
atomic_increment( &weak_count_ );
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
void weak_release() // nothrow
|
|
157
|
-
{
|
|
158
|
-
if( atomic_decrement( &weak_count_ ) == 1 )
|
|
159
|
-
{
|
|
160
|
-
destroy();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
long use_count() const // nothrow
|
|
165
|
-
{
|
|
166
|
-
return const_cast< uint32_t const volatile & >( use_count_ );
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
} // namespace detail
|
|
171
|
-
|
|
172
|
-
} // namespace boost
|
|
173
|
-
|
|
174
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SNC_PS3_HPP_INCLUDED
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SPIN_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SPIN_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/sp_counted_base_spin.hpp - spinlock pool atomic emulation
|
|
12
|
-
//
|
|
13
|
-
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
|
14
|
-
// Copyright 2004-2008 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
|
-
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
|
22
|
-
#include <boost/smart_ptr/detail/spinlock_pool.hpp>
|
|
23
|
-
#include <boost/config.hpp>
|
|
24
|
-
|
|
25
|
-
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
26
|
-
|
|
27
|
-
#include <boost/config/pragma_message.hpp>
|
|
28
|
-
BOOST_PRAGMA_MESSAGE("Using spinlock-based sp_counted_base")
|
|
29
|
-
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
namespace boost
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
namespace detail
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
inline int atomic_exchange_and_add( int * pw, int dv )
|
|
39
|
-
{
|
|
40
|
-
spinlock_pool<1>::scoped_lock lock( pw );
|
|
41
|
-
|
|
42
|
-
int r = *pw;
|
|
43
|
-
*pw += dv;
|
|
44
|
-
return r;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
inline void atomic_increment( int * pw )
|
|
48
|
-
{
|
|
49
|
-
spinlock_pool<1>::scoped_lock lock( pw );
|
|
50
|
-
++*pw;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
inline int atomic_conditional_increment( int * pw )
|
|
54
|
-
{
|
|
55
|
-
spinlock_pool<1>::scoped_lock lock( pw );
|
|
56
|
-
|
|
57
|
-
int rv = *pw;
|
|
58
|
-
if( rv != 0 ) ++*pw;
|
|
59
|
-
return rv;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
class BOOST_SYMBOL_VISIBLE sp_counted_base
|
|
63
|
-
{
|
|
64
|
-
private:
|
|
65
|
-
|
|
66
|
-
sp_counted_base( sp_counted_base const & );
|
|
67
|
-
sp_counted_base & operator= ( sp_counted_base const & );
|
|
68
|
-
|
|
69
|
-
int use_count_; // #shared
|
|
70
|
-
int weak_count_; // #weak + (#shared != 0)
|
|
71
|
-
|
|
72
|
-
public:
|
|
73
|
-
|
|
74
|
-
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
|
75
|
-
{
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
virtual ~sp_counted_base() // nothrow
|
|
79
|
-
{
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// dispose() is called when use_count_ drops to zero, to release
|
|
83
|
-
// the resources managed by *this.
|
|
84
|
-
|
|
85
|
-
virtual void dispose() = 0; // nothrow
|
|
86
|
-
|
|
87
|
-
// destroy() is called when weak_count_ drops to zero.
|
|
88
|
-
|
|
89
|
-
virtual void destroy() // nothrow
|
|
90
|
-
{
|
|
91
|
-
delete this;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
virtual void * get_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
95
|
-
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
96
|
-
virtual void * get_untyped_deleter() = 0;
|
|
97
|
-
|
|
98
|
-
void add_ref_copy()
|
|
99
|
-
{
|
|
100
|
-
atomic_increment( &use_count_ );
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
bool add_ref_lock() // true on success
|
|
104
|
-
{
|
|
105
|
-
return atomic_conditional_increment( &use_count_ ) != 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
void release() // nothrow
|
|
109
|
-
{
|
|
110
|
-
if( atomic_exchange_and_add( &use_count_, -1 ) == 1 )
|
|
111
|
-
{
|
|
112
|
-
dispose();
|
|
113
|
-
weak_release();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
void weak_add_ref() // nothrow
|
|
118
|
-
{
|
|
119
|
-
atomic_increment( &weak_count_ );
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
void weak_release() // nothrow
|
|
123
|
-
{
|
|
124
|
-
if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 )
|
|
125
|
-
{
|
|
126
|
-
destroy();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
long use_count() const // nothrow
|
|
131
|
-
{
|
|
132
|
-
spinlock_pool<1>::scoped_lock lock( &use_count_ );
|
|
133
|
-
return use_count_;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
} // namespace detail
|
|
138
|
-
|
|
139
|
-
} // namespace boost
|
|
140
|
-
|
|
141
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SPIN_HPP_INCLUDED
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_STD_ATOMIC_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_STD_ATOMIC_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
|
-
// detail/sp_counted_base_std_atomic.hpp - C++11 std::atomic
|
|
11
|
-
//
|
|
12
|
-
// Copyright (c) 2007, 2013 Peter Dimov
|
|
13
|
-
//
|
|
14
|
-
// Distributed under the Boost Software License, Version 1.0.
|
|
15
|
-
// See accompanying file LICENSE_1_0.txt or copy at
|
|
16
|
-
// http://www.boost.org/LICENSE_1_0.txt
|
|
17
|
-
|
|
18
|
-
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
|
19
|
-
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
|
20
|
-
#include <boost/config.hpp>
|
|
21
|
-
#include <atomic>
|
|
22
|
-
#include <cstdint>
|
|
23
|
-
|
|
24
|
-
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
25
|
-
|
|
26
|
-
#include <boost/config/pragma_message.hpp>
|
|
27
|
-
BOOST_PRAGMA_MESSAGE("Using std::atomic sp_counted_base")
|
|
28
|
-
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
namespace boost
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
namespace detail
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
inline void atomic_increment( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
|
|
38
|
-
{
|
|
39
|
-
pw->fetch_add( 1, std::memory_order_relaxed );
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
inline std::int_least32_t atomic_decrement( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
|
|
43
|
-
{
|
|
44
|
-
return pw->fetch_sub( 1, std::memory_order_acq_rel );
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
inline std::int_least32_t atomic_conditional_increment( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
|
|
48
|
-
{
|
|
49
|
-
// long r = *pw;
|
|
50
|
-
// if( r != 0 ) ++*pw;
|
|
51
|
-
// return r;
|
|
52
|
-
|
|
53
|
-
std::int_least32_t r = pw->load( std::memory_order_relaxed );
|
|
54
|
-
|
|
55
|
-
for( ;; )
|
|
56
|
-
{
|
|
57
|
-
if( r == 0 )
|
|
58
|
-
{
|
|
59
|
-
return r;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if( pw->compare_exchange_weak( r, r + 1, std::memory_order_relaxed, std::memory_order_relaxed ) )
|
|
63
|
-
{
|
|
64
|
-
return r;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
class BOOST_SYMBOL_VISIBLE sp_counted_base
|
|
70
|
-
{
|
|
71
|
-
private:
|
|
72
|
-
|
|
73
|
-
sp_counted_base( sp_counted_base const & );
|
|
74
|
-
sp_counted_base & operator= ( sp_counted_base const & );
|
|
75
|
-
|
|
76
|
-
std::atomic_int_least32_t use_count_; // #shared
|
|
77
|
-
std::atomic_int_least32_t weak_count_; // #weak + (#shared != 0)
|
|
78
|
-
|
|
79
|
-
public:
|
|
80
|
-
|
|
81
|
-
sp_counted_base() BOOST_SP_NOEXCEPT: use_count_( 1 ), weak_count_( 1 )
|
|
82
|
-
{
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
virtual ~sp_counted_base() /*BOOST_SP_NOEXCEPT*/
|
|
86
|
-
{
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// dispose() is called when use_count_ drops to zero, to release
|
|
90
|
-
// the resources managed by *this.
|
|
91
|
-
|
|
92
|
-
virtual void dispose() BOOST_SP_NOEXCEPT = 0;
|
|
93
|
-
|
|
94
|
-
// destroy() is called when weak_count_ drops to zero.
|
|
95
|
-
|
|
96
|
-
virtual void destroy() BOOST_SP_NOEXCEPT
|
|
97
|
-
{
|
|
98
|
-
delete this;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
virtual void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
|
|
102
|
-
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
|
|
103
|
-
virtual void * get_untyped_deleter() BOOST_SP_NOEXCEPT = 0;
|
|
104
|
-
|
|
105
|
-
void add_ref_copy() BOOST_SP_NOEXCEPT
|
|
106
|
-
{
|
|
107
|
-
atomic_increment( &use_count_ );
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
bool add_ref_lock() BOOST_SP_NOEXCEPT // true on success
|
|
111
|
-
{
|
|
112
|
-
return atomic_conditional_increment( &use_count_ ) != 0;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
void release() BOOST_SP_NOEXCEPT
|
|
116
|
-
{
|
|
117
|
-
if( atomic_decrement( &use_count_ ) == 1 )
|
|
118
|
-
{
|
|
119
|
-
dispose();
|
|
120
|
-
weak_release();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
void weak_add_ref() BOOST_SP_NOEXCEPT
|
|
125
|
-
{
|
|
126
|
-
atomic_increment( &weak_count_ );
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
void weak_release() BOOST_SP_NOEXCEPT
|
|
130
|
-
{
|
|
131
|
-
if( atomic_decrement( &weak_count_ ) == 1 )
|
|
132
|
-
{
|
|
133
|
-
destroy();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
long use_count() const BOOST_SP_NOEXCEPT
|
|
138
|
-
{
|
|
139
|
-
return use_count_.load( std::memory_order_acquire );
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
} // namespace detail
|
|
144
|
-
|
|
145
|
-
} // namespace boost
|
|
146
|
-
|
|
147
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_STD_ATOMIC_HPP_INCLUDED
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SYNC_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SYNC_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
|
-
// detail/sp_counted_base_sync.hpp - g++ 4.1+ __sync intrinsics
|
|
11
|
-
//
|
|
12
|
-
// Copyright (c) 2007 Peter Dimov
|
|
13
|
-
//
|
|
14
|
-
// Distributed under the Boost Software License, Version 1.0.
|
|
15
|
-
// See accompanying file LICENSE_1_0.txt or copy at
|
|
16
|
-
// http://www.boost.org/LICENSE_1_0.txt
|
|
17
|
-
|
|
18
|
-
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
|
19
|
-
#include <boost/config.hpp>
|
|
20
|
-
#include <limits.h>
|
|
21
|
-
|
|
22
|
-
#if defined( __ia64__ ) && defined( __INTEL_COMPILER )
|
|
23
|
-
# include <ia64intrin.h>
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
|
-
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
27
|
-
|
|
28
|
-
#include <boost/config/pragma_message.hpp>
|
|
29
|
-
BOOST_PRAGMA_MESSAGE("Using __sync sp_counted_base")
|
|
30
|
-
|
|
31
|
-
#endif
|
|
32
|
-
|
|
33
|
-
namespace boost
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
namespace detail
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
#if INT_MAX >= 2147483647
|
|
40
|
-
|
|
41
|
-
typedef int sp_int32_t;
|
|
42
|
-
|
|
43
|
-
#else
|
|
44
|
-
|
|
45
|
-
typedef long sp_int32_t;
|
|
46
|
-
|
|
47
|
-
#endif
|
|
48
|
-
|
|
49
|
-
inline void atomic_increment( sp_int32_t * pw )
|
|
50
|
-
{
|
|
51
|
-
__sync_fetch_and_add( pw, 1 );
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
inline sp_int32_t atomic_decrement( sp_int32_t * pw )
|
|
55
|
-
{
|
|
56
|
-
return __sync_fetch_and_add( pw, -1 );
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
inline sp_int32_t atomic_conditional_increment( sp_int32_t * pw )
|
|
60
|
-
{
|
|
61
|
-
// long r = *pw;
|
|
62
|
-
// if( r != 0 ) ++*pw;
|
|
63
|
-
// return r;
|
|
64
|
-
|
|
65
|
-
sp_int32_t r = *pw;
|
|
66
|
-
|
|
67
|
-
for( ;; )
|
|
68
|
-
{
|
|
69
|
-
if( r == 0 )
|
|
70
|
-
{
|
|
71
|
-
return r;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
sp_int32_t r2 = __sync_val_compare_and_swap( pw, r, r + 1 );
|
|
75
|
-
|
|
76
|
-
if( r2 == r )
|
|
77
|
-
{
|
|
78
|
-
return r;
|
|
79
|
-
}
|
|
80
|
-
else
|
|
81
|
-
{
|
|
82
|
-
r = r2;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
class BOOST_SYMBOL_VISIBLE sp_counted_base
|
|
88
|
-
{
|
|
89
|
-
private:
|
|
90
|
-
|
|
91
|
-
sp_counted_base( sp_counted_base const & );
|
|
92
|
-
sp_counted_base & operator= ( sp_counted_base const & );
|
|
93
|
-
|
|
94
|
-
sp_int32_t use_count_; // #shared
|
|
95
|
-
sp_int32_t weak_count_; // #weak + (#shared != 0)
|
|
96
|
-
|
|
97
|
-
public:
|
|
98
|
-
|
|
99
|
-
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
|
100
|
-
{
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
virtual ~sp_counted_base() // nothrow
|
|
104
|
-
{
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// dispose() is called when use_count_ drops to zero, to release
|
|
108
|
-
// the resources managed by *this.
|
|
109
|
-
|
|
110
|
-
virtual void dispose() = 0; // nothrow
|
|
111
|
-
|
|
112
|
-
// destroy() is called when weak_count_ drops to zero.
|
|
113
|
-
|
|
114
|
-
virtual void destroy() // nothrow
|
|
115
|
-
{
|
|
116
|
-
delete this;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
virtual void * get_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
120
|
-
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) = 0;
|
|
121
|
-
virtual void * get_untyped_deleter() = 0;
|
|
122
|
-
|
|
123
|
-
void add_ref_copy()
|
|
124
|
-
{
|
|
125
|
-
atomic_increment( &use_count_ );
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
bool add_ref_lock() // true on success
|
|
129
|
-
{
|
|
130
|
-
return atomic_conditional_increment( &use_count_ ) != 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
void release() // nothrow
|
|
134
|
-
{
|
|
135
|
-
if( atomic_decrement( &use_count_ ) == 1 )
|
|
136
|
-
{
|
|
137
|
-
dispose();
|
|
138
|
-
weak_release();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
void weak_add_ref() // nothrow
|
|
143
|
-
{
|
|
144
|
-
atomic_increment( &weak_count_ );
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
void weak_release() // nothrow
|
|
148
|
-
{
|
|
149
|
-
if( atomic_decrement( &weak_count_ ) == 1 )
|
|
150
|
-
{
|
|
151
|
-
destroy();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
long use_count() const // nothrow
|
|
156
|
-
{
|
|
157
|
-
return const_cast< sp_int32_t const volatile & >( use_count_ );
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
} // namespace detail
|
|
162
|
-
|
|
163
|
-
} // namespace boost
|
|
164
|
-
|
|
165
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_SYNC_HPP_INCLUDED
|