Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
dart::ClassDictionaryIterator Class Reference

#include <object.h>

Inheritance diagram for dart::ClassDictionaryIterator:
dart::DictionaryIterator dart::ValueObject

Public Types

enum  IterationKind { kIteratePrivate , kNoIteratePrivate }
 

Public Member Functions

 ClassDictionaryIterator (const Library &library, IterationKind kind=kNoIteratePrivate)
 
bool HasNext () const
 
ClassPtr GetNextClass ()
 
- Public Member Functions inherited from dart::DictionaryIterator
 DictionaryIterator (const Library &library)
 
bool HasNext () const
 
ObjectPtr GetNext ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 5065 of file object.h.

Member Enumeration Documentation

◆ IterationKind

Enumerator
kIteratePrivate 
kNoIteratePrivate 

Definition at line 5067 of file object.h.

5067 {
5068 // TODO(hausner): fix call sites that use kIteratePrivate. There is only
5069 // one top-level class per library left, not an array to iterate over.
5072 };

Constructor & Destructor Documentation

◆ ClassDictionaryIterator()

dart::ClassDictionaryIterator::ClassDictionaryIterator ( const Library library,
IterationKind  kind = kNoIteratePrivate 
)

Definition at line 13526 of file object.cc.

13528 : DictionaryIterator(library),
13529 toplevel_class_(Class::Handle((kind == kIteratePrivate)
13530 ? library.toplevel_class()
13531 : Class::null())) {
13532 MoveToNextClass();
13533}
DictionaryIterator(const Library &library)
Definition: object.cc:13502
static ObjectPtr null()
Definition: object.h:433
static Object & Handle()
Definition: object.h:407

Member Function Documentation

◆ GetNextClass()

ClassPtr dart::ClassDictionaryIterator::GetNextClass ( )

Definition at line 13535 of file object.cc.

13535 {
13536 ASSERT(HasNext());
13537 Class& cls = Class::Handle();
13538 if (next_ix_ < size_) {
13539 int ix = next_ix_++;
13540 cls ^= array_.At(ix);
13541 MoveToNextClass();
13542 return cls.ptr();
13543 }
13544 ASSERT(!toplevel_class_.IsNull());
13545 cls = toplevel_class_.ptr();
13546 toplevel_class_ = Class::null();
13547 return cls.ptr();
13548}
ObjectPtr ptr() const
Definition: object.h:332
bool IsNull() const
Definition: object.h:363
#define ASSERT(E)

◆ HasNext()

bool dart::ClassDictionaryIterator::HasNext ( ) const
inline

Definition at line 5077 of file object.h.

5077 {
5078 return (next_ix_ < size_) || !toplevel_class_.IsNull();
5079 }

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