Flutter Engine
The Flutter Engine
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 12131 of file object.h.

Constructor & Destructor Documentation

◆ Iterator()

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

Definition at line 12133 of file object.h.

12134 : data_(Array::Handle(map.data())),
12135 scratch_(Object::Handle()),
12136 offset_(-2),
12137 length_(Smi::Value(map.used_data())) {}
static Object & Handle()
Definition: object.h:407
intptr_t Value() const
Definition: object.h:9990
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 12153 of file object.h.

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

◆ CurrentValue()

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

Definition at line 12155 of file object.h.

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

◆ MoveNext()

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

Definition at line 12139 of file object.h.

12139 {
12140 while (true) {
12141 offset_ += 2;
12142 if (offset_ >= length_) {
12143 return false;
12144 }
12145 scratch_ = data_.At(offset_);
12146 if (scratch_.ptr() != data_.ptr()) {
12147 // Slot is not deleted (self-reference indicates deletion).
12148 return true;
12149 }
12150 }
12151 }
ObjectPtr ptr() const
Definition: object.h:332

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