Hi.
I know the title looks a little bit silly and that we can not have pure virtual static functions. But i've been wondering what approach to take to make the abstraction.
This is the case: I have an abstract class with one pure virual function. Now, all of the classes derived from the base abstract class have a ThreadProc function, for the job that the worker threads do. They must have it because of the nature of the abstract class. So, in all of them i would make a function like:
static DWORD WINAPI ThreadProc(LPVO ID lpParameter);
It's all fine, and of course it works. But i just want to make sure that all of the derived classes will have that function implemented. Now, that's what the pure virtual functions are for, but since the function must be static, it can not be a pure virtual AND static at the same time.
Please give me any tips on this one.
Cheers
I know the title looks a little bit silly and that we can not have pure virtual static functions. But i've been wondering what approach to take to make the abstraction.
This is the case: I have an abstract class with one pure virual function. Now, all of the classes derived from the base abstract class have a ThreadProc function, for the job that the worker threads do. They must have it because of the nature of the abstract class. So, in all of them i would make a function like:
static DWORD WINAPI ThreadProc(LPVO ID lpParameter);
It's all fine, and of course it works. But i just want to make sure that all of the derived classes will have that function implemented. Now, that's what the pure virtual functions are for, but since the function must be static, it can not be a pure virtual AND static at the same time.
Please give me any tips on this one.
Cheers
Comment