register - multiple declarations
Function register
Register a new factory for type T object into storage/DI container by id.
auto deprecated auto register(Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator,
string id
);
auto deprecated auto register(Type)
(
ConfigurableContainer storage,
string id
);
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
storage | the storage where factory will be stored. |
locator | the locator that will be used by GenericFactory implementation to fetch required objects. |
id | the identity by which to register the factory in storage. |
Returns
GenericFactory implementation for further configuration.
Function register
Register a new factory for type Type object into storage/DI container by it's fully qualified name.
auto deprecated auto register(Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator
);
auto deprecated auto register(Type)
(
ConfigurableContainer storage
);
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
storage | the storage where factory will be stored. |
locator | the locator that will be used by GenericFactory implementation to fetch required objects. |
Returns
GenericFactory implementation for further configuration.
Function register
Register a new factory for type T object into storage/DI container by Interface fully qualified name.
auto deprecated auto register(Interface, Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator
)
if (is(Type : Interface) && isReferenceType!Type);
auto deprecated auto register(Interface, Type)
(
ConfigurableContainer storage
);
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
Interface | interface implemented by object registered in storage |
storage | the storage where factory will be stored. |
locator | the locator that will be used by GenericFactory implementation to fetch required objects. |
Returns
GenericFactory implementation for further configuration.
Function register
Register an object into a storage by storageId located in storageLocator.
auto deprecated auto register(Type, R)
(
R storageLocator,
Locator!() locator,
string id,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
auto deprecated auto register(Type, R)
(
R locator,
string id,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
storageLocator | locator containing the storage where to store object. |
locator | locator used to fetch dependencies for registered object |
id | the id of object registered in storage |
storageId | the id of storage where object is stored. |
Throws
NotFoundException when storage with storageId is not found.
Returns
storageLocator for further configuration
Function register
Register an object into a storage by storageId located in storageLocator with id being FQN of an Interface that object implements.
auto deprecated auto register(Interface, Type, R)
(
R storageLocator,
Locator!() locator,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
auto deprecated auto register(Interface, Type, R)
(
R locator,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
Parameters
Name | Description |
---|---|
Interface | interface that object implements |
Type | the type of object registered in storage |
storageLocator | locator containing the storage where to store object. |
locator | locator used to fetch dependencies for registered object |
storageId | the id of storage where object is stored. |
Throws
NotFoundException when storage with storageId is not found.
Returns
storageLocator for further configuration
Function register
Register component into an object storage.
Wraps up any already instantiated component that is not reference type into an object, and saves it into storage. Any component that is of reference type is just saved in storage
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
storage | the storage were component is saved |
data | actual component to be saved |
id | the identity of data that is to be saved. |
Returns
the storage were component was saved.
Function register
Register data inta a object storage identified by it's type.
Wraps up any copy-by-value component into an object, and saves it into storage by it's type.
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
storage | the storage were component is saved |
data | actual component to be saved |
Returns
the storage were component was saved.
Function register
Register component into an object storage identified by implemented interface.
auto deprecated auto register(Interface, Type)
(
Storage!(Object,string) storage,
Type data
)
if (is(Type : Interface) && !is(Type == Interface));
Wraps up any copy-by-value component into an object, and saves it into storage by it's type.
Parameters
Name | Description |
---|---|
Interface | interface that object implements |
Type | the type of object registered in storage |
storage | the storage were component is saved |
data | actual component to be saved |
Returns
the storage were component was saved.
Function register
Register component into an object storage located in locator by storageId.
auto deprecated auto register(Type, R)
(
R locator,
Type data,
string id,
string storageId = "parameters"
)
if (!is(R : Storage!(Object, string)));
auto deprecated auto register(Interface, Type, R)
(
R storage,
Type object,
string storageId = "parameters"
)
if (is(Type : Interface) && !is(R : Storage!(Object, string)) && !is(Type == Interface));
Parameters
Name | Description |
---|---|
Type | the type of object registered in storage |
locator | locator containing object storage were component is saved. |
data | the actual component saved in storage |
id | the id by which component will be identified |
storageId | identity of storage in locator |