canFactoryGenericFactory

Checks if a structure has factory method for GenericFactory.

This static interface is used by annotation system to identify annotations that mark an object as instantiable by container. The @component annotation is such a structure that implements this static interface and therefore it is possible to use it to mark components instantiable. A "@component" annotation must have a factory method that returns a GenericFactory instance that further will be used to configure an instantiable object. In such a way it is possbile to define other custom annotations that return GenericFactory implementations that add/or behave differrently comparing to default implementation of GenericFactory.

Members

Aliases

checker
alias checker = templateOr!(chain!(partialPrefixed!(isDerived, ReturnType!(factory!Z)), chain!(GenericFactory, Wrapper)), chain!(partialPrefixed!(isDerived, ReturnType!(factory!Z)), GenericFactory))
Undocumented in source.
factory
alias factory = getMember!(T, "factory")
Undocumented in source.

Variables

canFactoryGenericFactory
enum bool canFactoryGenericFactory;
Undocumented in source.
canFactoryGenericFactory
enum bool canFactoryGenericFactory;
Undocumented in source.

Parameters

T

the structure to be tested for interface compatibility

Z

the type of object that T has to instantiate

Return Value

true in case of structure implementing static interface, false otherwise.

Examples

struct Component {
    GenericFactory!T factory(T)(Locator!() locator) {
        return new GenericFactoryImpl!(T)(locator);
    }
}

Meta