watch_feature_api Module

Feature plugin API.

Defines the base watch_feature_t type, which acts as a lightweight callback interface. Feature implementations can extend this type and override any subset of callbacks.

Callback order (typical)

  • init(cfg) once during watcher init
  • on_start() once after init
  • on_watch_list_built(files, roots) after watch list computation (and on rebuild)
  • on_manifest_changed(old_key, new_key) when the manifest requires rebuild
  • on_change_detected(changed) when file changes are detected
  • on_before_run(cmd) just before running the command
  • on_after_run(exitstat, seconds) after command completion

Default implementations are no-ops. Dummy references are used where needed to avoid compiler warnings about unused dummy arguments.


Uses

  • module~~watch_feature_api~~UsesGraph module~watch_feature_api watch_feature_api fpm_strings fpm_strings module~watch_feature_api->fpm_strings iso_fortran_env iso_fortran_env module~watch_feature_api->iso_fortran_env module~watch_types watch_types module~watch_feature_api->module~watch_types module~watch_types->fpm_strings module~watch_types->iso_fortran_env fpm_command_line fpm_command_line module~watch_types->fpm_command_line

Used by

  • module~~watch_feature_api~~UsedByGraph module~watch_feature_api watch_feature_api module~watch_feat_stats watch_feat_stats module~watch_feat_stats->module~watch_feature_api module~watch_feature_factory watch_feature_factory module~watch_feature_factory->module~watch_feature_api module~watch_feature_factory->module~watch_feat_stats module~watch_feature_manager watch_feature_manager module~watch_feature_factory->module~watch_feature_manager module~watch_feature_manager->module~watch_feature_api module~watch_engine watch_engine module~watch_engine->module~watch_feature_factory module~watch_engine->module~watch_feature_manager

Derived Types

type, public ::  watch_feature_t

Base feature type (override callbacks to implement behavior).

Type-Bound Procedures

procedure, public :: init => feat_init_noop
procedure, public :: on_after_run => feat_after_noop
procedure, public :: on_before_run => feat_before_noop
procedure, public :: on_change_detected => feat_change_noop
procedure, public :: on_manifest_changed => feat_manifest_noop
procedure, public :: on_start => feat_noop
procedure, public :: on_watch_list_built => feat_list_noop

Subroutines

private subroutine feat_after_noop(self, exitstat, seconds)

No-op callback invoked after executing the command.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
integer, intent(in) :: exitstat
real, intent(in) :: seconds

private subroutine feat_before_noop(self, cmd)

No-op callback invoked just before executing the command.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
character(len=:), intent(inout), allocatable :: cmd

private subroutine feat_change_noop(self, changed)

No-op callback for detected file changes.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
type(string_t), intent(in), allocatable :: changed(:)

private subroutine feat_init_noop(self, cfg)

No-op init callback.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
type(watch_config_t), intent(in) :: cfg

private subroutine feat_list_noop(self, files, roots)

No-op callback for watch list rebuild completion.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
type(string_t), intent(inout), allocatable :: files(:)
type(root_info_t), intent(inout), allocatable :: roots(:)

private subroutine feat_manifest_noop(self, old_key, new_key)

No-op callback for manifest key change.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self
integer(kind=int64), intent(in) :: old_key
integer(kind=int64), intent(in) :: new_key

private subroutine feat_noop(self)

No-op start callback.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(inout) :: self