Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
SkArenaAllocList< T > Class Template Reference

#include <SkArenaAllocList.h>

Classes

class  Iter
 

Public Member Functions

 SkArenaAllocList ()=default
 
void reset ()
 
template<typename... Args>
Tappend (SkArenaAlloc *arena, Args... args)
 
Iter begin ()
 
Iter end ()
 
Iter tail ()
 

Detailed Description

template<typename T>
class SkArenaAllocList< T >

A singly linked list of Ts stored in a SkArenaAlloc. The arena rather than the list owns the elements. This supports forward iteration and range based for loops.

Definition at line 21 of file SkArenaAllocList.h.

Constructor & Destructor Documentation

◆ SkArenaAllocList()

template<typename T >
SkArenaAllocList< T >::SkArenaAllocList ( )
default

Member Function Documentation

◆ append()

template<typename T >
template<typename... Args>
T & SkArenaAllocList< T >::append ( SkArenaAlloc arena,
Args...  args 
)
inline

Definition at line 65 of file SkArenaAllocList.h.

65 {
66 SkASSERT(!fHead == !fTail);
67 auto* n = arena->make<Node>(std::forward<Args>(args)...);
68 if (!fTail) {
69 fHead = fTail = n;
70 } else {
71 fTail = fTail->fNext = n;
72 }
73 return fTail->fT;
74}
#define SkASSERT(cond)
Definition SkAssert.h:116
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition dart.idl:29

◆ begin()

template<typename T >
Iter SkArenaAllocList< T >::begin ( )
inline

Definition at line 48 of file SkArenaAllocList.h.

48{ return Iter(fHead); }

◆ end()

template<typename T >
Iter SkArenaAllocList< T >::end ( )
inline

Definition at line 49 of file SkArenaAllocList.h.

49{ return Iter(); }

◆ reset()

template<typename T >
void SkArenaAllocList< T >::reset ( )
inline

Definition at line 28 of file SkArenaAllocList.h.

28{ fHead = fTail = nullptr; }

◆ tail()

template<typename T >
Iter SkArenaAllocList< T >::tail ( )
inline

Definition at line 50 of file SkArenaAllocList.h.

50{ return Iter(fTail); }

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