Provides properties and instance methods for the method class. This class is a wrapper for any procedure (subroutine or function).
procedure
. The explicit interface can be enforced through the use of the caller property.The following examples demonstrate some of the main members of the method.
This example shows how to set a caller
explicitely. In the present case, the caller was necessary to specify the procedure interface explicitely. This is necessary when benchmarking a function rather than a subroutine.
At the moment, the method class handles procedures using up to 7 dummy arguments.
Initializes a new instance of the method class
type(method) function method(integer nargs, procedure f)
[in] | nargs | The number of dummy arguments |
f | The procedure |
Examples
type(method) function method(procedure f, procedure caller)
f | The procedure pointer |
caller | The caller wrapper |
Examples
type(method) function method(procedure f, class(*) a1, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
caller | (optional) The caller wrapper |
Examples
type(method) function method(procedure f, class(*) a1, class(*) a2, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
caller | (optional) The caller wrapper |
type(method) function method(procedure f, class(*) a1, class(*) a2, class(*) a3, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
[in] | a3 | The method argument |
caller | (optional) The caller wrapper |
type(method) function method(procedure f, class(*) a1, class(*) a2, class(*) a3, class(*) a4, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
[in] | a3 | The method argument |
[in] | a4 | The method argument |
caller | (optional) The caller wrapper |
type(method) function method(procedure f, class(*) a1, class(*) a2, class(*) a3, class(*) a4, class(*) a5, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
[in] | a3 | The method argument |
[in] | a4 | The method argument |
[in] | a5 | The method argument |
caller | (optional) The caller wrapper |
type(method) function method(procedure f, class(*) a1, class(*) a2, class(*) a3, class(*) a4, class(*) a5, class(*) a6, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
[in] | a3 | The method argument |
[in] | a4 | The method argument |
[in] | a5 | The method argument |
[in] | a6 | The method argument |
caller | (optional) The caller wrapper |
type(method) function method(procedure f, class(*) a1, class(*) a2, class(*) a3, class(*) a4, class(*) a5, class(*) a6, class(*) a7, procedure caller)
f | The procedure pointer | |
[in] | a1 | The method argument |
[in] | a2 | The method argument |
[in] | a3 | The method argument |
[in] | a4 | The method argument |
[in] | a5 | The method argument |
[in] | a6 | The method argument |
[in] | a7 | The method argument |
caller | (optional) The caller wrapper |
Remarks
Definition at line 173 of file Method.f90.
Variables | |
integer, public | nargs |
Number of dummy arguments. | |
type(arg), dimension(:), allocatable, public | args |
Array of method arguments . | |
Static Public Attributes | |
procedure(), pointer, nopass | f => null() |
Procedure pointer. | |
procedure(), pointer, nopass, public | caller => null() |
Wrapper to call the procedure pointer. This provides a way to set the procedure interface explicitely. | |
Assignment overloading. Assign a method to another method.
[in,out] | lhs | The target method |
[in] | rhs | The source method |
Remarks
Definition at line 168 of file Method.f90.
procedure, pass, public dispose | ( | class(method), intent(inout) | this | ) |
Dispose resources associated with the bound type.
[in,out] | this | The type bound to the method |
Remarks
Definition at line 169 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this | ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
Examples
Remarks
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
[in] | a3 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
[in] | a3 | dummy argument |
[in] | a4 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
[in] | a3 | dummy argument |
[in] | a4 | dummy argument |
[in] | a5 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5, | ||
class(*), intent(in) | a6 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
[in] | a3 | dummy argument |
[in] | a4 | dummy argument |
[in] | a5 | dummy argument |
[in] | a6 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
generic, public invoke | ( | class(method), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5, | ||
class(*), intent(in) | a6, | ||
class(*), intent(in) | a7 ) |
Bound procedure to invoke a method.
[in] | this | The type bound to the method |
[in] | a1 | dummy argument |
[in] | a2 | dummy argument |
[in] | a3 | dummy argument |
[in] | a4 | dummy argument |
[in] | a5 | dummy argument |
[in] | a6 | dummy argument |
[in] | a7 | dummy argument |
Examples
The first example demonstrate how to invoke the method by passing the arguments to the invoke
procedure.
Alternatively, on can also set the arguments directly from the method constructor.
Remarks
Definition at line 159 of file Method.f90.
|
final |
Definition at line 170 of file Method.f90.