/usr/include/oneapi/tbb/detail
NameSizeModeActions
_aggregator.h75620644editdlrm
_aligned_space.h13990644editdlrm
_allocator_traits.h38070644editdlrm
_assert.h23920644editdlrm
_concurrent_queue_base.h263600644editdlrm
_concurrent_skip_list.h466280644editdlrm
_concurrent_unordered_base.h646560644editdlrm
_config.h203820644editdlrm
_containers_helpers.h26270644editdlrm
_exception.h27150644editdlrm
_export.h11990644editdlrm
_flow_graph_body_impl.h127760644editdlrm
_flow_graph_cache_impl.h136150644editdlrm
_flow_graph_impl.h153600644editdlrm
_flow_graph_indexer_impl.h165290644editdlrm
_flow_graph_item_buffer_impl.h103590644editdlrm
_flow_graph_join_impl.h828860644editdlrm
_flow_graph_nodes_deduction.h95320644editdlrm
_flow_graph_node_impl.h275450644editdlrm
_flow_graph_node_set_impl.h101770644editdlrm
_flow_graph_tagged_buffer_impl.h103180644editdlrm
_flow_graph_trace_impl.h159740644editdlrm
_flow_graph_types_impl.h156230644editdlrm
_hash_compare.h44880644editdlrm
_intrusive_list_node.h14620644editdlrm
_machine.h130420644editdlrm
_mutex_common.h23470644editdlrm
_namespace_injection.h8150644editdlrm
_node_handle.h51730644editdlrm
_pipeline_filters.h159050644editdlrm
_pipeline_filters_deduction.h15290644editdlrm
_range_common.h46430644editdlrm
_rtm_mutex.h47850644editdlrm
_rtm_rw_mutex.h72100644editdlrm
_scoped_lock.h50090644editdlrm
_segment_table.h247500644editdlrm
_small_object_pool.h35740644editdlrm
_string_resource.h38720644editdlrm
_task.h71160644editdlrm
_task_handle.h36880644editdlrm
_template_helpers.h135170644editdlrm
_utils.h133180644editdlrm
_waitable_atomic.h35320644editdlrm
Edit: /usr/include/oneapi/tbb/detail/_node_handle.h (5173B)
/* Copyright (c) 2019-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef __TBB_detail__node_handle_H #define __TBB_detail__node_handle_H #include "_allocator_traits.h" #include "_assert.h" namespace tbb { namespace detail { namespace d1 { // A structure to access private node handle methods in internal TBB classes // Regular friend declaration is not convenient because classes which use node handle // can be placed in the different versioning namespaces. struct node_handle_accessor { template static typename NodeHandleType::node* get_node_ptr( NodeHandleType& nh ) { return nh.get_node_ptr(); } template static NodeHandleType construct( typename NodeHandleType::node* node_ptr ) { return NodeHandleType{node_ptr}; } template static void deactivate( NodeHandleType& nh ) { nh.deactivate(); } }; // struct node_handle_accessor template class node_handle_base { public: using allocator_type = Allocator; protected: using node = Node; using allocator_traits_type = tbb::detail::allocator_traits; public: node_handle_base() : my_node(nullptr), my_allocator() {} node_handle_base(node_handle_base&& nh) : my_node(nh.my_node), my_allocator(std::move(nh.my_allocator)) { nh.my_node = nullptr; } __TBB_nodiscard bool empty() const { return my_node == nullptr; } explicit operator bool() const { return my_node != nullptr; } ~node_handle_base() { internal_destroy(); } node_handle_base& operator=( node_handle_base&& nh ) { internal_destroy(); my_node = nh.my_node; move_assign_allocators(my_allocator, nh.my_allocator); nh.deactivate(); return *this; } void swap( node_handle_base& nh ) { using std::swap; swap(my_node, nh.my_node); swap_allocators(my_allocator, nh.my_allocator); } allocator_type get_allocator() const { return my_allocator; } protected: node_handle_base( node* n ) : my_node(n) {} void internal_destroy() { if(my_node != nullptr) { allocator_traits_type::destroy(my_allocator, my_node->storage()); typename allocator_traits_type::template rebind_alloc node_allocator(my_allocator); node_allocator.deallocate(my_node, 1); } } node* get_node_ptr() { return my_node; } void deactivate() { my_node = nullptr; } node* my_node; allocator_type my_allocator; }; // node handle for maps template class node_handle : public node_handle_base { using base_type = node_handle_base; public: using key_type = Key; using mapped_type = typename Value::second_type; using allocator_type = typename base_type::allocator_type; node_handle() = default; key_type& key() const { __TBB_ASSERT(!this->empty(), "Cannot get key from the empty node_type object"); return *const_cast(&(this->my_node->value().first)); } mapped_type& mapped() const { __TBB_ASSERT(!this->empty(), "Cannot get mapped value from the empty node_type object"); return this->my_node->value().second; } private: friend struct node_handle_accessor; node_handle( typename base_type::node* n ) : base_type(n) {} }; // class node_handle // node handle for sets template class node_handle : public node_handle_base { using base_type = node_handle_base; public: using value_type = Key; using allocator_type = typename base_type::allocator_type; node_handle() = default; value_type& value() const { __TBB_ASSERT(!this->empty(), "Cannot get value from the empty node_type object"); return *const_cast(&(this->my_node->value())); } private: friend struct node_handle_accessor; node_handle( typename base_type::node* n ) : base_type(n) {} }; // class node_handle template void swap( node_handle& lhs, node_handle& rhs ) { return lhs.swap(rhs); } } // namespace d1 } // namespace detail } // namespace tbb #endif // __TBB_detail__node_handle_H