Home ⌂Doc Index ◂Up ▴
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)
 
static const T & item (const intrusive_list_node *node)
 

Friends

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

Additional Inherited Members

- Public Types inherited from tbb::internal::intrusive_list_base< memptr_intrusive_list< T, U, NodePtr >, T >
typedef iterator_impl< T > iterator
 
typedef iterator_impl< const T > const_iterator
 
- 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 199 of file intrusive_list.h.

Member Function Documentation

◆ item() [1/2]

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 205 of file intrusive_list.h.

205  {
206  // Cannot use __TBB_offsetof (and consequently __TBB_get_object_ref) macro
207  // with *NodePtr argument because gcc refuses to interpret pasted "->" and "*"
208  // as member pointer dereferencing operator, and explicit usage of ## in
209  // __TBB_offsetof implementation breaks operations with normal member names.
210  return *reinterpret_cast<T*>((char*)node - ((ptrdiff_t)&(reinterpret_cast<T*>(0x1000)->*NodePtr) - 0x1000));
211  }
static intrusive_list_node & node(T &val)

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ item() [2/2]

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

Definition at line 213 of file intrusive_list.h.

213  {
214  return item(const_cast<intrusive_list_node*>(node));
215  }
static T & item(intrusive_list_node *node)
static intrusive_list_node & node(T &val)

References tbb::internal::memptr_intrusive_list< T, U, NodePtr >::item(), and 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 203 of file intrusive_list.h.

203 { 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 201 of file intrusive_list.h.


The documentation for this class was generated from the following file:

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.