Function factoryMethod
Invoke T's method to create component of type X.
Z factoryMethod(T, string method, Z, X, W, Args...)
(
Z factory,
auto ref W factoryMethod,
auto ref Args args
)
if (isNonStaticMethodCompatible!(T, method, Args) && (is(W : T) || is(W : RuntimeReference)));
Z factoryMethod(T, string method, Z, X, Args...)
(
Z factory,
auto ref Args args
)
if (isStaticMethodCompatible!(T, method, Args));Configures component's factory to call method of factoryMethod with args, in order to create component of type X. In case when method is not a static member, the function requires to pass a instance of factoryMethod or a reference to it. The algorithm will check for args compatiblity with parameters of factory method. No type check is done for arguments that are references at compile time.
Parameters
| Name | Description |
|---|---|
| factory | component's factory that is configured to call factoryMethod methods to spawn component |
| factoryMethod | instance of factory method that will be used to instantiate component |
| args | a list of arguments passed to factory method |
| T | type of factoryMethod |
| method | the method that is called from T to instantiate component |
| W | either LocatorReference or T |
| X | the return type of T.method member |