I am trying to design a worker and a task class and am having some trouble with getting it right. The basic design that I have implemented is
class Result{
void isComplete()
void cancel()
...
}
class Task{
Result Submit()
...
}
I want to create a version of these where I can also return an object in the result. Like this,
template<typename T>
class Result : Result{
T* GetResult();
}
template<typename T>
class Task : Task {
void SetResult(T* result);
}
what is the best way to achieve this? I was thinking of creating a class with void as a default parameter but am not sure if void can be passed into a method as an argument.