I have a class A
that implements interface IA
:
class A : IA
{
f(){...}
}
I want to wrap A
using a new class WrapA
that will implement IA
as well, with the intention of wrapping A
by calling each one of its functions as a new task:
class WrapA : IA
{
private A;
f()
{
StartInNewTask(A.f());
}
}
Of course this is very easy to do manually.
But I want an automatic mechanism for this wrapping, similar to the one mocks use to mock interfaces.
If it was done before I would love to see an example, or any idea on how to implement it.