void mitk::LabelSet::RemoveAllLabels() { auto _it = IteratorBegin(); for (; _it != IteratorConstEnd();) { RemoveLabelEvent.Send(); m_LabelContainer.erase(_it++); } AllLabelsModifiedEvent.Send(); }
uint64_t sum(SCtx& ctx) { uint64_t sum = 0; #if defined(IMPL_DM_HASHTABLE) ctx.ht.Iterate(sum_callback, &sum); #else auto it = IteratorBegin(ctx.ht); auto itend = IteratorEnd(ctx.ht); for( ; it != itend; IteratorNext(ctx.ht, it) ) sum += IteratorGetValue(ctx.ht, it); #endif return sum; }
uint64_t iterator_prefix(SCtx& ctx) { ASSERT( Size(ctx.ht) == ctx.num_elements ); uint64_t sum = 0; #if defined(IMPL_DM_HASHTABLE) ctx.ht.Iterate(sum_callback, &sum); #else iterator_t it = IteratorBegin(ctx.ht); iterator_t itend = IteratorEnd(ctx.ht); for( ; it != itend; IteratorNext(ctx.ht, it) ) sum += IteratorGetValue(ctx.ht, it); #endif return sum; }
uint64_t create_insert_and_sum(SCtx& ctx) { hashtable_t ht; Init(ht, ctx.num_elements); for( size_t i = 0; i < ctx.num_elements; ++i ) Put(ht, keey_t( i ), value_t( i ) ); uint64_t sum = 0; #if defined(IMPL_DM_HASHTABLE) ht.Iterate(sum_callback, &sum); #else auto it = IteratorBegin(ht); auto itend = IteratorEnd(ht); for( ; it != itend; IteratorNext(ht, it) ) sum += IteratorGetValue(ht, it); #endif return sum; }