CallbackFactory

Instantiates component of type T using a delegate or function.

Encapsulates component's construction logic using a delegate. The algorithm uses a delegate to create required component, with a set of Args that are passed to delegate, and a locator for dependency fetching.

@safe
class CallbackFactory : InstanceFactory!T(
T
Dg
Args...
) if (
(
is(Dg == T delegate
(
RCIAllocator
,
Locator!()
,
Args
)
) ||
is(Dg == T function
(
RCIAllocator
,
Locator!()
,
Args
)
)
)
) {}

Constructors

this
this(Dg dg, Args args)

Constructor for CallbackFactory!(T, Dg, Args)

Members

Functions

factory
T factory()

See InstanceFactory interface

Mixins

__anonymous
mixin LocatorAwareMixin!(typeof(this))
Undocumented in source.
__anonymous
mixin AllocatorAwareMixin!(typeof(this))
Undocumented in source.
__anonymous
mixin ParameterHolder!Args
Undocumented in source.

Parameters

T

the constructed component

Args

type tuple of arguments passed to delegate for component's construction.

Meta