aermicioi.aedi.factory.generic_factory

Members

Aliases

isNonStaticMethodCompatible
alias isNonStaticMethodCompatible = templateAnd!(isMethodCompatible, chain!(templateNot!isStaticFunction, getCompatibleOverload))
Undocumented in source.
isNonStaticMethodCompatibleAndReturnTypeOf
alias isNonStaticMethodCompatibleAndReturnTypeOf(X) = templateAnd!(isMethodCompatible, chain!(templateNot!isStaticFunction, getCompatibleOverload), partialSuffixed!(chain!(partialPrefixed!(get, 0), getCompatibleOverload), X))
Undocumented in source.
isStaticMethodCompatible
alias isStaticMethodCompatible = templateAnd!(isMethodCompatible, chain!(isStaticFunction, getCompatibleOverload))
Undocumented in source.

Classes

CallbackConfigurer
class CallbackConfigurer(T, X, Dg, Args...)

Configures/modifies component of type T with help of a delegate or function.

CallbackFactory
class CallbackFactory(T, Dg, Args...)

Instantiates component of type T using a delegate or function.

CallbackInstaceDestructor
class CallbackInstaceDestructor(T, Dg : void delegate(RCIAllocator, ref T destructable, Args), Args...)

Instance destructor that uses a callback to destroy and deallocate components of type T.

ConstructorBasedFactory
class ConstructorBasedFactory(T, Args...)

Instantiates component using it's constructor with args.

DefaultFailingInstanceFactory
class DefaultFailingInstanceFactory(T)

An instance constructor aimed to throw exception.

DefaultInstanceDestructor
class DefaultInstanceDestructor(T)

Default implementation of destructor that calls dispose upon @safe classes only.

DefaultInstanceFactory
class DefaultInstanceFactory(T)

Instantiates a component using it's constructor with no arguments.

DelegatingInstanceFactory
class DelegatingInstanceFactory(T, X : T)

InstanceFactory that delegates the task of instantiating a component to some third party factory.

FieldConfigurer
class FieldConfigurer(T, string property, Arg)

Sets component's field to a value.

GenericFactoryImpl
class GenericFactoryImpl(T)

A concrete implementation of GenericFactory interface.

MethodConfigurer
class MethodConfigurer(T, string property, Args...)

Calls component's method with a set of arguments.

ValueInstanceFactory
class ValueInstanceFactory(T)

Instantiates a component using a value as basis.

Functions

callbackConfigurer
auto callbackConfigurer(void delegate(Locator!(), X, Args) dg, Args args)
auto callbackConfigurer(void function(Locator!(), X, Args) dg, Args args)
auto callbackConfigurer(void delegate(Locator!(), ref X, Args) dg, Args args)
auto callbackConfigurer(void function(Locator!(), ref X, Args) dg, Args args)

Configures/modifies component of type T with help of a delegate or function.

callbackFactory
auto callbackFactory(T delegate(RCIAllocator, Locator!(), Args) dg, Args args)
auto callbackFactory(T function(RCIAllocator, Locator!(), Args) dg, Args args)

Instantiates component of type T using a delegate or function.

callbackInstanceDestructor
CallbackInstaceDestructor!(T, Dg, Args) callbackInstanceDestructor(Dg dg, Args args)

Instance destructor that uses a callback to destroy and deallocate components of type T.

constructorBasedFactory
auto constructorBasedFactory(Args args)

Instantiates component using it's constructor with args.

factoryMethodBasedFactory
auto factoryMethodBasedFactory(Args args)

Instantiates a component using a method from other component (factory method pattern).

factoryMethodInstanceDestructor
auto factoryMethodInstanceDestructor(T destructor, Args arguments)
auto factoryMethodInstanceDestructor(Args arguments)

Create an instance destructor that uses third party component's method to do destruction of a component.

fieldConfigurer
auto fieldConfigurer(Arg arg)

Sets component's field to a value.

functionInstanceFactory
auto functionInstanceFactory(Dg dg, Args args)

Instantiates a component using a function/delegate with args

genericFactory
GenericFactory!T genericFactory(Locator!() locator)

A concrete implementation of GenericFactory interface.

methodConfigurer
auto methodConfigurer(Args args)

Calls component's method with a set of arguments.

Interfaces

GenericFactory
interface GenericFactory(T)

A generic factory, is a factory that instantiates component of type T using InstanceFactory and a list of PropertyConfigurers.

InstanceDestructor
interface InstanceDestructor(T)

An interface for components that can destruct components of type T and deallocate them using provided allocator.

InstanceDestructorAware
interface InstanceDestructorAware(T)

Interface for objects that are aware of an instance factory and can use it to instantiate a component.

InstanceFactory
interface InstanceFactory(T)

An instance factory, instantiates component of type T.

InstanceFactoryAware
interface InstanceFactoryAware(T)

Interface for objects that are aware of an instance factory and can use it to instantiate a component.

PropertyConfigurer
interface PropertyConfigurer(T)

A property configurer, has the purpose to modify component of type T according to some logic encapsulated in it.

PropertyConfigurersAware
interface PropertyConfigurersAware(T)

Interface for objects that are aware of a set of property configurers and can use them to configure some component.

Mixin templates

InstanceDestructorAwareDecoratorMixin
mixintemplate InstanceDestructorAwareDecoratorMixin(T)

A default implementation that delegates the instance destructor setting to decorated component.

InstanceDestructorAwareMixin
mixintemplate InstanceDestructorAwareMixin(T)

A default implementation for storing/accessing instance destructor.

InstanceDestructorDecoratorMixin
mixintemplate InstanceDestructorDecoratorMixin(T)

A default implementation that delegates the destrcution to decorated component.

InstanceFactoryAwareDecoratorMixin
mixintemplate InstanceFactoryAwareDecoratorMixin(T)

A default implementation that delegates the instance factory setting to decorated component.

InstanceFactoryAwareMixin
mixintemplate InstanceFactoryAwareMixin(T)

A default implementation for storing/accessing instance factory.

InstanceFactoryDecoratorMixin
mixintemplate InstanceFactoryDecoratorMixin(T)

A default implementation that delegates construction to decorated implementation

ParameterHolder
mixintemplate ParameterHolder(Args...)

ParameterHolder Stores a set of Args for futher usage in it's subclasses.

PropertyConfigurerDecoratorMixin
mixintemplate PropertyConfigurerDecoratorMixin(T)

A default implementation that delegates to decorated configurator.

PropertyConfigurersAwareDecoratorMixin
mixintemplate PropertyConfigurersAwareDecoratorMixin(T)

A default implementation that delegates the instance destructor setting to decorated component.

PropertyConfigurersAwareMixin
mixintemplate PropertyConfigurersAwareMixin(T)

A default implementation for storing property configurers.

assertFieldCompatible
mixintemplate assertFieldCompatible(T, string field, Arg)
Undocumented in source.
assertObjectConstructorCompatible
mixintemplate assertObjectConstructorCompatible(T, Args...)
Undocumented in source.
assertObjectMethodCompatible
mixintemplate assertObjectMethodCompatible(T, string method, Args...)
Undocumented in source.

Templates

FactoryMethodBasedFactory
template FactoryMethodBasedFactory(T, string method, W, Args...)

Instantiates a component using a method from other component (factory method pattern).

FactoryMethodInstanceDestructor
template FactoryMethodInstanceDestructor(string method, T, Z, Args...)

Instance destructor using an third party component to do destruction of components.

FactoryMethodInstanceFactory
template FactoryMethodInstanceFactory(string method, T, W, Args...)

Instantiates a component using a method from other component (factory method pattern).

FunctionInstanceFactory
template FunctionInstanceFactory(Dg, Args...)

Instantiates a component using a function/delegate with args

getCompatibleOverload
template getCompatibleOverload(T, string method, Args...)
Undocumented in source.
isArgumentListCompatible
template isArgumentListCompatible(alias func, ArgTuple...)

A check if the argument list passed to ConstructorBasedFactory or MethodConfigurer is compatible with signature of underlying method or constructor.

isMethodCompatible
template isMethodCompatible(T, string method, Args...)
Undocumented in source.

Variables

isFieldCompatible
enum bool isFieldCompatible(T, string field, Arg);
Undocumented in source.
isObjectConstructorCompatible
enum bool isObjectConstructorCompatible(T, Args...);
Undocumented in source.
isObjectMethodCompatible
enum bool isObjectMethodCompatible(T, string method, Args...);
Undocumented in source.

Meta

License

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors

Alexandru Ermicioi