M
MattWilson.6185
Hi, I'm trying to find out if something is possible, I have a few
diffrent lists that I add objects to and I would like to be able to
have a wrapper class that won't affect the internal object, for
instnace
class base {
};
class a : public base {
};
class b : public base {
};
class physicsFunctions : public base {
physicsFunctions(base* _base);
}
class displayFuncitons : public base {
displayFuncitons(base* _base)
}
now if I want to create something that is displayable I would like to
be able to use
base* a_class = new a();
displayFunctions* display = new displayFuncitons(a_class);
furthur more I would like to be able to in the future add functionality
to it by
physicsFuncitons* phys = new physicsFuncitons(display);
I was hopeing that there was some way i could say in the constructor
don't use a new instance of the base class, use this one that is
already made, otherwise I am copping allot of code over and over again.
Thanks!
diffrent lists that I add objects to and I would like to be able to
have a wrapper class that won't affect the internal object, for
instnace
class base {
};
class a : public base {
};
class b : public base {
};
class physicsFunctions : public base {
physicsFunctions(base* _base);
}
class displayFuncitons : public base {
displayFuncitons(base* _base)
}
now if I want to create something that is displayable I would like to
be able to use
base* a_class = new a();
displayFunctions* display = new displayFuncitons(a_class);
furthur more I would like to be able to in the future add functionality
to it by
physicsFuncitons* phys = new physicsFuncitons(display);
I was hopeing that there was some way i could say in the constructor
don't use a new instance of the base class, use this one that is
already made, otherwise I am copping allot of code over and over again.
Thanks!