I'm restructuring my app to allow Components and other classes to access objects via shared pointers in my main JUCEApplication. I've taken inspiration from Introjucer, however, run into some difficulties with circular header includes.
So I split up the main part of Main.cpp into Application.h similar to how its done in Introjucer. So I could then include it in the Components and classes where I want to access the shared objects. This is all good - however, I need to include MainComponent in Application.h. And in MainComponent.h I need to include Application.h so that (in this case) I can access the app settings via shared pointer to PropertiesFile.
I tried using forward declarations but I need to declare functions to access the private shared pointers, but I need function declarations too so might as well use a seperate header file.
My next step will be to split out Application.h into cpp and header file, or a stripped down header just for includes in Components... but not sure how best to deal with the inner MainWindow class.
I'm wondering if I'm overcomplicating things here or if I'm going down the right track or not.
Thanks