Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::memptr_intrusive_list< T, U, NodePtr > Class Template Reference

Double linked list of items of type T containing a member of type intrusive_list_node. More...

#include <intrusive_list.h>

Inheritance diagram for tbb::internal::memptr_intrusive_list< T, U, NodePtr >:
Collaboration diagram for tbb::internal::memptr_intrusive_list< T, U, NodePtr >:

Static Private Member Functions

static intrusive_list_nodenode (T &val)
 
static T & item (intrusive_list_node *node)
 

Friends

class intrusive_list_base< memptr_intrusive_list< T, U, NodePtr >, T >
 

Additional Inherited Members

- Public Member Functions inherited from tbb::internal::intrusive_list_base< memptr_intrusive_list< T, U, NodePtr >, T >
 intrusive_list_base ()
 
bool empty () const
 
size_t size () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void push_front (T &val)
 
void remove (T &val)
 
iterator erase (iterator it)
 

Detailed Description

template<class T, class U, intrusive_list_node U::* NodePtr>
class tbb::internal::memptr_intrusive_list< T, U, NodePtr >

Double linked list of items of type T containing a member of type intrusive_list_node.

NodePtr is a member pointer to the node data field. Class U is either T or a base class of T containing the node member. Default values exist for the sake of a partial specialization working with inheritance case.

The list does not have ownership of its items. Its purpose is to avoid dynamic memory allocation when forming lists of existing objects.

The class is not thread safe.

Definition at line 209 of file intrusive_list.h.

Member Function Documentation

◆ item()

template<class T , class U , intrusive_list_node U::* NodePtr>
static T& tbb::internal::memptr_intrusive_list< T, U, NodePtr >::item ( intrusive_list_node node)
inlinestaticprivate

Definition at line 215 of file intrusive_list.h.

215  {
216  // Cannot use __TBB_offsetof (and consequently __TBB_get_object_ref) macro
217  // with *NodePtr argument because gcc refuses to interpret pasted "->" and "*"
218  // as member pointer dereferencing operator, and explicit usage of ## in
219  // __TBB_offsetof implementation breaks operations with normal member names.
220  return *reinterpret_cast<T*>((char*)node - ((ptrdiff_t)&(reinterpret_cast<T*>(0x1000)->*NodePtr) - 0x1000));
221  }

References tbb::internal::memptr_intrusive_list< T, U, NodePtr >::node().

Here is the call graph for this function:

◆ node()

template<class T , class U , intrusive_list_node U::* NodePtr>
static intrusive_list_node& tbb::internal::memptr_intrusive_list< T, U, NodePtr >::node ( T &  val)
inlinestaticprivate

Definition at line 213 of file intrusive_list.h.

213 { return val.*NodePtr; }

Referenced by tbb::internal::memptr_intrusive_list< T, U, NodePtr >::item().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ intrusive_list_base< memptr_intrusive_list< T, U, NodePtr >, T >

template<class T , class U , intrusive_list_node U::* NodePtr>
friend class intrusive_list_base< memptr_intrusive_list< T, U, NodePtr >, T >
friend

Definition at line 211 of file intrusive_list.h.


The documentation for this class was generated from the following file:
tbb::internal::memptr_intrusive_list::node
static intrusive_list_node & node(T &val)
Definition: intrusive_list.h:213

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.