alternative Standard Libary  0.29.8
std::intrusive_list< T > Template-Klassenreferenz

#include <intrusive_list.hpp>

+ Klassendiagramm für std::intrusive_list< T >:
+ Zusammengehörigkeiten von std::intrusive_list< T >:

Öffentliche Typen

using node_type = T
 
using value_type = T
 
using iterator = intrusive_list_iterator< T *, T & >
 
using const_iterator = intrusive_list_iterator< const T *, const T & >
 
using size_type = int
 

Öffentliche Methoden

 intrusive_list ()
 
void push_back (value_type *v)
 
void push_front (value_type *v)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
value_typefront ()
 
const value_typefront () const
 
value_typeback ()
 
const value_typeback () const
 
iterator insert (iterator pos, value_type *v)
 
iterator erase (iterator it)
 
iterator erase (iterator first, iterator last)
 
void clear ()
 
void pop_back ()
 
void pop_front ()
 
size_type size () const
 
bool empty () const
 

Öffentliche, statische Methoden

static void remove (value_type *v)
 

Geschützte, statische Methoden

static void link (intrusive_list_node *node, intrusive_list_node *nextNode)
 
static void unlink (intrusive_list_node *node)
 

Geschützte Attribute

intrusive_list_node m_root
 

Ausführliche Beschreibung

template<class T>
class std::intrusive_list< T >

Dokumentation der benutzerdefinierten Datentypen

◆ const_iterator

template<class T >
using std::intrusive_list< T >::const_iterator = intrusive_list_iterator<const T*, const T&>

◆ iterator

template<class T >
using std::intrusive_list< T >::iterator = intrusive_list_iterator<T*, T&>

◆ node_type

template<class T >
using std::intrusive_list< T >::node_type = T

◆ size_type

using std::intrusive_list_base::size_type = int
inherited

◆ value_type

template<class T >
using std::intrusive_list< T >::value_type = T

Beschreibung der Konstruktoren und Destruktoren

◆ intrusive_list()

template<class T >
std::intrusive_list< T >::intrusive_list ( )
inline
158  {
159  intrusive_list_node* testNode((T*)0);
160  static_cast<void>(sizeof(testNode));
161  }
intrusive_list_base()
Definition: intrusive_list.cpp:29

Dokumentation der Elementfunktionen

◆ back() [1/2]

template<class T >
value_type* std::intrusive_list< T >::back ( )
inline
197  {
198  return upcast(m_root.prev);
199  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_node * prev
Definition: intrusive_list.hpp:49

◆ back() [2/2]

template<class T >
const value_type* std::intrusive_list< T >::back ( ) const
inline
201  {
202  return upcast(m_root.prev);
203  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_node * prev
Definition: intrusive_list.hpp:49

◆ begin() [1/2]

template<class T >
iterator std::intrusive_list< T >::begin ( )
inline
173  {
174  return iterator(upcast(m_root.next));
175  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_iterator< T *, T & > iterator
Definition: intrusive_list.hpp:154

◆ begin() [2/2]

template<class T >
const_iterator std::intrusive_list< T >::begin ( ) const
inline
177  {
178  return const_iterator(upcast(m_root.next));
179  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_iterator< const T *, const T & > const_iterator
Definition: intrusive_list.hpp:155

◆ clear()

template<class T >
void std::intrusive_list< T >::clear ( )
inline
225  {
226  erase(begin(), end());
227  }
iterator erase(iterator it)
Definition: intrusive_list.hpp:210
iterator end()
Definition: intrusive_list.hpp:180
iterator begin()
Definition: intrusive_list.hpp:172

◆ empty()

bool std::intrusive_list_base::empty ( ) const
inlineinherited
133  {
134  return !m_root.in_list();
135  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
bool in_list() const
Definition: intrusive_list.hpp:46

◆ end() [1/2]

template<class T >
iterator std::intrusive_list< T >::end ( )
inline
181  {
182  return iterator(upcast(&m_root));
183  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_iterator< T *, T & > iterator
Definition: intrusive_list.hpp:154

◆ end() [2/2]

template<class T >
const_iterator std::intrusive_list< T >::end ( ) const
inline
185  {
186  return const_iterator(upcast(&m_root));
187  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
intrusive_list_iterator< const T *, const T & > const_iterator
Definition: intrusive_list.hpp:155

◆ erase() [1/2]

template<class T >
iterator std::intrusive_list< T >::erase ( iterator  it)
inline
211  {
212  iterator itErase(it);
213  ++it;
214  unlink(itErase.node());
215  return it;
216  }
intrusive_list_iterator< T *, T & > iterator
Definition: intrusive_list.hpp:154
static void unlink(intrusive_list_node *node)
Definition: intrusive_list.cpp:54

◆ erase() [2/2]

template<class T >
iterator std::intrusive_list< T >::erase ( iterator  first,
iterator  last 
)
inline
218  {
219  while (first != last)
220  first = erase(first);
221  return first;
222  }
iterator erase(iterator it)
Definition: intrusive_list.hpp:210

◆ front() [1/2]

template<class T >
value_type* std::intrusive_list< T >::front ( )
inline
189  {
190  return upcast(m_root.next);
191  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143

◆ front() [2/2]

template<class T >
const value_type* std::intrusive_list< T >::front ( ) const
inline
193  {
194  return upcast(m_root.next);
195  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143

◆ insert()

template<class T >
iterator std::intrusive_list< T >::insert ( iterator  pos,
value_type v 
)
inline
206  {
207  link(v, pos.node());
208  return iterator(v);
209  }
static void link(intrusive_list_node *node, intrusive_list_node *nextNode)
Definition: intrusive_list.cpp:46
intrusive_list_iterator< T *, T & > iterator
Definition: intrusive_list.hpp:154

◆ link()

void std::intrusive_list_base::link ( intrusive_list_node node,
intrusive_list_node nextNode 
)
staticprotectedinherited
47  {
48  assert(!node->in_list());
49  node->prev = nextNode->prev;
50  node->prev->next = node;
51  nextNode->prev = node;
52  node->next = nextNode;
53  }

◆ pop_back()

void std::intrusive_list_base::pop_back ( )
inlineinherited
123  {
124  unlink(m_root.prev);
125  }
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
static void unlink(intrusive_list_node *node)
Definition: intrusive_list.cpp:54
intrusive_list_node * prev
Definition: intrusive_list.hpp:49

◆ pop_front()

void std::intrusive_list_base::pop_front ( )
inlineinherited
127  {
128  unlink(m_root.next);
129  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
static void unlink(intrusive_list_node *node)
Definition: intrusive_list.cpp:54

◆ push_back()

template<class T >
void std::intrusive_list< T >::push_back ( value_type v)
inline
164  {
165  link(v, &m_root);
166  }
static void link(intrusive_list_node *node, intrusive_list_node *nextNode)
Definition: intrusive_list.cpp:46
intrusive_list_node m_root
Definition: intrusive_list.hpp:143

◆ push_front()

template<class T >
void std::intrusive_list< T >::push_front ( value_type v)
inline
168  {
169  link(v, m_root.next);
170  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
static void link(intrusive_list_node *node, intrusive_list_node *nextNode)
Definition: intrusive_list.cpp:46
intrusive_list_node m_root
Definition: intrusive_list.hpp:143

◆ remove()

template<class T >
static void std::intrusive_list< T >::remove ( value_type v)
inlinestatic
229  {
230  unlink(v);
231  }
static void unlink(intrusive_list_node *node)
Definition: intrusive_list.cpp:54

◆ size()

intrusive_list_base::size_type std::intrusive_list_base::size ( ) const
inherited
35  {
36  size_type numNodes(0);
37  const intrusive_list_node* iter = &m_root;
38  do
39  {
40  iter = iter->next;
41  ++numNodes;
42  } while (iter != &m_root);
43  return numNodes - 1;
44  }
intrusive_list_node * next
Definition: intrusive_list.hpp:48
intrusive_list_node m_root
Definition: intrusive_list.hpp:143
int size_type
Definition: intrusive_list.hpp:120

◆ unlink()

void std::intrusive_list_base::unlink ( intrusive_list_node node)
staticprotectedinherited
55  {
56  assert(node->in_list());
57  node->prev->next = node->next;
58  node->next->prev = node->prev;
59  node->next = node->prev = node;
60  }

Dokumentation der Datenelemente

◆ m_root

intrusive_list_node std::intrusive_list_base::m_root
protectedinherited

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: