MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / increment

Method increment

src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H:217–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215
216template<class T, class Key, class Hash>
217inline void
218Foam::HashTable<T, Key, Hash>::iteratorBase::increment()
219{
220 // A negative index is a special value from erase
221 if (hashIndex_ < 0)
222 {
223 // the markPos='-curPos-1', but we wish to continue at 'curPos-1'
224 // thus use '-(markPos+1) -1'
225 hashIndex_ = -(hashIndex_+1) - 1;
226 }
227 else if (entryPtr_)
228 {
229 if (entryPtr_->next_)
230 {
231 // Move to next element on the SLList
232 entryPtr_ = entryPtr_->next_;
233 return;
234 }
235 }
236 // else
237 // {
238 // // if we reach here (entryPtr_ is nullptr) it is already at the end()
239 // // we should probably stop
240 // }
241
242
243 // Step to the next table entry
244 while
245 (
246 ++hashIndex_ < hashTable_->tableSize_
247 && !(entryPtr_ = hashTable_->table_[hashIndex_])
248 )
249 {}
250
251 if (hashIndex_ >= hashTable_->tableSize_)
252 {
253 // make into an end iterator
254 entryPtr_ = 0;
255 hashIndex_ = 0;
256 }
257}
258
259
260template<class T, class Key, class Hash>

Callers 2

HashTableI.HFile · 0.80
operator++Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected