Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Add information regarding header include order #4020

Merged
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions doc/advanced/content/pcl_style_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,70 @@ Command line usage:
$ make format


2.7. Includes
^^^^^^^^^^^^^

For consistent usage, headers should be included in the following order with alphabetical grouping ensured:

1. PCL headers

i. All modular PCL includes, except main includes of common module.

Examples:

.. code-block:: cpp

#include <pcl/common/common.h>

.. code-block:: cpp

#include <pcl/simulation/camera.h>

.. code-block:: cpp

#include <pcl/ml/dt/decision_forest.h>
diivm marked this conversation as resolved.
Show resolved Hide resolved

#. The main PCL includes of common module. These are the header files in the ``pcl/common/include/pcl/`` directory.

Examples:

.. code-block:: cpp

#include <pcl/memory.h>

.. code-block:: cpp

#include <pcl/pcl_macros.h>

.. code-block:: cpp

#include <pcl/point_cloud.h>
diivm marked this conversation as resolved.
Show resolved Hide resolved

2. Major 3rd-Party components of tests and modules

i. gtest
#. boost
#. Eigen
#. flann
3. Major 3rd-Party components of apps

i. Qt
#. ui-files
#. vtk
4. Minor 3rd-Party components

i. librealsense
#. ros/message_filters
#. opencv/opencv2
#. tide
#. thrust
#. OpenGL, GL & GLUT
5. C++ standard library headers (alphabetical)
6. Others

This style can also be enforced via clang-format. For usage instructions, refer `2.6. Automatic code formatting`_.


3. Structuring
==============

Expand Down