Create an instance of concrete extension of optimal_weights given its constructor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(optimal_weights_constructor), | intent(in) | :: | constructor | Constructor. |
||
class(optimal_weights), | intent(out), | allocatable | :: | object | Object. |
subroutine create_optimal_weights(constructor, object)
!< Create an instance of concrete extension of [[optimal_weights]] given its constructor.
class(optimal_weights_constructor), intent(in) :: constructor !< Constructor.
class(optimal_weights), allocatable, intent(out) :: object !< Object.
select type(constructor)
type is(optimal_weights_js_constructor)
allocate(optimal_weights_js :: object)
class default
error stop 'error: WenOOF object factory do NOT know the constructor given'
endselect
call object%create(constructor=constructor)
endsubroutine create_optimal_weights