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

Pops an integer element off the stack or queue. More...

Private Member Functions

integer function stack_pop_int (specificstack)
 Pops an element off the stack (LIFO) More...
 
integer function queue_pop_int (specificqueue)
 Pops the queue element off the head of the queue (FIFO) More...
 

Detailed Description

Pops an integer element off the stack or queue.

This has a time complexity of O(1)

Parameters
collectionThe specific stack or queue involved
Returns
Integer element which has been popped off the collection or raises and error if none is found

Definition at line 167 of file collections.F90.

Member Function/Subroutine Documentation

◆ queue_pop_int()

integer function collections_mod::c_pop_integer::queue_pop_int ( 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
Integer element at head of the queue or raises an error if there is none

Definition at line 2559 of file collections.F90.

2560  type(queue_type), intent(inout) :: specificqueue
2561  integer :: queue_pop_int
2562 
2563  class(*), pointer :: generic
2564 
2565  generic=>queue_pop_generic(specificqueue)
2566  if (.not. associated(generic)) call log_log(log_error, "Can not pop integer from queue")
2567  queue_pop_int=conv_to_integer(generic, .false.)

◆ stack_pop_int()

integer function collections_mod::c_pop_integer::stack_pop_int ( 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
Integer data of the last element added to the stack or raises an error if none is found

Definition at line 2263 of file collections.F90.

2264  type(stack_type), intent(inout) :: specificstack
2265  integer :: stack_pop_int
2266 
2267  class(*), pointer :: generic
2268 
2269  generic=>stack_pop_generic(specificstack)
2270  if (.not. associated(generic)) call log_log(log_error, "Can not pop integer from stack")
2271  stack_pop_int=conv_to_integer(generic, .false.)

The documentation for this interface was generated from the following file:
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75