EventProcessor.iterateExtensionMethodsByUDA

Iterates through all public methods in ExtensionModule annotated with the given UDA. For each matching function the callback paramter is called with the arguments being (string name, Delegate symbol, UDA uda). callback is expected to return a boolean if the UDA values were a match.

mixintemplate EventProcessor(alias ExtensionModule, EventProcessorConfig config = EventProcessorConfig.init)
bool
iterateExtensionMethodsByUDA
(
alias UDA
alias callback
bool returnFirst
)
()

Parameters

UDA

The UDA type to filter methods with. Methods can just have an UDA with this type and any values. See std.traits.getUDAs

callback

Called for every matching method. Expected to have 3 arguments being (string name, Delegate symbol, UDA uda) and returning bool telling if the uda values were a match or not. The Delegate is most often a function pointer to the given symbol and may differ between all calls.

If the UDA is a symbol and not a type (such as some enum manifest constant), then the UDA argument has no meaning and should not be used.

returnFirst

if true, once callback returns true immediately return true for the whole function, otherwise false. If this is set to false then callback will be run on all symbols and this function returns true if any callback call has returned true.

Return Value

Type: bool

true if any callback returned true, false otherwise or if none were called. If returnFirst is set this function returns after the first successfull callback call.

Meta