L
Leon Mergen
Hello,
Ok, I'm having a problem when trying to make the classes I make a bit
more generic. Consider this:
I have one class, ClassA. This defines some interface methods, and
ClassB inherits from it, and adds some of its own variables. Now, I'm
making a library, which accepts ClassA.
Now the problem is, this library also creates a lot of threads. I want
each of these threads to contain their own instance of ClassA ( so
indirectly, ClassB ). But since there's no way for each of these threads
to know the size of ClassB, it seems impossible to me to let each of
those classes each have a unique instance of ClassB. Ofcourse, I could
use pointers to solve this problem, but this will only work if I create
a new pointer of ClassB for each of those threads /before/ calling the
library that creates those threads. But this isn't really a solution,
since the number of threads should not be known by the calling class.
Any idea at all how I can solve this problem using a somewhat elegant
solution ?
Thanks in advance for any responses!
Regards,
Leon Mergen
http://www.solatis.com/
Ok, I'm having a problem when trying to make the classes I make a bit
more generic. Consider this:
I have one class, ClassA. This defines some interface methods, and
ClassB inherits from it, and adds some of its own variables. Now, I'm
making a library, which accepts ClassA.
Now the problem is, this library also creates a lot of threads. I want
each of these threads to contain their own instance of ClassA ( so
indirectly, ClassB ). But since there's no way for each of these threads
to know the size of ClassB, it seems impossible to me to let each of
those classes each have a unique instance of ClassB. Ofcourse, I could
use pointers to solve this problem, but this will only work if I create
a new pointer of ClassB for each of those threads /before/ calling the
library that creates those threads. But this isn't really a solution,
since the number of threads should not be known by the calling class.
Any idea at all how I can solve this problem using a somewhat elegant
solution ?
Thanks in advance for any responses!
Regards,
Leon Mergen
http://www.solatis.com/