There are not hard set rules for this, but more like best practices.
Here's a quick counter example from your list. You stated that all template functions belong in the .hpp file. However, if my template function is only required from within a certain .cpp file, it would be best to define that template function inside that .cpp. You really wouldn't want to create a .hpp just for that template function that's used in just one .cpp file. Templates don't HAVE TO be declared in a .hpp file, the compiler doesn't care.
Here is a popular book that talks about best practices on how to organize your projects.
I worked on the Windows operating system and Internet Explorer at various points in my career. With very large projects like those, even normally trivial problems become significant engineering tasks when doing so at those scales. Just compiling the core library of IE (allocators, text handling, dom, etc) could take half an hour, so you really came to appreciate incremental builds.
To get a sense of the scale of such problems, I might recommend the book Large Scale C++ Design. I remember finding the book very dry, but in the author's defense, it's a very dry problem space.
Large Scale C++ Software Design must have been your archetype for this question.
Did you someone post this into the future? Do you live in 1985?
Just kidding ;)
These two are pretty good:
No idea about Fortran or Ada. Those languages are ancient and not used often. You in defense contracting?
His book is good too on this sort of topic. (I think, anyway.) There are also some expensive videos as part of a workshop.
Next time you're doing step 3 read this book which might help you cut down on compile times.
> but connection isn't defined in the message.h (and if I include it, it won't compile because the class is defined twice).
What you need to do here is declare (but not define) anonymous class like this:
class B;
class A { B *not_defined_but_ok; };
class B { // actually define here };
You just have to make sure that you only use pointers to undefined classes, since in order to actually put an instance of B in A the compiler would have to know the size of a B, which it doesn't know yet.
You might want to read Large-Scale C++ Software Design to start. The subject of how to organize a large scale c++ project might be outside the scope of a reddit comment.