mhoover
10th February 2006, 02:06
Hello!
I work in a lemonade factory. We have data servers in our vats to tell us things like: pH level, sugar level, etc. Each vat has a separate data structure it passes to the data client GUI which I'm writing.
I have a bunch of pointers - one for each vat - to a lemonade template class, and I want to get them in an array or list somehow. The problem is that they are all different types.
Currently, they look like this:
LlcsLemonadeDataClient<YELLOW_LEM> *yellow_dc_p;
LlcsLemonadeDataClient<PINK_LEM> *pink_dc_p;
LlcsLemonadeDataClient<MELONADE> *melon_dc_p;
Is there any way I could do something like:
LlcsLemonadeDataClient <?> *lemonade_list[10];
?
My goal is to iterate through all the different lemonade data clients I have and set the pointers to NULL. And similar tasks. Currently I have to name every lemonade type in the factory and manually set the pointer to NULL:
yellow_dc_p = NULL;
pink_dc_p = NULL;
...
Any ideas? Is there an STL or Qt container approach?
I work in a lemonade factory. We have data servers in our vats to tell us things like: pH level, sugar level, etc. Each vat has a separate data structure it passes to the data client GUI which I'm writing.
I have a bunch of pointers - one for each vat - to a lemonade template class, and I want to get them in an array or list somehow. The problem is that they are all different types.
Currently, they look like this:
LlcsLemonadeDataClient<YELLOW_LEM> *yellow_dc_p;
LlcsLemonadeDataClient<PINK_LEM> *pink_dc_p;
LlcsLemonadeDataClient<MELONADE> *melon_dc_p;
Is there any way I could do something like:
LlcsLemonadeDataClient <?> *lemonade_list[10];
?
My goal is to iterate through all the different lemonade data clients I have and set the pointers to NULL. And similar tasks. Currently I have to name every lemonade type in the factory and manually set the pointer to NULL:
yellow_dc_p = NULL;
pink_dc_p = NULL;
...
Any ideas? Is there an STL or Qt container approach?