Adds a generic element to the end of the list.
More...
|
subroutine | list_add_generic (specificlist, data, memory_allocation_automatic) |
| Adds an element to the end of the list. More...
|
|
Adds a generic element to the end of the list.
This has a time complexity of O(1)
- Parameters
-
collection | The specific list involved |
data | Pointer to the raw generic data to add |
memory_allocation_automatic | Whether the collections API should manage the freeing of memory |
Definition at line 204 of file collections.F90.
◆ list_add_generic()
subroutine collections_mod::c_add_generic::list_add_generic |
( |
type(list_type), intent(inout) |
specificlist, |
|
|
class(*), intent(in), pointer |
data, |
|
|
logical, intent(in) |
memory_allocation_automatic |
|
) |
| |
|
private |
Adds an element to the end of the list.
Do not call directly from external module, this is called via the appropriate interface
- Parameters
-
specificlist | The specific list involved |
data | Pointer to the generic data to add |
memory_allocation_automatic | Whether the collections API should manage the freeing of memory |
Definition at line 2964 of file collections.F90.
2964 type(list_type),
intent(inout) :: specificlist
2965 class(*),
pointer,
intent(in) :: data
2966 logical,
intent(in) :: memory_allocation_automatic
2968 type(listnode_type),
pointer :: newnode
2971 newnode%data =>
data 2973 newnode%prev=>specificlist%tail
2974 newnode%memory_allocation_automatic=memory_allocation_automatic
2975 if (
associated(specificlist%tail))
then 2976 specificlist%tail%next => newnode
2978 specificlist%tail => newnode
2980 if (
associated(specificlist%head) .eqv. .false.)
then 2981 specificlist%head=>newnode
2984 specificlist%size=specificlist%size+1
The documentation for this interface was generated from the following file:
- /nfs/a277/earlcd/dev/monc/svn-git/monc/model_core/src/utils/collections.F90