Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do you call a single header whose purpose is to include other header files?

I've seen this done before in various C++ libraries - namely Qt (QtCore, QtGui, etc.) and Irrlicht (irrlicht.h):

// file - mylibrary.h

#include "someclass1.h"
#include "someclass2.h"
#include "someclass3.h"
// and so on...

Obviously this exists for convenience - a programmer wishing to use the library only has to include one header instead of lots of different ones. My question is, is there a special name for this type of header file? Even if there's not an "official" name, what you you refer to it as? A "convenience header" or "module header" or something?


Names given so far (with sources):

  • Convenience header (Boost)
  • Master header (Apple Official Documentation, An MSDN blog)
  • Meta-header (The Game Programming Wiki)

User contributions (no sources):

  • Header header (Larry Watanabe)
  • Umbrella header (Chuck)
like image 606
Jake Petroules Avatar asked Jun 26 '10 02:06

Jake Petroules


People also ask

Which one is another way to include header files?

You make the declarations in a header file, then use the #include directive in every . cpp file or other header file that requires that declaration. The #include directive inserts a copy of the header file directly into the . cpp file prior to compilation.

Can you include header files in header files?

Yes, this will work. Note, however, that if you include a lot of headers in this file and don't need all of them in each of your source files, it will likely increase your compilation time.

Which header file is used to include?

You request to use a header file in your program by including it with the C preprocessing directive #include, like you have seen inclusion of stdio. h header file, which comes along with your compiler.

What are the two types of header files?

There are of 2 types of header file: Pre-existing header files: Files which are already available in C/C++ compiler we just need to import them. User-defined header files: These files are defined by the user and can be imported using “#include”.


1 Answers

That's a nice question :)

I've found some sources that call it master header file, e.g:

  • Apple Official Documentation
  • An MSDN blog

When it is used to host headers for the header precompiler, it could be called precompiler global header:

  • http://www.rfoinc.com/docs/qnx/watcom/compiler-tools/cpheader.html

However I don't think that there's a single widespread way to call it.

like image 200
lornova Avatar answered Oct 03 '22 04:10

lornova