@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,58 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_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
|
-
// smart_ptr/detail/sp_typeinfo_.hpp
|
|
11
|
-
//
|
|
12
|
-
// Copyright 2007, 2019 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/config.hpp>
|
|
19
|
-
|
|
20
|
-
#if defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
|
|
21
|
-
|
|
22
|
-
#include <boost/core/typeinfo.hpp>
|
|
23
|
-
|
|
24
|
-
namespace boost
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
namespace detail
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
typedef boost::core::typeinfo sp_typeinfo_;
|
|
31
|
-
|
|
32
|
-
} // namespace detail
|
|
33
|
-
|
|
34
|
-
} // namespace boost
|
|
35
|
-
|
|
36
|
-
#define BOOST_SP_TYPEID_(T) BOOST_CORE_TYPEID(T)
|
|
37
|
-
|
|
38
|
-
#else // defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
|
|
39
|
-
|
|
40
|
-
#include <typeinfo>
|
|
41
|
-
|
|
42
|
-
namespace boost
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
namespace detail
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
typedef std::type_info sp_typeinfo_;
|
|
49
|
-
|
|
50
|
-
} // namespace detail
|
|
51
|
-
|
|
52
|
-
} // namespace boost
|
|
53
|
-
|
|
54
|
-
#define BOOST_SP_TYPEID_(T) typeid(T)
|
|
55
|
-
|
|
56
|
-
#endif // defined( BOOST_NO_TYPEID ) || defined( BOOST_NO_STD_TYPEINFO )
|
|
57
|
-
|
|
58
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_TYPEINFO_HPP_INCLUDED
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_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
|
-
// boost/smart_ptr/detail/sp_win32_sleep.hpp
|
|
11
|
-
//
|
|
12
|
-
// Declares the Win32 Sleep() function.
|
|
13
|
-
//
|
|
14
|
-
// Copyright 2008, 2020 Peter Dimov
|
|
15
|
-
// Distributed under the Boost Software License, Version 1.0
|
|
16
|
-
// https://www.boost.org/LICENSE_1_0.txt
|
|
17
|
-
|
|
18
|
-
#if defined( BOOST_USE_WINDOWS_H )
|
|
19
|
-
# include <windows.h>
|
|
20
|
-
#endif
|
|
21
|
-
|
|
22
|
-
namespace boost
|
|
23
|
-
{
|
|
24
|
-
namespace detail
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
#if !defined( BOOST_USE_WINDOWS_H )
|
|
28
|
-
|
|
29
|
-
#if defined(__clang__) && defined(__x86_64__)
|
|
30
|
-
// clang x64 warns that __stdcall is ignored
|
|
31
|
-
# define BOOST_SP_STDCALL
|
|
32
|
-
#else
|
|
33
|
-
# define BOOST_SP_STDCALL __stdcall
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
#if defined(__LP64__) // Cygwin 64
|
|
37
|
-
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned int ms );
|
|
38
|
-
#else
|
|
39
|
-
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned long ms );
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
|
-
#undef BOOST_SP_STDCALL
|
|
43
|
-
|
|
44
|
-
#endif // !defined( BOOST_USE_WINDOWS_H )
|
|
45
|
-
|
|
46
|
-
} // namespace detail
|
|
47
|
-
} // namespace boost
|
|
48
|
-
|
|
49
|
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
#ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
|
|
2
|
-
#define BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// intrusive_ptr.hpp
|
|
6
|
-
//
|
|
7
|
-
// Copyright (c) 2001, 2002 Peter Dimov
|
|
8
|
-
//
|
|
9
|
-
// Distributed under the Boost Software License, Version 1.0. (See
|
|
10
|
-
// accompanying file LICENSE_1_0.txt or copy at
|
|
11
|
-
// http://www.boost.org/LICENSE_1_0.txt)
|
|
12
|
-
//
|
|
13
|
-
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
|
17
|
-
|
|
18
|
-
#include <boost/config.hpp>
|
|
19
|
-
|
|
20
|
-
#include <boost/assert.hpp>
|
|
21
|
-
#include <boost/config/workaround.hpp>
|
|
22
|
-
#include <boost/smart_ptr/detail/sp_convertible.hpp>
|
|
23
|
-
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
|
24
|
-
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
|
25
|
-
|
|
26
|
-
#include <boost/config/no_tr1/functional.hpp> // for std::less
|
|
27
|
-
|
|
28
|
-
#if !defined(BOOST_NO_IOSTREAM)
|
|
29
|
-
#if !defined(BOOST_NO_IOSFWD)
|
|
30
|
-
#include <iosfwd> // for std::basic_ostream
|
|
31
|
-
#else
|
|
32
|
-
#include <ostream>
|
|
33
|
-
#endif
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
namespace boost
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
// intrusive_ptr
|
|
42
|
-
//
|
|
43
|
-
// A smart pointer that uses intrusive reference counting.
|
|
44
|
-
//
|
|
45
|
-
// Relies on unqualified calls to
|
|
46
|
-
//
|
|
47
|
-
// void intrusive_ptr_add_ref(T * p);
|
|
48
|
-
// void intrusive_ptr_release(T * p);
|
|
49
|
-
//
|
|
50
|
-
// (p != 0)
|
|
51
|
-
//
|
|
52
|
-
// The object is responsible for destroying itself.
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
template<class T> class intrusive_ptr
|
|
56
|
-
{
|
|
57
|
-
private:
|
|
58
|
-
|
|
59
|
-
typedef intrusive_ptr this_type;
|
|
60
|
-
|
|
61
|
-
public:
|
|
62
|
-
|
|
63
|
-
typedef T element_type;
|
|
64
|
-
|
|
65
|
-
BOOST_CONSTEXPR intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 )
|
|
66
|
-
{
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
intrusive_ptr( T * p, bool add_ref = true ): px( p )
|
|
70
|
-
{
|
|
71
|
-
if( px != 0 && add_ref ) intrusive_ptr_add_ref( px );
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
|
75
|
-
|
|
76
|
-
template<class U>
|
|
77
|
-
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
|
78
|
-
|
|
79
|
-
intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() )
|
|
80
|
-
|
|
81
|
-
#else
|
|
82
|
-
|
|
83
|
-
intrusive_ptr( intrusive_ptr<U> const & rhs )
|
|
84
|
-
|
|
85
|
-
#endif
|
|
86
|
-
: px( rhs.get() )
|
|
87
|
-
{
|
|
88
|
-
if( px != 0 ) intrusive_ptr_add_ref( px );
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#endif
|
|
92
|
-
|
|
93
|
-
intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px )
|
|
94
|
-
{
|
|
95
|
-
if( px != 0 ) intrusive_ptr_add_ref( px );
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
~intrusive_ptr()
|
|
99
|
-
{
|
|
100
|
-
if( px != 0 ) intrusive_ptr_release( px );
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
|
104
|
-
|
|
105
|
-
template<class U> intrusive_ptr & operator=(intrusive_ptr<U> const & rhs)
|
|
106
|
-
{
|
|
107
|
-
this_type(rhs).swap(*this);
|
|
108
|
-
return *this;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
#endif
|
|
112
|
-
|
|
113
|
-
// Move support
|
|
114
|
-
|
|
115
|
-
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
116
|
-
|
|
117
|
-
intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px )
|
|
118
|
-
{
|
|
119
|
-
rhs.px = 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT
|
|
123
|
-
{
|
|
124
|
-
this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
|
|
125
|
-
return *this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
template<class U> friend class intrusive_ptr;
|
|
129
|
-
|
|
130
|
-
template<class U>
|
|
131
|
-
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
|
132
|
-
|
|
133
|
-
intrusive_ptr(intrusive_ptr<U> && rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty())
|
|
134
|
-
|
|
135
|
-
#else
|
|
136
|
-
|
|
137
|
-
intrusive_ptr(intrusive_ptr<U> && rhs)
|
|
138
|
-
|
|
139
|
-
#endif
|
|
140
|
-
: px( rhs.px )
|
|
141
|
-
{
|
|
142
|
-
rhs.px = 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
template<class U>
|
|
146
|
-
intrusive_ptr & operator=(intrusive_ptr<U> && rhs) BOOST_SP_NOEXCEPT
|
|
147
|
-
{
|
|
148
|
-
this_type( static_cast< intrusive_ptr<U> && >( rhs ) ).swap(*this);
|
|
149
|
-
return *this;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
#endif
|
|
153
|
-
|
|
154
|
-
intrusive_ptr & operator=(intrusive_ptr const & rhs)
|
|
155
|
-
{
|
|
156
|
-
this_type(rhs).swap(*this);
|
|
157
|
-
return *this;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
intrusive_ptr & operator=(T * rhs)
|
|
161
|
-
{
|
|
162
|
-
this_type(rhs).swap(*this);
|
|
163
|
-
return *this;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
void reset()
|
|
167
|
-
{
|
|
168
|
-
this_type().swap( *this );
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
void reset( T * rhs )
|
|
172
|
-
{
|
|
173
|
-
this_type( rhs ).swap( *this );
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
void reset( T * rhs, bool add_ref )
|
|
177
|
-
{
|
|
178
|
-
this_type( rhs, add_ref ).swap( *this );
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
T * get() const BOOST_SP_NOEXCEPT
|
|
182
|
-
{
|
|
183
|
-
return px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
T * detach() BOOST_SP_NOEXCEPT
|
|
187
|
-
{
|
|
188
|
-
T * ret = px;
|
|
189
|
-
px = 0;
|
|
190
|
-
return ret;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
T & operator*() const BOOST_SP_NOEXCEPT_WITH_ASSERT
|
|
194
|
-
{
|
|
195
|
-
BOOST_ASSERT( px != 0 );
|
|
196
|
-
return *px;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
T * operator->() const BOOST_SP_NOEXCEPT_WITH_ASSERT
|
|
200
|
-
{
|
|
201
|
-
BOOST_ASSERT( px != 0 );
|
|
202
|
-
return px;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// implicit conversion to "bool"
|
|
206
|
-
#include <boost/smart_ptr/detail/operator_bool.hpp>
|
|
207
|
-
|
|
208
|
-
void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT
|
|
209
|
-
{
|
|
210
|
-
T * tmp = px;
|
|
211
|
-
px = rhs.px;
|
|
212
|
-
rhs.px = tmp;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
private:
|
|
216
|
-
|
|
217
|
-
T * px;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT
|
|
221
|
-
{
|
|
222
|
-
return a.get() == b.get();
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT
|
|
226
|
-
{
|
|
227
|
-
return a.get() != b.get();
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT
|
|
231
|
-
{
|
|
232
|
-
return a.get() == b;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT
|
|
236
|
-
{
|
|
237
|
-
return a.get() != b;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT
|
|
241
|
-
{
|
|
242
|
-
return a == b.get();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT
|
|
246
|
-
{
|
|
247
|
-
return a != b.get();
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
|
251
|
-
|
|
252
|
-
// Resolve the ambiguity between our op!= and the one in rel_ops
|
|
253
|
-
|
|
254
|
-
template<class T> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
255
|
-
{
|
|
256
|
-
return a.get() != b.get();
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
#endif
|
|
260
|
-
|
|
261
|
-
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
|
262
|
-
|
|
263
|
-
template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
|
264
|
-
{
|
|
265
|
-
return p.get() == 0;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
template<class T> inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT
|
|
269
|
-
{
|
|
270
|
-
return p.get() == 0;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
template<class T> inline bool operator!=( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
|
274
|
-
{
|
|
275
|
-
return p.get() != 0;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT
|
|
279
|
-
{
|
|
280
|
-
return p.get() != 0;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
#endif
|
|
284
|
-
|
|
285
|
-
template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
286
|
-
{
|
|
287
|
-
return std::less<T *>()(a.get(), b.get());
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs) BOOST_SP_NOEXCEPT
|
|
291
|
-
{
|
|
292
|
-
lhs.swap(rhs);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// mem_fn support
|
|
296
|
-
|
|
297
|
-
template<class T> T * get_pointer(intrusive_ptr<T> const & p) BOOST_SP_NOEXCEPT
|
|
298
|
-
{
|
|
299
|
-
return p.get();
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// pointer casts
|
|
303
|
-
|
|
304
|
-
template<class T, class U> intrusive_ptr<T> static_pointer_cast(intrusive_ptr<U> const & p)
|
|
305
|
-
{
|
|
306
|
-
return static_cast<T *>(p.get());
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
template<class T, class U> intrusive_ptr<T> const_pointer_cast(intrusive_ptr<U> const & p)
|
|
310
|
-
{
|
|
311
|
-
return const_cast<T *>(p.get());
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U> const & p)
|
|
315
|
-
{
|
|
316
|
-
return dynamic_cast<T *>(p.get());
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
320
|
-
|
|
321
|
-
template<class T, class U> intrusive_ptr<T> static_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT
|
|
322
|
-
{
|
|
323
|
-
return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false );
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
template<class T, class U> intrusive_ptr<T> const_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT
|
|
327
|
-
{
|
|
328
|
-
return intrusive_ptr<T>( const_cast<T*>( p.detach() ), false );
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT
|
|
332
|
-
{
|
|
333
|
-
T * p2 = dynamic_cast<T*>( p.get() );
|
|
334
|
-
|
|
335
|
-
intrusive_ptr<T> r( p2, false );
|
|
336
|
-
|
|
337
|
-
if( p2 ) p.detach();
|
|
338
|
-
|
|
339
|
-
return r;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
#endif // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
343
|
-
|
|
344
|
-
// operator<<
|
|
345
|
-
|
|
346
|
-
#if !defined(BOOST_NO_IOSTREAM)
|
|
347
|
-
|
|
348
|
-
#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )
|
|
349
|
-
|
|
350
|
-
template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
|
|
351
|
-
{
|
|
352
|
-
os << p.get();
|
|
353
|
-
return os;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
#else
|
|
357
|
-
|
|
358
|
-
// in STLport's no-iostreams mode no iostream symbols can be used
|
|
359
|
-
#ifndef _STLP_NO_IOSTREAMS
|
|
360
|
-
|
|
361
|
-
# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT)
|
|
362
|
-
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
|
|
363
|
-
using std::basic_ostream;
|
|
364
|
-
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
|
|
365
|
-
# else
|
|
366
|
-
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
|
|
367
|
-
# endif
|
|
368
|
-
{
|
|
369
|
-
os << p.get();
|
|
370
|
-
return os;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
#endif // _STLP_NO_IOSTREAMS
|
|
374
|
-
|
|
375
|
-
#endif // __GNUC__ < 3
|
|
376
|
-
|
|
377
|
-
#endif // !defined(BOOST_NO_IOSTREAM)
|
|
378
|
-
|
|
379
|
-
// hash_value
|
|
380
|
-
|
|
381
|
-
template< class T > struct hash;
|
|
382
|
-
|
|
383
|
-
template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT
|
|
384
|
-
{
|
|
385
|
-
return boost::hash< T* >()( p.get() );
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
} // namespace boost
|
|
389
|
-
|
|
390
|
-
// std::hash
|
|
391
|
-
|
|
392
|
-
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
|
393
|
-
|
|
394
|
-
namespace std
|
|
395
|
-
{
|
|
396
|
-
|
|
397
|
-
template<class T> struct hash< ::boost::intrusive_ptr<T> >
|
|
398
|
-
{
|
|
399
|
-
std::size_t operator()( ::boost::intrusive_ptr<T> const & p ) const BOOST_SP_NOEXCEPT
|
|
400
|
-
{
|
|
401
|
-
return std::hash< T* >()( p.get() );
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
} // namespace std
|
|
406
|
-
|
|
407
|
-
#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
|
408
|
-
|
|
409
|
-
#endif // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Andrey Semashev 2007 - 2013.
|
|
3
|
-
* Distributed under the Boost Software License, Version 1.0.
|
|
4
|
-
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
5
|
-
* http://www.boost.org/LICENSE_1_0.txt)
|
|
6
|
-
*/
|
|
7
|
-
/*!
|
|
8
|
-
* \file intrusive_ref_counter.hpp
|
|
9
|
-
* \author Andrey Semashev
|
|
10
|
-
* \date 12.03.2009
|
|
11
|
-
*
|
|
12
|
-
* This header contains a reference counter class for \c intrusive_ptr.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
#ifndef BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
|
|
16
|
-
#define BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
|
|
17
|
-
|
|
18
|
-
#include <boost/config.hpp>
|
|
19
|
-
#include <boost/smart_ptr/detail/atomic_count.hpp>
|
|
20
|
-
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
|
21
|
-
|
|
22
|
-
#ifdef BOOST_HAS_PRAGMA_ONCE
|
|
23
|
-
#pragma once
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
|
-
#if defined(_MSC_VER)
|
|
27
|
-
#pragma warning(push)
|
|
28
|
-
// This is a bogus MSVC warning, which is flagged by friend declarations of intrusive_ptr_add_ref and intrusive_ptr_release in intrusive_ref_counter:
|
|
29
|
-
// 'name' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
|
|
30
|
-
// Note that there is no inline specifier in the declarations.
|
|
31
|
-
#pragma warning(disable: 4396)
|
|
32
|
-
#endif
|
|
33
|
-
|
|
34
|
-
namespace boost {
|
|
35
|
-
|
|
36
|
-
namespace sp_adl_block {
|
|
37
|
-
|
|
38
|
-
/*!
|
|
39
|
-
* \brief Thread unsafe reference counter policy for \c intrusive_ref_counter
|
|
40
|
-
*
|
|
41
|
-
* The policy instructs the \c intrusive_ref_counter base class to implement
|
|
42
|
-
* a reference counter suitable for single threaded use only. Pointers to the same
|
|
43
|
-
* object with this kind of reference counter must not be used by different threads.
|
|
44
|
-
*/
|
|
45
|
-
struct thread_unsafe_counter
|
|
46
|
-
{
|
|
47
|
-
typedef unsigned int type;
|
|
48
|
-
|
|
49
|
-
static unsigned int load(unsigned int const& counter) BOOST_SP_NOEXCEPT
|
|
50
|
-
{
|
|
51
|
-
return counter;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static void increment(unsigned int& counter) BOOST_SP_NOEXCEPT
|
|
55
|
-
{
|
|
56
|
-
++counter;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static unsigned int decrement(unsigned int& counter) BOOST_SP_NOEXCEPT
|
|
60
|
-
{
|
|
61
|
-
return --counter;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/*!
|
|
66
|
-
* \brief Thread safe reference counter policy for \c intrusive_ref_counter
|
|
67
|
-
*
|
|
68
|
-
* The policy instructs the \c intrusive_ref_counter base class to implement
|
|
69
|
-
* a thread-safe reference counter, if the target platform supports multithreading.
|
|
70
|
-
*/
|
|
71
|
-
struct thread_safe_counter
|
|
72
|
-
{
|
|
73
|
-
typedef boost::detail::atomic_count type;
|
|
74
|
-
|
|
75
|
-
static unsigned int load(boost::detail::atomic_count const& counter) BOOST_SP_NOEXCEPT
|
|
76
|
-
{
|
|
77
|
-
return static_cast< unsigned int >(static_cast< long >(counter));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static void increment(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
|
|
81
|
-
{
|
|
82
|
-
++counter;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
static unsigned int decrement(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
|
|
86
|
-
{
|
|
87
|
-
return static_cast< unsigned int >(--counter);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
template< typename DerivedT, typename CounterPolicyT = thread_safe_counter >
|
|
92
|
-
class intrusive_ref_counter;
|
|
93
|
-
|
|
94
|
-
template< typename DerivedT, typename CounterPolicyT >
|
|
95
|
-
void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
|
|
96
|
-
template< typename DerivedT, typename CounterPolicyT >
|
|
97
|
-
void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
|
|
98
|
-
|
|
99
|
-
/*!
|
|
100
|
-
* \brief A reference counter base class
|
|
101
|
-
*
|
|
102
|
-
* This base class can be used with user-defined classes to add support
|
|
103
|
-
* for \c intrusive_ptr. The class contains a reference counter defined by the \c CounterPolicyT.
|
|
104
|
-
* Upon releasing the last \c intrusive_ptr referencing the object
|
|
105
|
-
* derived from the \c intrusive_ref_counter class, operator \c delete
|
|
106
|
-
* is automatically called on the pointer to the object.
|
|
107
|
-
*
|
|
108
|
-
* The other template parameter, \c DerivedT, is the user's class that derives from \c intrusive_ref_counter.
|
|
109
|
-
*/
|
|
110
|
-
template< typename DerivedT, typename CounterPolicyT >
|
|
111
|
-
class intrusive_ref_counter
|
|
112
|
-
{
|
|
113
|
-
private:
|
|
114
|
-
//! Reference counter type
|
|
115
|
-
typedef typename CounterPolicyT::type counter_type;
|
|
116
|
-
//! Reference counter
|
|
117
|
-
mutable counter_type m_ref_counter;
|
|
118
|
-
|
|
119
|
-
public:
|
|
120
|
-
/*!
|
|
121
|
-
* Default constructor
|
|
122
|
-
*
|
|
123
|
-
* \post <tt>use_count() == 0</tt>
|
|
124
|
-
*/
|
|
125
|
-
intrusive_ref_counter() BOOST_SP_NOEXCEPT : m_ref_counter(0)
|
|
126
|
-
{
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/*!
|
|
130
|
-
* Copy constructor
|
|
131
|
-
*
|
|
132
|
-
* \post <tt>use_count() == 0</tt>
|
|
133
|
-
*/
|
|
134
|
-
intrusive_ref_counter(intrusive_ref_counter const&) BOOST_SP_NOEXCEPT : m_ref_counter(0)
|
|
135
|
-
{
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/*!
|
|
139
|
-
* Assignment
|
|
140
|
-
*
|
|
141
|
-
* \post The reference counter is not modified after assignment
|
|
142
|
-
*/
|
|
143
|
-
intrusive_ref_counter& operator= (intrusive_ref_counter const&) BOOST_SP_NOEXCEPT { return *this; }
|
|
144
|
-
|
|
145
|
-
/*!
|
|
146
|
-
* \return The reference counter
|
|
147
|
-
*/
|
|
148
|
-
unsigned int use_count() const BOOST_SP_NOEXCEPT
|
|
149
|
-
{
|
|
150
|
-
return CounterPolicyT::load(m_ref_counter);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
protected:
|
|
154
|
-
/*!
|
|
155
|
-
* Destructor
|
|
156
|
-
*/
|
|
157
|
-
BOOST_DEFAULTED_FUNCTION(~intrusive_ref_counter(), {})
|
|
158
|
-
|
|
159
|
-
friend void intrusive_ptr_add_ref< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
|
|
160
|
-
friend void intrusive_ptr_release< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
template< typename DerivedT, typename CounterPolicyT >
|
|
164
|
-
inline void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT
|
|
165
|
-
{
|
|
166
|
-
CounterPolicyT::increment(p->m_ref_counter);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
template< typename DerivedT, typename CounterPolicyT >
|
|
170
|
-
inline void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT
|
|
171
|
-
{
|
|
172
|
-
if (CounterPolicyT::decrement(p->m_ref_counter) == 0)
|
|
173
|
-
delete static_cast< const DerivedT* >(p);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
} // namespace sp_adl_block
|
|
177
|
-
|
|
178
|
-
using sp_adl_block::intrusive_ref_counter;
|
|
179
|
-
using sp_adl_block::thread_unsafe_counter;
|
|
180
|
-
using sp_adl_block::thread_safe_counter;
|
|
181
|
-
|
|
182
|
-
} // namespace boost
|
|
183
|
-
|
|
184
|
-
#if defined(_MSC_VER)
|
|
185
|
-
#pragma warning(pop)
|
|
186
|
-
#endif
|
|
187
|
-
|
|
188
|
-
#endif // BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
|