- Header files.
- In general, every .cc file should have an associated .h file. There are some common exceptions, such as unittests and small .cc files containing just a main() function.
- Header files should be self-contained and end in ".h". Files that are meant for textual inclusion, but are not headers, should end in ".inc".
- There are rare cases where a file is not meant to be self-contained, but instead is meant to be textually included at a specific point in the code. Examples are files that need to be included multiple times or platform-specific extensions that essentially are part of other headers. Such files should use the file extension .inc.
- All header files should have #define guards to prevent multiple inclusion. The format of the symbol name should be <PROJECT>_<PATH>_<FILE>_H_. For example, the file foo/src/bar/baz.h should define FOO_BAR_BAZ_H_. To guarantee uniqueness
- You may forward declare ordinary classes in order to avoid unnecessary #includes.