Hi,
I'd like to have one instance of parent class for communication with serial port. Now child instances beside their own data also contribute to "global" send/receive queue in parent class. Now I have method in parent instance that deals with this queue. Method is inherited into child instances and when I call it - I get reference to child object, but would like to perform operations on parent instance' queue.
Now I would like somehow to get to reference of parent instance from reference of child instance that got into method. How to do this ?
Thanks,
Robert.
| [reply] |
You probably don't have an "IS-A" relationship then, but rather a "HAS-A" relationship. One instance of one class (your "parent class") owning a bunch of other specialized classes (your "child class").
| [reply] |
Hi,
Sorry for my dumbness, but this still doesn't help me a lot. I'd just like to know if I have reference to instance, can I somehow get reference to parent instance and how?
Thanks,
Robert.
| [reply] |