set - multiple declarations
Function set
Invoke component's method with supplied args.
auto auto set(string property, Z, T, Args...)
(
Z factory,
auto ref Args args
)
if (!isField!(T, property));
Configures component's factory to call specified method with passed args. The function will check if the arguments passed to it are compatible with at least one method from possible overload set. The args list can contain references to other objects in locator as well, though no type compatibility checks will be performed at compile time.
Parameters
Name | Description |
---|---|
factory | the factory which will be configured to invoke method. |
args | the arguments that will be used to invoke method on the new object. |
Returns
Z.
Function set
Set component's public field to passed arg.
auto auto set(string property, Z, T, Arg)
(
Z factory,
auto ref Arg arg
)
if (isField!(T, property));
Configures component's factory to set specified field to passed arg. The function will check if passed argument is type compatible with specified field. The argument can be a reference as well. In case of argument being reference to another data in container, no type compatiblity checking will be done.
Params factory = the factory which will be configured to set property. arg = the value of property to be set, or reference to data in container.
Returns
Z.