Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::Map::Iterator Class Reference

#include <object.h>

Inheritance diagram for dart::Map::Iterator:
dart::ValueObject

Public Member Functions

 Iterator (const Map &map)
 
bool MoveNext ()
 
ObjectPtr CurrentKey () const
 
ObjectPtr CurrentValue () const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 12105 of file object.h.

Constructor & Destructor Documentation

◆ Iterator()

dart::Map::Iterator::Iterator ( const Map map)
inlineexplicit

Definition at line 12107 of file object.h.

12108 : data_(Array::Handle(map.data())),
12109 scratch_(Object::Handle()),
12110 offset_(-2),
12111 length_(Smi::Value(map.used_data())) {}
static Object & Handle()
Definition object.h:407
intptr_t Value() const
Definition object.h:9969
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition SkVx.h:680

Member Function Documentation

◆ CurrentKey()

ObjectPtr dart::Map::Iterator::CurrentKey ( ) const
inline

Definition at line 12127 of file object.h.

12127{ return data_.At(offset_); }
ObjectPtr At(intptr_t index) const
Definition object.h:10854

◆ CurrentValue()

ObjectPtr dart::Map::Iterator::CurrentValue ( ) const
inline

Definition at line 12129 of file object.h.

12129{ return data_.At(offset_ + 1); }

◆ MoveNext()

bool dart::Map::Iterator::MoveNext ( )
inline

Definition at line 12113 of file object.h.

12113 {
12114 while (true) {
12115 offset_ += 2;
12116 if (offset_ >= length_) {
12117 return false;
12118 }
12119 scratch_ = data_.At(offset_);
12120 if (scratch_.ptr() != data_.ptr()) {
12121 // Slot is not deleted (self-reference indicates deletion).
12122 return true;
12123 }
12124 }
12125 }
ObjectPtr ptr() const
Definition object.h:332

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