简体   繁体   English

什么叫单个头文件,其目的是包含其他头文件?

[英]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):我以前在各种 C++ 库中看到过这种情况——即 Qt(QtCore、QtGui 等)和 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 ):到目前为止给出的名称(带有来源):

User contributions ( no sources ):用户贡献(无来源):

That's a nice question :)这是一个很好的问题:)

I've found some sources that call it master header file , eg:我发现了一些称其为master header file 的来源,例如:

When it is used to host headers for the header precompiler, it could be called precompiler global header :当它用于托管头预编译器的头时,它可以称为预编译器全局头

However I don't think that there's a single widespread way to call it.但是,我认为没有一种普遍的称呼方式。

我不知道有没有正式的名字,但我唯一听说过的就是“伞”。

convenience header方便头

I have seen them referred to as convenience header files.我已经看到它们被称为便利头文件。 Here is one example from boost that I pull up with a quick google search. 下面是一个来自 boost 的例子,我通过谷歌快速搜索找到了它。


meta-header元头

Never actually heard/seen someone call it a meta-header but the idea fits and is much easier to say than umbrella or convenience .从未真正听说过/见过有人称其为元标题,但这个想法很合适,而且比起保护伞便利说起来容易得多。 I even found a reference to that name with a google search.我什至在谷歌搜索中找到了对该名称的引用

how about怎么样

header header?标题标题?

:) :)

我喜欢“元标题”(这是我第二次发明的:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM