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

Pushes a generic element onto the stack or queue. More...

Private Member Functions

subroutine stack_push_generic (specificstack, data, memory_allocation_automatic)
 Pushes an element onto the stack (LIFO) More...
 
subroutine queue_push_generic (specificqueue, data, memory_allocation_automatic)
 Adds an element to the end of the queue (FIFO) More...
 

Detailed Description

Pushes a generic element onto the stack or queue.

This has a time complexity of O(1)

Parameters
collectionThe specific stack or queue involved
dataPointer to the generic data to push onto the collection
memory_allocation_automaticWhether the collections API should manage the freeing of memory

Definition at line 113 of file collections.F90.

Member Function/Subroutine Documentation

◆ queue_push_generic()

subroutine collections_mod::c_push_generic::queue_push_generic ( type(queue_type), intent(inout)  specificqueue,
class(*), intent(in), pointer  data,
logical, intent(in)  memory_allocation_automatic 
)
private

Adds an element to the end of the queue (FIFO)

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

Parameters
specificqueueThe specific queue involved
dataPointer to the generic data to add to the queue
memory_allocation_automaticWhether the collections API should manage the freeing of memory

Definition at line 2546 of file collections.F90.

2547  type(queue_type), intent(inout) :: specificqueue
2548  class(*), pointer, intent(in) :: data
2549  logical, intent(in) :: memory_allocation_automatic
2550 
2551  call list_add_generic(specificqueue%queue_ds, data, memory_allocation_automatic)

◆ stack_push_generic()

subroutine collections_mod::c_push_generic::stack_push_generic ( type(stack_type), intent(inout)  specificstack,
class(*), intent(in), pointer  data,
logical, intent(in)  memory_allocation_automatic 
)
private

Pushes an element onto the stack (LIFO)

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

Parameters
specificstackThe specific stack involved
dataPointer to the generic data to push onto the stack
memory_allocation_automaticWhether the collections API should manage the freeing of memory

Definition at line 2250 of file collections.F90.

2251  type(stack_type), intent(inout) :: specificstack
2252  class(*), pointer, intent(in) :: data
2253  logical, intent(in) :: memory_allocation_automatic
2254 
2255  call list_insert_generic(specificstack%stack_ds, data, 1, memory_allocation_automatic)

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