collections 1.0.0
COLLECTIONS is a library providing a set of types supporting collections in Fortran.
|
Defines a generic, dynamically sizable list. More...
Public Member Functions | |
procedure, public | count => list_get_count |
Gets the number of items stored in the list. More... | |
procedure, public | get_capacity => list_get_capacity |
Gets the capacity of the list. More... | |
procedure, public | set_capacity => list_set_capacity |
Sets the capacity of the list. More... | |
procedure, public | push => list_push |
Pushes an item onto the back of the list. More... | |
procedure, public | pop => list_pop |
Pops the last item off the back of the list. More... | |
procedure, public | get => list_get |
Gets the requested item from the list. More... | |
procedure, public | set => list_set |
Sets the specified item into the list. More... | |
procedure, public | insert => list_insert |
Inserts an item into the list. More... | |
procedure, public | remove => list_remove |
Removes an item from the list. More... | |
procedure, public | clear => list_clear |
Clears the entire list. More... | |
Defines a generic, dynamically sizable list.
Definition at line 259 of file collections.f90.
procedure, public collections::list::clear |
Clears the entire list.
[in,out] | this | The list object. |
Definition at line 432 of file collections.f90.
procedure, public collections::list::count |
Gets the number of items stored in the list.
[in] | this | The list object. |
Definition at line 274 of file collections.f90.
procedure, public collections::list::get |
Gets the requested item from the list.
[in] | this | The list object. |
[in] | i | The one-based index of the item to retrieve. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 356 of file collections.f90.
procedure, public collections::list::get_capacity |
Gets the capacity of the list.
[in] | this | The list object. |
Definition at line 291 of file collections.f90.
procedure, public collections::list::insert |
Inserts an item into the list.
[in,out] | this | The list object. |
[in] | i | The one-based index defining where to put the item. |
[in] | x | The object to store. |
[in] | manage | An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 408 of file collections.f90.
procedure, public collections::list::pop |
Pops the last item off the back of the list.
[in,out] | this | The list object. |
Definition at line 339 of file collections.f90.
procedure, public collections::list::push |
Pushes an item onto the back of the list.
[in,out] | this | The list object. |
[in] | x | The object to store. |
[in] | manage | An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 330 of file collections.f90.
procedure, public collections::list::remove |
Removes an item from the list.
[in,out] | this | The list object. |
[in] | i | The one-based index defining which item to remove. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 423 of file collections.f90.
procedure, public collections::list::set |
Sets the specified item into the list.
[in,out] | this | The list object. |
[in] | i | The one-based index defining where to put the item. |
[in] | x | The object to store. |
[in] | manage | An optional input used to determine if the list should manage memory for this object. If set to true a clone of x is stored and the list will handle management of resources held by the clone. If false, the list will not manage resources held by x and x itself will be stored. Notice, in this manner it is possible for x to go out of scope while the list still persists thereby resulting in a potentially undefined behavior. It is recommended to use the default value of true except for very specific and well controlled edge cases. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 382 of file collections.f90.
procedure, public collections::list::set_capacity |
Sets the capacity of the list.
[in,out] | this | The list object. |
[in] | n | The new capacity of the list. This value must be greater than or equal to 1. |
[in,out] | err | An optional output that can be used to track the error status of the routine. Possible error codes are as follows.
|
Definition at line 307 of file collections.f90.