Thank you. It helped me.
I think it took me a week to think about my own standard of structure.
See:
Code:
Include // Shared libraries - Libraries that used for other projects and not stored in any project
MyFooLib
MyBarLib
...
ProjectA // Some project
Resource // Resource for the project
icon.png
manifest.json
...
Source // Source code of the project
Include // Libraries that can be hosted as shared libraries but for now they are here
MyBazLib
MyQuxLib
...
Modules // Collection of modules that used for the source (Sources files that are specific for the program)
Main.h // The main entry that manage all the logic that implemented in ModuleA, ModuleB and more
Main.src.h /* Source code of the main entry.
This file contains 2 functions:
bool Init() - This function will call to initializer methods of ModuleA, ModuleB (if needed)
int While() - This function should be called after all inits
The function will call to any processing function under ModuleA, ModuleB if needed
*/
ModuleA.h // Contains any declarations (variables, functions, classes) for ModuleA
ModuleA.src.h // Contains any definitions for ModuleA
ModuleB.h // Same ...
ModuleB.src.h // Same ..
...
Boot.cpp /* The "boot loader" is the only cpp file with the main() method.
It responsible for performing the *boot operation* of the Program.
*boot operation* = any logics that are *initializations*.
*initializations* = the following tasks:
- Include any Shared libraries (example: MyFooLib, MyBarLib)
- Include any other libraries under include folder in Source folder
- Include all Modules. *First include the .h files and then include the .src.h files
- May declare variables and functions that are used for the *boot operation* logic.
(for example, it may do some logic that is a result of command line parameters)
- The main() function will be here and:
A) Call to Main::Init()
B) Following code:
int exitCode = Main::While();
return exitCode;
*/
I think that this is the best way to do it according to a lot of my thoughts experiments and other experience from different programming languages.
What do you think?