16 class(*),
pointer :: context
39 class(*),
pointer :: context
50 class(*),
pointer :: context
53 class(*),
pointer :: p
55 allocate (subscription)
56 subscription%handler => handler
57 subscription%context => context
59 call this%subscriptions%Add(p)
77 call particle%get_model_coords(x, y, z)
81 event%imdl = particle%imdl
82 event%iprp = particle%iprp
83 event%irpt = particle%irpt
84 event%ilay = particle%ilay
85 event%icu = particle%icu
86 event%izone = particle%izone
87 event%trelease = particle%trelease
88 event%ttrack = particle%ttrack
92 event%istatus = particle%istatus
102 logical(LGP) :: handled
104 class(*),
pointer :: p
106 call this%prep_event(particle, event)
108 do i = 1, this%subscriptions%Count()
109 p => this%subscriptions%GetItem(i)
110 select type (subscription => p)
112 handled = subscription%handler( &
113 subscription%context, &
128 logical(LGP) :: handled
130 class(*),
pointer :: p
132 call this%prep_event(particle, event)
134 do i = 1, this%subscriptions%Count()
135 p => this%subscriptions%GetItem(i)
136 select type (subscription => p)
138 handled = subscription%handler(subscription%context, particle, event)
146 call this%subscriptions%Clear(
destroy=.true.)
Event handler interface. Handlers may signal to the dispatching caller whether they have handled the ...
This module defines variable data types.
subroutine subscribe(this, handler, context)
Add a subscription to the dispatcher.
subroutine prep_event(this, particle, event)
Prepare an event for dispatching, loading it with the current state of the particle....
subroutine broadcast(this, particle, event)
Broadcast an event to all subscribers so all receive the event and a chance to handle it.
subroutine dispatch(this, particle, event)
Dispatch an event for handling. The first subscriber to handle the event stops propagation.
subroutine destroy(this)
Destroy the dispatcher.
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
A generic heterogeneous doubly-linked list.
Base type for particle events.
Dispatcher for particle events. Consumers subscribe handlers to the dispatcher. Events may be dispatc...
Subscription to particle events: a procedure to handle the event with an unlimited pointer for storin...
Particle tracked by the PRT model.