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

#include <pointer_block.h>

Inheritance diagram for dart::LocalBlockWorkList< Size, T >:
dart::ValueObject

Public Member Functions

 LocalBlockWorkList ()
 
 ~LocalBlockWorkList ()
 
template<typename Lambda >
DART_FORCE_INLINE void Process (Lambda action)
 
void Push (T obj)
 
void Finalize ()
 
void AbandonWork ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

template<int Size, typename T>
class dart::LocalBlockWorkList< Size, T >

Definition at line 309 of file pointer_block.h.

Constructor & Destructor Documentation

◆ LocalBlockWorkList()

template<int Size, typename T >
dart::LocalBlockWorkList< Size, T >::LocalBlockWorkList ( )
inline

Definition at line 311 of file pointer_block.h.

311{ head_ = new PointerBlock<Size>(); }

◆ ~LocalBlockWorkList()

template<int Size, typename T >
dart::LocalBlockWorkList< Size, T >::~LocalBlockWorkList ( )
inline

Definition at line 312 of file pointer_block.h.

312{ ASSERT(head_ == nullptr); }
#define ASSERT(E)

Member Function Documentation

◆ AbandonWork()

template<int Size, typename T >
void dart::LocalBlockWorkList< Size, T >::AbandonWork ( )
inline

Definition at line 344 of file pointer_block.h.

344 {
345 ASSERT(head_ != nullptr);
346 auto* block = head_;
347 head_ = nullptr;
348 while (block != nullptr) {
349 auto* next = block->next_;
350 block->Reset();
351 delete block;
352 block = next;
353 }
354 }
static float next(float f)

◆ Finalize()

template<int Size, typename T >
void dart::LocalBlockWorkList< Size, T >::Finalize ( )
inline

Definition at line 337 of file pointer_block.h.

337 {
338 ASSERT(head_ != nullptr);
339 ASSERT(head_->IsEmpty());
340 delete head_;
341 head_ = nullptr;
342 }

◆ Process()

template<int Size, typename T >
template<typename Lambda >
DART_FORCE_INLINE void dart::LocalBlockWorkList< Size, T >::Process ( Lambda  action)
inline

Definition at line 315 of file pointer_block.h.

315 {
316 auto* block = head_;
317 head_ = new PointerBlock<Size>();
318 while (block != nullptr) {
319 while (!block->IsEmpty()) {
320 action(static_cast<T>(block->Pop()));
321 }
322 auto* next = block->next();
323 delete block;
324 block = next;
325 }
326 }
#define T

◆ Push()

template<int Size, typename T >
void dart::LocalBlockWorkList< Size, T >::Push ( T  obj)
inline

Definition at line 328 of file pointer_block.h.

328 {
329 if (UNLIKELY(head_->IsFull())) {
330 PointerBlock<Size>* next = new PointerBlock<Size>();
331 next->next_ = head_;
332 head_ = next;
333 }
334 head_->Push(obj);
335 }
#define UNLIKELY(cond)
Definition globals.h:261

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