MONC
Private Member Functions | List of all members
collections_mod::c_pop_generic Interface Reference

Pops a generic element off the stack or queue. More...

Private Member Functions

class(*) function, pointer stack_pop_generic (specificstack)
 Pops an element off the stack (LIFO) More...
 
class(*) function, pointer queue_pop_generic (specificqueue)
 Pops the queue element off the head of the queue (FIFO) More...
 

Detailed Description

Pops a generic element off the stack or queue.

This has a time complexity of O(1)

Parameters
collectionThe specific stack or queue involved
Returns
Pointer to the generic data element which has been popped off the collection

Definition at line 158 of file collections.F90.

Member Function/Subroutine Documentation

◆ queue_pop_generic()

class(*) function, pointer collections_mod::c_pop_generic::queue_pop_generic ( type(queue_type), intent(inout)  specificqueue)
private

Pops the queue element off the head of the queue (FIFO)

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificqueueThe specific queue involved
Returns
Pointer to the generic element at head of the queue or null if none

Definition at line 2630 of file collections.F90.

2631  type(queue_type), intent(inout) :: specificqueue
2632  class(*), pointer :: queue_pop_generic
2633 
2634  queue_pop_generic=>queue_get_generic(specificqueue, 1)
2635  call list_remove(specificqueue%queue_ds, 1)

◆ stack_pop_generic()

class(*) function, pointer collections_mod::c_pop_generic::stack_pop_generic ( type(stack_type), intent(inout)  specificstack)
private

Pops an element off the stack (LIFO)

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificstackThe specific stack involved
Returns
Pointer to the generic data of the last element added to the stack

Definition at line 2334 of file collections.F90.

2335  type(stack_type), intent(inout) :: specificstack
2336  class(*), pointer :: stack_pop_generic
2337 
2338  stack_pop_generic=>stack_get_generic(specificstack, 1)
2339  call list_remove(specificstack%stack_ds, 1)

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