register - multiple declarations
Function register
Register a new factory for type T object into storage/DI container by id.
auto auto register(Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator,
string id
);
auto 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 auto register(Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator
);
auto 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 auto register(Interface, Type)
(
Storage!(ObjectFactory,string) storage,
Locator!(Object,string) locator
)
if (is(Type : Interface) && isReferenceType!Type);
auto 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 auto register(Type, R)
(
R storageLocator,
Locator!() locator,
string id,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
auto 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 auto register(Interface, Type, R)
(
R storageLocator,
Locator!() locator,
string storageId = "singleton"
)
if (!is(R : Storage!(ObjectFactory, string)));
auto 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 data into an object storage.
Wraps up any already instantiated data that is not reference type into an object, and saves it into storage. Any data 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 data is saved |
data | actual data to be saved |
id | the identity of data that is to be saved. |
Returns
the storage were data was saved.
Function register
Register data inta a object storage identified by it's type.
Wraps up any copy-by-value data 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 data is saved |
data | actual data to be saved |
Returns
the storage were data was saved.
Function register
Register data into an object storage identified by implemented interface.
auto auto register(Interface, Type)
(
Storage!(Object,string) storage,
Type data
)
if (is(Type : Interface) && !is(Type == Interface));
Wraps up any copy-by-value data 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 data is saved |
data | actual data to be saved |
Returns
the storage were data was saved.
Function register
Register data into an object storage located in locator by storageId.
auto auto register(Type, R)
(
R locator,
Type data,
string id,
string storageId = "parameters"
)
if (!is(R : Storage!(Object, string)));
auto 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 data is saved. |
data | the actual data saved in storage |
id | the id by which data will be identified |
storageId | identity of storage in locator |