Version 1.5.0
Summary
- Added
EXPOSE_DEPENDENCIESmacro to registerInitDependenciessignature - Added
IInjector::CanInjectmethod to check if dependencies may be injected in class
InitDependencies registration
In previous versions you had to register all types in container before you could use them. Most annoying part was registration of types for IInjector usage.
Those issues are now resolved with EXPOSE_DEPENDENCIES macro. You can use it to register the class inside its own cpp file:
#include "MyClass.h"
#include "SomeDependency.h"
#include "DI/ExposeDependencies.h" // new header contains everything you need
EXPOSE_DEPENDENCIES(UMyClass);
void UMyClass::InitDependencies( USomeDependency* InDependency )
{
// Do something with InDependency
}After that you can use IInjector to inject dependencies to UMyClass objects. And you can use IInjector::CanInject method to check if InitDependencies signature was registered for given class.