Been using the solutions for a while… first question asked. (Not sure if this is the proper venue). I am stuck with a design problem.
I have 3 classes, User, Strategy, & Communicator.
I would like User to have a pointer to Communicator, and call functions when necessary.
I would like User to have a list of class Strategy, and call functions of Strategy when necessary.
I would like Communicator to have a list of class Strategy, and a pointer to User, and call functions on those when necessary.
If it helps, Communicator is merely a wrapper around a socket connection which listens to messages from the client and sends them to User or Strategy, whichever is appropriate. It also contains a function Send(string message) which sends messages from User & Strategy to the client.
The problem is that I cannot compile, since the header files end up including each other.
Any ideas would be greatly appreciated!
Forward declarations are your friends.
Strategy.h:
Strategy.cpp: