I have some classes that I like to compile into a core lib so I can use them easily in upcoming projects. My idea now is to typedef common types like e.g. Byte, Word, DWord, etc but also something like Index16 and Index32. Some of these types may be already defined in other headers ( windows.h for example ).
What is the common strategy to do this?
Do I have to keep some special including order?
This is my idea at the moment:
I have several classes in my core module ( one .h and .cpp file for each class ). Then I define one master header ( the only public header for this module ) let's call it core.h using the following structure:
Display All
All comments are welcome!!
Best regards
-Dirk
What is the common strategy to do this?
Do I have to keep some special including order?
This is my idea at the moment:
I have several classes in my core module ( one .h and .cpp file for each class ). Then I define one master header ( the only public header for this module ) let's call it core.h using the following structure:
C Source Code
- // First we define/typedef the basic types which is done
- // platform dependent in seperate headers
- #ifdef _WIN32
- #include <Win32Types.h>
- #endif
- #ifdef SOMETHING_ELSE
- ...
- #endif
- // Define anything else
- // Then I include the class header of the module
- #include <Vector.h>
- #include <Matrix.h>
- #include <Archive.h>
All comments are welcome!!
Best regards
-Dirk