Class CallbackFactory

Instantiates component of type T using a delegate or function.

class CallbackFactory(T, Dg, Args...)
  
if (is(Dg == T delegate(IAllocator, Locator!(), Args)) || is(Dg == T function(IAllocator, Locator!(), Args)));

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.

Constructors

NameDescription
this Constructor for CallbackFactory!(T, Dg, Args)

Methods

NameDescription
factory See InstanceFactory interface

Parameters

NameDescription
T the constructed component
Args type tuple of arguments passed to delegate for component's construction.