Flutter Engine
android::LruCache< TKey, TValue >::Iterator Class Reference

#include <LruCache.h>

Public Member Functions

 Iterator (const LruCache< TKey, TValue > &cache)
 
bool next ()
 
const TValue & value () const
 
const TKey & key () const
 

Detailed Description

template<typename TKey, typename TValue>
class android::LruCache< TKey, TValue >::Iterator

Definition at line 127 of file LruCache.h.

Constructor & Destructor Documentation

◆ Iterator()

template<typename TKey, typename TValue>
android::LruCache< TKey, TValue >::Iterator::Iterator ( const LruCache< TKey, TValue > &  cache)
inline

Definition at line 129 of file LruCache.h.

130  : mCache(cache),
131  mIterator(mCache.mSet->begin()),
132  mBeginReturned(false) {}

Member Function Documentation

◆ key()

template<typename TKey, typename TValue>
const TKey& android::LruCache< TKey, TValue >::Iterator::key ( ) const
inline

Definition at line 155 of file LruCache.h.

155 { return (*mIterator)->getKey(); }

◆ next()

template<typename TKey, typename TValue>
bool android::LruCache< TKey, TValue >::Iterator::next ( )
inline

Definition at line 134 of file LruCache.h.

134  {
135  if (mIterator == mCache.mSet->end()) {
136  return false;
137  }
138  if (!mBeginReturned) {
139  // mIterator has been initialized to the beginning and
140  // hasn't been returned. Do not advance:
141  mBeginReturned = true;
142  } else {
143  std::advance(mIterator, 1);
144  }
145  bool ret = (mIterator != mCache.mSet->end());
146  return ret;
147  }

◆ value()

template<typename TKey, typename TValue>
const TValue& android::LruCache< TKey, TValue >::Iterator::value ( ) const
inline

Definition at line 149 of file LruCache.h.

149  {
150  // All the elements in the set are of type Entry. See comment in the
151  // definition of LruCacheSet above.
152  return reinterpret_cast<Entry*>(*mIterator)->value;
153  }

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