Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::Worklist Class Reference
Inheritance diagram for dart::Worklist:
dart::ValueObject

Public Member Functions

 Worklist (Zone *zone)
 
bool IsEmpty () const
 
void Add (const Object &value)
 
ObjectPtr Remove ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 38 of file program_visitor.cc.

Constructor & Destructor Documentation

◆ Worklist()

dart::Worklist::Worklist ( Zone zone)
inlineexplicit

Definition at line 40 of file program_visitor.cc.

41 : zone_(zone), first_(nullptr), last_(nullptr) {}

Member Function Documentation

◆ Add()

void dart::Worklist::Add ( const Object value)
inline

Definition at line 45 of file program_visitor.cc.

45 {
46 auto element = new (zone_) WorklistElement(zone_, value);
47 if (first_ == nullptr) {
48 first_ = element;
49 ASSERT(last_ == nullptr);
50 } else {
51 ASSERT(last_ != nullptr);
52 last_->set_next(element);
53 }
54 last_ = element;
55 ASSERT(first_ != nullptr && last_ != nullptr);
56 }
void set_next(WorklistElement *elem)
#define ASSERT(E)
uint8_t value

◆ IsEmpty()

bool dart::Worklist::IsEmpty ( ) const
inline

Definition at line 43 of file program_visitor.cc.

43{ return first_ == nullptr; }

◆ Remove()

ObjectPtr dart::Worklist::Remove ( )
inline

Definition at line 58 of file program_visitor.cc.

58 {
59 ASSERT(first_ != nullptr);
60 WorklistElement* result = first_;
61 first_ = first_->next();
62 if (first_ == nullptr) {
63 last_ = nullptr;
64 }
65 return result->value();
66 }
WorklistElement * next() const
GAsyncResult * result

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