Communication between c++ objects.
- by Pradyot
This is an issue, that I have come acrosss earlier.
Basically a c++ object has a member object that does some work, once the work is done , a notification needs to made to the parent.
What is the most elegant solution to allow this communication.
Does being in this position indicate a flaw with the design to begin with?
To elaborate.
class A {
B member;
void do_something();
}
class B{
void talk_to_network();
};
void do_something()
{
//Conditional wait on a variable that will change when talk to network completes.
//So need a way for B to inform A, that it is done.
}