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

#include <intrusive_slist.hpp>

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

Öffentliche Typen

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

Öffentliche Methoden

void push_front (value_type *v)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
value_typefront ()
 
const value_typefront () const
 
iterator insert (iterator pos, value_type *v)
 
iterator insert_after (iterator pos, value_type *v)
 
iterator erase (iterator pos)
 
void erase_after (iterator pos)
 
iterator erase (iterator first, iterator last)
 
void clear ()
 
void pop_front ()
 
size_type size () const
 
bool empty () const
 

Öffentliche, statische Methoden

static iterator previous (iterator nextIt)
 
static const_iterator previous (const_iterator nextIt)
 
static iterator get_iterator (value_type *v)
 
static const_iterator get_iterator (const value_type *v)
 
static void remove (value_type *v)
 

Geschützte, statische Methoden

static void link_after (intrusive_slist_node *node, intrusive_slist_node *prevNode)
 
static void unlink_after (intrusive_slist_node *node)
 

Geschützte Attribute

intrusive_slist_node m_root
 

Ausführliche Beschreibung

template<class T>
class std::intrusive_slist< T >

Dokumentation der benutzerdefinierten Datentypen

◆ const_iterator

template<class T >
using std::intrusive_slist< T >::const_iterator = intrusive_slist_iterator<const T*, const T&>

◆ iterator

template<class T >
using std::intrusive_slist< T >::iterator = intrusive_slist_iterator<T*, T&>

◆ node_type

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

◆ size_type

typedef int std::intrusive_slist_base::size_type
inherited

◆ value_type

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

Dokumentation der Elementfunktionen

◆ begin() [1/2]

template<class T >
iterator std::intrusive_slist< T >::begin ( )
inline
156  {
157  return iterator(upcast(m_root.next));
158  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_iterator< T *, T & > iterator
Definition: intrusive_slist.hpp:147
intrusive_slist_node * next
Definition: intrusive_slist.hpp:51

◆ begin() [2/2]

template<class T >
const_iterator std::intrusive_slist< T >::begin ( ) const
inline
160  {
161  return const_iterator(upcast(m_root.next));
162  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_node * next
Definition: intrusive_slist.hpp:51
intrusive_slist_iterator< const T *, const T & > const_iterator
Definition: intrusive_slist.hpp:148

◆ clear()

template<class T >
void std::intrusive_slist< T >::clear ( )
inline
244  {
245  erase(begin(), end());
246  }
iterator end()
Definition: intrusive_slist.hpp:163
iterator erase(iterator pos)
Definition: intrusive_slist.hpp:191
iterator begin()
Definition: intrusive_slist.hpp:155

◆ empty()

bool std::intrusive_slist_base::empty ( ) const
inlineinherited
127  {
128  return !m_root.in_list();
129  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
bool in_list() const
Definition: intrusive_slist.hpp:46

◆ end() [1/2]

template<class T >
iterator std::intrusive_slist< T >::end ( )
inline
164  {
165  return iterator(upcast(&m_root));
166  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_iterator< T *, T & > iterator
Definition: intrusive_slist.hpp:147

◆ end() [2/2]

template<class T >
const_iterator std::intrusive_slist< T >::end ( ) const
inline
168  {
169  return const_iterator(upcast(&m_root));
170  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_iterator< const T *, const T & > const_iterator
Definition: intrusive_slist.hpp:148

◆ erase() [1/2]

template<class T >
iterator std::intrusive_slist< T >::erase ( iterator  pos)
inline
192  {
193  pos = previous(pos);
194  erase_after(pos);
195  return ++pos;
196  }
static iterator previous(iterator nextIt)
Definition: intrusive_slist.hpp:203
void erase_after(iterator pos)
Definition: intrusive_slist.hpp:197

◆ erase() [2/2]

template<class T >
iterator std::intrusive_slist< T >::erase ( iterator  first,
iterator  last 
)
inline
233  {
234  if (first != last)
235  {
236  while (first.next() != last.node())
237  erase_after(first);
238  erase_after(previous(first));
239  }
240  return first;
241  }
static iterator previous(iterator nextIt)
Definition: intrusive_slist.hpp:203
void erase_after(iterator pos)
Definition: intrusive_slist.hpp:197

◆ erase_after()

template<class T >
void std::intrusive_slist< T >::erase_after ( iterator  pos)
inline
198  {
199  unlink_after(pos.node());
200  }
static void unlink_after(intrusive_slist_node *node)
Definition: intrusive_slist.cpp:51

◆ front() [1/2]

template<class T >
value_type* std::intrusive_slist< T >::front ( )
inline
173  {
174  return upcast(m_root.next);
175  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_node * next
Definition: intrusive_slist.hpp:51

◆ front() [2/2]

template<class T >
const value_type* std::intrusive_slist< T >::front ( ) const
inline
177  {
178  return upcast(m_root.next);
179  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_node * next
Definition: intrusive_slist.hpp:51

◆ get_iterator() [1/2]

template<class T >
static iterator std::intrusive_slist< T >::get_iterator ( value_type v)
inlinestatic
221  {
222  assert(v->in_list());
223  return iterator(v);
224  }
intrusive_slist_iterator< T *, T & > iterator
Definition: intrusive_slist.hpp:147

◆ get_iterator() [2/2]

template<class T >
static const_iterator std::intrusive_slist< T >::get_iterator ( const value_type v)
inlinestatic
227  {
228  assert(v->in_list());
229  return const_iterator(v);
230  }
intrusive_slist_iterator< const T *, const T & > const_iterator
Definition: intrusive_slist.hpp:148

◆ insert()

template<class T >
iterator std::intrusive_slist< T >::insert ( iterator  pos,
value_type v 
)
inline
182  {
183  return insert_after(previous(pos), v);
184  }
static iterator previous(iterator nextIt)
Definition: intrusive_slist.hpp:203
iterator insert_after(iterator pos, value_type *v)
Definition: intrusive_slist.hpp:185

◆ insert_after()

template<class T >
iterator std::intrusive_slist< T >::insert_after ( iterator  pos,
value_type v 
)
inline
186  {
187  link_after(v, pos.node());
188  return iterator(v);
189  }
intrusive_slist_iterator< T *, T & > iterator
Definition: intrusive_slist.hpp:147
static void link_after(intrusive_slist_node *node, intrusive_slist_node *prevNode)
Definition: intrusive_slist.cpp:45

◆ link_after()

void std::intrusive_slist_base::link_after ( intrusive_slist_node node,
intrusive_slist_node prevNode 
)
staticprotectedinherited
46  {
47  assert(!node->in_list());
48  node->next = prevNode->next;
49  prevNode->next = node;
50  }

◆ pop_front()

void std::intrusive_slist_base::pop_front ( )
inlineinherited
121  {
123  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
static void unlink_after(intrusive_slist_node *node)
Definition: intrusive_slist.cpp:51

◆ previous() [1/2]

template<class T >
static iterator std::intrusive_slist< T >::previous ( iterator  nextIt)
inlinestatic
204  {
205  assert(nextIt.node()->in_list());
206  iterator prevIt = nextIt;
207  while (nextIt.node() != prevIt.next())
208  ++prevIt;
209  return prevIt;
210  }
intrusive_slist_iterator< T *, T & > iterator
Definition: intrusive_slist.hpp:147

◆ previous() [2/2]

template<class T >
static const_iterator std::intrusive_slist< T >::previous ( const_iterator  nextIt)
inlinestatic
212  {
213  assert(nextIt.node()->in_list());
214  const_iterator prevIt = nextIt;
215  while (nextIt.node() != prevIt.next())
216  ++prevIt;
217  return prevIt;
218  }
intrusive_slist_iterator< const T *, const T & > const_iterator
Definition: intrusive_slist.hpp:148

◆ push_front()

template<class T >
void std::intrusive_slist< T >::push_front ( value_type v)
inline
151  {
152  link_after(v, &m_root);
153  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
static void link_after(intrusive_slist_node *node, intrusive_slist_node *prevNode)
Definition: intrusive_slist.cpp:45

◆ remove()

template<class T >
static void std::intrusive_slist< T >::remove ( value_type v)
inlinestatic
249  {
250  unlink(v);
251  }

◆ size()

intrusive_slist_base::size_type std::intrusive_slist_base::size ( ) const
inherited
34  {
35  size_type numNodes(0);
36  const intrusive_slist_node* iter = &m_root;
37  do
38  {
39  iter = iter->next;
40  ++numNodes;
41  } while (iter != &m_root);
42  return numNodes - 1;
43  }
intrusive_slist_node m_root
Definition: intrusive_slist.hpp:135
intrusive_slist_node * next
Definition: intrusive_slist.hpp:51
int size_type
Definition: intrusive_slist.hpp:117

◆ unlink_after()

void std::intrusive_slist_base::unlink_after ( intrusive_slist_node node)
staticprotectedinherited
52  {
53  assert(node->in_list());
54  intrusive_slist_node* thisNode = node->next;
55  node->next = thisNode->next;
56  thisNode->next = thisNode;
57  }

Dokumentation der Datenelemente

◆ m_root

intrusive_slist_node std::intrusive_slist_base::m_root
protectedinherited

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