Flutter Engine
The Flutter Engine
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 332 of file pointer_block.h.

Constructor & Destructor Documentation

◆ LocalBlockWorkList()

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

Definition at line 334 of file pointer_block.h.

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

◆ ~LocalBlockWorkList()

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

Definition at line 335 of file pointer_block.h.

335{ 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 367 of file pointer_block.h.

367 {
368 ASSERT(head_ != nullptr);
369 auto* block = head_;
370 head_ = nullptr;
371 while (block != nullptr) {
372 auto* next = block->next_;
373 block->Reset();
374 delete block;
375 block = next;
376 }
377 }
static float next(float f)

◆ Finalize()

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

Definition at line 360 of file pointer_block.h.

360 {
361 ASSERT(head_ != nullptr);
362 ASSERT(head_->IsEmpty());
363 delete head_;
364 head_ = nullptr;
365 }

◆ Process()

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

Definition at line 338 of file pointer_block.h.

338 {
339 auto* block = head_;
340 head_ = new PointerBlock<Size>();
341 while (block != nullptr) {
342 while (!block->IsEmpty()) {
343 action(static_cast<T>(block->Pop()));
344 }
345 auto* next = block->next();
346 delete block;
347 block = next;
348 }
349 }
#define T
Definition: precompiler.cc:65

◆ Push()

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

Definition at line 351 of file pointer_block.h.

351 {
352 if (UNLIKELY(head_->IsFull())) {
353 PointerBlock<Size>* next = new PointerBlock<Size>();
354 next->next_ = head_;
355 head_ = next;
356 }
357 head_->Push(obj);
358 }
#define UNLIKELY(cond)
Definition: globals.h:261

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