Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::BlockStack< BlockSize >::List Class Reference

#include <pointer_block.h>

Public Member Functions

 List ()
 
 ~List ()
 
void Push (Block *block)
 
BlockPop ()
 
intptr_t length () const
 
bool IsEmpty () const
 
BlockPopAll ()
 
BlockPeek ()
 

Detailed Description

template<int BlockSize>
class dart::BlockStack< BlockSize >::List

Definition at line 119 of file pointer_block.h.

Constructor & Destructor Documentation

◆ List()

template<int BlockSize>
dart::BlockStack< BlockSize >::List::List ( )
inline

Definition at line 121 of file pointer_block.h.

121: head_(nullptr), length_(0) {}

◆ ~List()

template<int BlockSize>
dart::BlockStack< BlockSize >::List::~List ( )

Definition at line 209 of file pointer_block.cc.

209 {
210 while (!IsEmpty()) {
211 delete Pop();
212 }
213}

Member Function Documentation

◆ IsEmpty()

template<int BlockSize>
bool dart::BlockStack< BlockSize >::List::IsEmpty ( ) const
inline

Definition at line 126 of file pointer_block.h.

126{ return head_ == nullptr; }

◆ length()

template<int BlockSize>
intptr_t dart::BlockStack< BlockSize >::List::length ( ) const
inline

Definition at line 125 of file pointer_block.h.

125{ return length_; }

◆ Peek()

template<int BlockSize>
Block * dart::BlockStack< BlockSize >::List::Peek ( )
inline

Definition at line 128 of file pointer_block.h.

128{ return head_; }

◆ Pop()

template<int BlockSize>
BlockStack< BlockSize >::Block * dart::BlockStack< BlockSize >::List::Pop ( )

Definition at line 216 of file pointer_block.cc.

216 {
217 Block* result = head_;
218 head_ = head_->next_;
219 --length_;
220 result->next_ = nullptr;
221 return result;
222}
GAsyncResult * result

◆ PopAll()

template<int BlockSize>
BlockStack< BlockSize >::Block * dart::BlockStack< BlockSize >::List::PopAll ( )

Definition at line 225 of file pointer_block.cc.

225 {
226 Block* result = head_;
227 head_ = nullptr;
228 length_ = 0;
229 return result;
230}

◆ Push()

template<int BlockSize>
void dart::BlockStack< BlockSize >::List::Push ( Block block)

Definition at line 233 of file pointer_block.cc.

233 {
234 ASSERT(block->next_ == nullptr);
235 block->next_ = head_;
236 head_ = block;
237 ++length_;
238}
#define ASSERT(E)

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