-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Description
Hi there,
I have the following problem:
I have a class with an assisted parameter and a component in the constructor. The assisted variable is needed for the construction of the component. How can I solve this problem. I did not find a straight forward solution in the wiki.
class OuterClass {
public INJECT(OuterClass(ASSISTED(const TypeEnum) type, IClass* innerClass));
};
for the innerClass I have a method which returns an actual class according to the type:
fruit::Component<IClass> getInnerClassComponent(const TypeEnum type)
{
switch (type)
{
case TypeEnum::A: return getType1Component();
// etc
}
the factory looks like this:
fruit::Component<OuterClassFactory> getOuterClassComponent()
{
return fruit::createComponent().bind<IOuterClass, OuterClass>().install(getInnerClassComponent, TypeEnum::A); // <-- here I want to use the param with which the factory is called
}
Metadata
Metadata
Assignees
Labels
No labels