File indexing completed on 2025-01-18 09:38:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_INTRUSIVE_ANY_HOOK_HPP
0014 #define BOOST_INTRUSIVE_ANY_HOOK_HPP
0015
0016 #include <boost/intrusive/detail/config_begin.hpp>
0017 #include <boost/intrusive/intrusive_fwd.hpp>
0018 #include <boost/intrusive/detail/any_node_and_algorithms.hpp>
0019 #include <boost/intrusive/options.hpp>
0020 #include <boost/intrusive/detail/generic_hook.hpp>
0021 #include <boost/intrusive/detail/mpl.hpp>
0022 #include <boost/intrusive/pointer_rebind.hpp>
0023
0024 #if defined(BOOST_HAS_PRAGMA_ONCE)
0025 # pragma once
0026 #endif
0027
0028 namespace boost {
0029 namespace intrusive {
0030
0031
0032
0033 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0034 template<class ...Options>
0035 #else
0036 template<class O1 = void, class O2 = void, class O3 = void>
0037 #endif
0038 struct make_any_base_hook
0039 {
0040
0041 typedef typename pack_options
0042 < hook_defaults,
0043 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0044 O1, O2, O3
0045 #else
0046 Options...
0047 #endif
0048 >::type packed_options;
0049
0050 typedef generic_hook
0051 < AnyAlgorithm
0052 , any_node_traits<typename packed_options::void_pointer>
0053 , typename packed_options::tag
0054 , packed_options::link_mode
0055 , AnyBaseHookId
0056 > implementation_defined;
0057
0058 typedef implementation_defined type;
0059 };
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0077 template<class ...Options>
0078 #else
0079 template<class O1, class O2, class O3>
0080 #endif
0081 class any_base_hook
0082 : public make_any_base_hook
0083 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0084 <O1, O2, O3>
0085 #else
0086 <Options...>
0087 #endif
0088 ::type
0089 {
0090 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0091 public:
0092
0093
0094
0095
0096 any_base_hook();
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 any_base_hook(const any_base_hook& );
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117 any_base_hook& operator=(const any_base_hook& );
0118
0119
0120
0121
0122
0123
0124 ~any_base_hook();
0125
0126
0127
0128
0129
0130
0131
0132
0133 bool is_linked() const;
0134 #endif
0135 };
0136
0137
0138
0139 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0140 template<class ...Options>
0141 #else
0142 template<class O1 = void, class O2 = void, class O3 = void>
0143 #endif
0144 struct make_any_member_hook
0145 {
0146
0147 typedef typename pack_options
0148 < hook_defaults,
0149 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0150 O1, O2, O3
0151 #else
0152 Options...
0153 #endif
0154 >::type packed_options;
0155
0156 typedef generic_hook
0157 < AnyAlgorithm
0158 , any_node_traits<typename packed_options::void_pointer>
0159 , member_tag
0160 , packed_options::link_mode
0161 , NoBaseHookId
0162 > implementation_defined;
0163
0164 typedef implementation_defined type;
0165 };
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0178 template<class ...Options>
0179 #else
0180 template<class O1, class O2, class O3>
0181 #endif
0182 class any_member_hook
0183 : public make_any_member_hook
0184 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0185 <O1, O2, O3>
0186 #else
0187 <Options...>
0188 #endif
0189 ::type
0190 {
0191 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0192 public:
0193
0194
0195
0196
0197 any_member_hook() BOOST_NOEXCEPT;
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208 any_member_hook(const any_member_hook&) BOOST_NOEXCEPT;
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218 any_member_hook& operator=(const any_member_hook&) BOOST_NOEXCEPT;
0219
0220
0221
0222
0223
0224
0225 ~any_member_hook();
0226
0227
0228
0229
0230
0231
0232
0233
0234 bool is_linked() const BOOST_NOEXCEPT;
0235 #endif
0236 };
0237
0238
0239
0240 namespace detail{
0241
0242 BOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(old_proto_value_traits_base_hook, hooktags::is_base_hook)
0243
0244
0245
0246 template<class BasicHook, template <class> class NodeTraits>
0247 struct any_to_some_hook
0248 {
0249 typedef typename BasicHook::template pack<empty>::proto_value_traits old_proto_value_traits;
0250
0251 template<class Base>
0252 struct pack : public Base
0253 {
0254 struct proto_value_traits
0255 {
0256
0257
0258 struct hooktags
0259 {
0260 static const bool is_base_hook = old_proto_value_traits_base_hook_bool_is_true
0261 <old_proto_value_traits>::value;
0262 };
0263
0264 typedef old_proto_value_traits basic_hook_t;
0265 static const bool is_any_hook = true;
0266
0267 template<class VoidPtr>
0268 struct node_traits_from_voidptr
0269 { typedef NodeTraits<VoidPtr> type; };
0270 };
0271 };
0272 };
0273
0274 }
0275
0276
0277
0278
0279
0280 template<class BasicHook>
0281 struct any_to_slist_hook
0282
0283 : public detail::any_to_some_hook<BasicHook, any_slist_node_traits>
0284
0285 {};
0286
0287
0288
0289 template<class BasicHook>
0290 struct any_to_list_hook
0291
0292 : public detail::any_to_some_hook<BasicHook, any_list_node_traits>
0293
0294 {};
0295
0296
0297
0298 template<class BasicHook>
0299 struct any_to_set_hook
0300
0301 : public detail::any_to_some_hook<BasicHook, any_rbtree_node_traits>
0302
0303 {};
0304
0305
0306
0307 template<class BasicHook>
0308 struct any_to_avl_set_hook
0309
0310 : public detail::any_to_some_hook<BasicHook, any_avltree_node_traits>
0311
0312 {};
0313
0314
0315
0316 template<class BasicHook>
0317 struct any_to_bs_set_hook
0318
0319 : public detail::any_to_some_hook<BasicHook, any_tree_node_traits>
0320
0321 {};
0322
0323
0324
0325 template<class BasicHook>
0326 struct any_to_unordered_set_hook
0327
0328 : public detail::any_to_some_hook<BasicHook, any_unordered_node_traits>
0329
0330 {};
0331
0332
0333 }
0334 }
0335
0336 #include <boost/intrusive/detail/config_end.hpp>
0337
0338 #endif