Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
dart::IntrusiveDList< T, N > Class Template Reference

#include <intrusive_dlist.h>

Classes

class  Iterator
 

Public Types

typedef IntrusiveDListEntry< T, NEntry
 

Public Member Functions

 IntrusiveDList ()
 
void Append (T *a)
 
void Prepend (T *a)
 
bool IsInList (T *a) const
 
void Remove (T *a)
 
bool IsEmpty () const
 
TFirst () const
 
TLast () const
 
TRemoveFirst ()
 
TRemoveLast ()
 
Iterator< T, NBegin ()
 
Iterator< T, NEnd ()
 
Iterator< T, Nbegin ()
 
Iterator< T, Nend ()
 
Iterator< T, NErase (const Iterator< T, N > &iterator)
 
bool ContainsForDebugging (const T *a)
 
void AppendList (IntrusiveDList< T, N > *other)
 

Detailed Description

template<typename T, int N = 1>
class dart::IntrusiveDList< T, N >

Definition at line 135 of file intrusive_dlist.h.

Member Typedef Documentation

◆ Entry

template<typename T , int N = 1>
typedef IntrusiveDListEntry<T, N> dart::IntrusiveDList< T, N >::Entry

Definition at line 137 of file intrusive_dlist.h.

Constructor & Destructor Documentation

◆ IntrusiveDList()

template<typename T , int N = 1>
dart::IntrusiveDList< T, N >::IntrusiveDList ( )
inline

Definition at line 175 of file intrusive_dlist.h.

175{ head_.MakeHead(); }

Member Function Documentation

◆ Append()

template<typename T , int N = 1>
void dart::IntrusiveDList< T, N >::Append ( T a)
inline

Definition at line 177 of file intrusive_dlist.h.

177{ head_.Prepend(convert(a)); }
struct MyStruct a[10]

◆ AppendList()

template<typename T , int N = 1>
void dart::IntrusiveDList< T, N >::AppendList ( IntrusiveDList< T, N > *  other)
inline

Definition at line 237 of file intrusive_dlist.h.

237 {
238 if (other->IsEmpty()) return;
239
240 auto other_first = other->head_.Next();
241 auto other_last = other->head_.Prev();
242 other->head_.next_ = &other->head_;
243 other->head_.prev_ = &other->head_;
244
245 auto prev = head_.prev_;
246
247 prev->next_ = other_first;
248 other_first->prev_ = prev;
249
250 other_last->next_ = &head_;
251 head_.prev_ = other_last;
252 }
static float prev(float f)

◆ Begin()

template<typename T , int N = 1>
Iterator< T, N > dart::IntrusiveDList< T, N >::Begin ( )
inline

Definition at line 215 of file intrusive_dlist.h.

215{ return Iterator<T, N>(this, head_.Next()); }

◆ begin()

template<typename T , int N = 1>
Iterator< T, N > dart::IntrusiveDList< T, N >::begin ( )
inline

Definition at line 219 of file intrusive_dlist.h.

219{ return Begin(); }
Iterator< T, N > Begin()

◆ ContainsForDebugging()

template<typename T , int N = 1>
bool dart::IntrusiveDList< T, N >::ContainsForDebugging ( const T a)
inline

Definition at line 230 of file intrusive_dlist.h.

230 {
231 for (auto entry : *this) {
232 if (entry == a) return true;
233 }
234 return false;
235 }

◆ End()

template<typename T , int N = 1>
Iterator< T, N > dart::IntrusiveDList< T, N >::End ( )
inline

Definition at line 217 of file intrusive_dlist.h.

217{ return Iterator<T, N>(this, &head_); }

◆ end()

template<typename T , int N = 1>
Iterator< T, N > dart::IntrusiveDList< T, N >::end ( )
inline

Definition at line 221 of file intrusive_dlist.h.

221{ return End(); }
Iterator< T, N > End()

◆ Erase()

template<typename T , int N = 1>
Iterator< T, N > dart::IntrusiveDList< T, N >::Erase ( const Iterator< T, N > &  iterator)
inline

Definition at line 223 of file intrusive_dlist.h.

223 {
224 ASSERT(iterator.head_ == this);
225 Iterator<T, N> next(this, iterator.entry_->Next());
226 iterator.entry_->Remove();
227 return next;
228 }
static float next(float f)
#define ASSERT(E)

◆ First()

template<typename T , int N = 1>
T * dart::IntrusiveDList< T, N >::First ( ) const
inline

Definition at line 189 of file intrusive_dlist.h.

189 {
190 ASSERT(!IsEmpty());
191 return head_.Next()->container();
192 }

◆ IsEmpty()

template<typename T , int N = 1>
bool dart::IntrusiveDList< T, N >::IsEmpty ( ) const
inline

Definition at line 187 of file intrusive_dlist.h.

187{ return head_.IsEmpty(); }

◆ IsInList()

template<typename T , int N = 1>
bool dart::IntrusiveDList< T, N >::IsInList ( T a) const
inline

Definition at line 183 of file intrusive_dlist.h.

183{ return convert(a)->IsLinked(); }

◆ Last()

template<typename T , int N = 1>
T * dart::IntrusiveDList< T, N >::Last ( ) const
inline

Definition at line 194 of file intrusive_dlist.h.

194 {
195 ASSERT(!IsEmpty());
196 return head_.Prev()->container();
197 }

◆ Prepend()

template<typename T , int N = 1>
void dart::IntrusiveDList< T, N >::Prepend ( T a)
inline

Definition at line 179 of file intrusive_dlist.h.

179{ head_.Append(convert(a)); }

◆ Remove()

template<typename T , int N = 1>
void dart::IntrusiveDList< T, N >::Remove ( T a)
inline

Definition at line 185 of file intrusive_dlist.h.

185{ convert(a)->Remove(); }

◆ RemoveFirst()

template<typename T , int N = 1>
T * dart::IntrusiveDList< T, N >::RemoveFirst ( )
inline

Definition at line 199 of file intrusive_dlist.h.

199 {
200 ASSERT(!IsEmpty());
201 auto entry = head_.Next();
202 T* container = entry->container();
203 entry->Remove();
204 return container;
205 }
#define T

◆ RemoveLast()

template<typename T , int N = 1>
T * dart::IntrusiveDList< T, N >::RemoveLast ( )
inline

Definition at line 207 of file intrusive_dlist.h.

207 {
208 ASSERT(!IsEmpty());
209 auto entry = head_.Prev();
210 T* container = entry->container();
211 entry->Remove();
212 return container;
213 }

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