MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / move_next

Method move_next

benchmarks/dlib/queue/queue_kernel_2.h:507–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505 typename mem_manager
506 >
507 bool queue_kernel_2<T,block_size,mem_manager>::
508 move_next (
509 ) const
510 {
511 if (at_start_)
512 {
513 at_start_ = false;
514 // if the queue is empty then there is nothing to do
515 if (queue_size == 0)
516 {
517 return false;
518 }
519 else
520 {
521 current_element = out;
522 current_element_pos = out_pos;
523 return true;
524 }
525 }
526 else if (current_element == 0)
527 {
528 return false;
529 }
530 else
531 {
532 ++current_element_pos;
533 // if we are at the last element then the enumeration has finished
534 if (current_element == in && current_element_pos == in_pos )
535 {
536 current_element = 0;
537 return false;
538 }
539 else if (current_element_pos == block_size)
540 {
541 current_element_pos = 0;
542 current_element = current_element->next;
543 }
544
545 return true;
546 }
547 }
548
549// ----------------------------------------------------------------------------------------
550// ----------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected