Commit 2b7a0e04 authored by Robert Maynard's avatar Robert Maynard

revise the header guard naming convention to not conflict with macro names.

parent c80fb925
......@@ -31,17 +31,20 @@ The statement should have the following form:
+ The CopyrightStatement checks all files for a similar statement. The test will print out a suggested text that can be copied and pasted to any file that has a missing copyright statement (with appropriate replacement of comment prefix). Exceptions to this copyright statement (for example, third-party files with different but compatible statements) can be added to LICENSE.txt.
+ All include files should use include guards. starting right after the copyright statement. The naming convention of the include guard macro is that it should be all in lower case and start with the path name, starting from the top-level source code directory, with non alphanumeric characters, such as / and . replaced with underscores. The #endif part of the guard at the bottom of the file should include the guard name in a comment. For example, the vtkm/cont/ArrayHandle.h header contains the guard
+ All include files should use include guards. starting right after the copyright statement. The naming convention of the include guard macro is that it should be all in lower case and start with vtk_m and than continue the path name, starting from the inside the vtkm source code directory, with non alphanumeric characters, such as / and . replaced with underscores. The #endif part of the guard at the bottom of the file should include the guard name in a comment.
For example, the vtkm/cont/ArrayHandle.h header contains the guard
```cpp
#ifndef vtkm_cont_ArrayHandle_h
#define vtkm_cont_ArrayHandle_h
#ifndef vtk_m_cont_ArrayHandle_h
#define vtk_m_cont_ArrayHandle_h
```
at the top and
```cpp
#endif //vtkm_cont_ArrayHandle_h
#endif //vtk_m_cont_ArrayHandle_h
```
at the bottom.
The unique use of vtk_m over vtkm is to allow auto-complete engines the ability to differentiate between the header guards and VTKM_ macros that are used within the code base.
+ The VTK-M toolkit has several nested namespaces. The declaration of each namespace should be on its own line, and the code inside the namespace bracket should not be indented. The closing brace at the bottom of the namespace should be documented with a comment identifying the namespace. Namespaces can be grouped as desired. The following is a valid use of namespaces.
```cpp
namespace vtkm {
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_TypeTraits_h
#define vtkm_TypeTraits_h
#ifndef vtk_m_TypeTraits_h
#define vtk_m_TypeTraits_h
#include <vtkm/Types.h>
......
......@@ -17,8 +17,9 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_Types_h
#define vtkm_Types_h
#ifndef vtk_m_Types_h
#define vtk_m_Types_h
#include <vtkm/internal/Configure.h>
#include <vtkm/internal/ExportMacros.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_VectorTraits_h
#define vtkm_VectorTraits_h
#ifndef vtk_m_VectorTraits_h
#define vtk_m_VectorTraits_h
#include <vtkm/Types.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont__ArrayContainerControl_h
#define vtkm_cont__ArrayContainerControl_h
#ifndef vtk_m_cont__ArrayContainerControl_h
#define vtk_m_cont__ArrayContainerControl_h
#define VTKM_ARRAY_CONTAINER_CONTROL_ERROR -1
#define VTKM_ARRAY_CONTAINER_CONTROL_UNDEFINED 0
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont__ArrayContainerControlBasic_h
#define vtkm_cont__ArrayContainerControlBasic_h
#ifndef vtk_m_cont__ArrayContainerControlBasic_h
#define vtk_m_cont__ArrayContainerControlBasic_h
#include <vtkm/Types.h>
#include <vtkm/cont/ArrayContainerControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ArrayContainerControlImplicit
#define vtkm_cont_ArrayContainerControlImplicit
#ifndef vtk_m_cont_ArrayContainerControlImplicit
#define vtk_m_cont_ArrayContainerControlImplicit
#include <vtkm/Types.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ArrayHandle_h
#define vtkm_cont_ArrayHandle_h
#ifndef vtk_m_cont_ArrayHandle_h
#define vtk_m_cont_ArrayHandle_h
#include <vtkm/Types.h>
......@@ -61,6 +61,7 @@ namespace internal { class ArrayHandleAccess; }
/// counted so that when all copies of the \c ArrayHandle are destroyed, any
/// allocated memory is released.
///
///
template<
typename T,
typename ArrayContainerControlTag_ = VTKM_DEFAULT_ARRAY_CONTAINER_CONTROL_TAG>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ArrayPortal_h
#define vtkm_cont_ArrayPortal_h
#ifndef vtk_m_cont_ArrayPortal_h
#define vtk_m_cont_ArrayPortal_h
#include <vtkm/Types.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_Assert_h
#define vtkm_cont_Assert_h
#ifndef vtk_m_cont_Assert_h
#define vtk_m_cont_Assert_h
#include <vtkm/cont/ErrorControlAssert.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_DeviceAdapter_h
#define vtkm_cont_DeviceAdapter_h
#ifndef vtk_m_cont_DeviceAdapter_h
#define vtk_m_cont_DeviceAdapter_h
// These are listed in non-alphabetical order because this is the conceptual
// order in which the sub-files are loaded. (But the compile should still
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_DeviceAdapterSerial_h
#define vtkm_cont_DeviceAdapterSerial_h
#ifndef vtk_m_cont_DeviceAdapterSerial_h
#define vtk_m_cont_DeviceAdapterSerial_h
#include <vtkm/cont/internal/DeviceAdapterTagSerial.h>
#include <vtkm/cont/internal/ArrayManagerExecutionSerial.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_Error_h
#define vtkm_cont_Error_h
#ifndef vtk_m_cont_Error_h
#define vtk_m_cont_Error_h
// Note that this class and (most likely) all of its subclasses are not
// templated. If there is any reason to create a VTKm control library,
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorControl_h
#define vtkm_cont_ErrorControl_h
#ifndef vtk_m_cont_ErrorControl_h
#define vtk_m_cont_ErrorControl_h
#include <vtkm/cont/Error.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorControlAssert_h
#define vtkm_cont_ErrorControlAssert_h
#ifndef vtk_m_cont_ErrorControlAssert_h
#define vtk_m_cont_ErrorControlAssert_h
#include <vtkm/Types.h>
#include <vtkm/cont/ErrorControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorControlBadValue_h
#define vtkm_cont_ErrorControlBadValue_h
#ifndef vtk_m_cont_ErrorControlBadValue_h
#define vtk_m_cont_ErrorControlBadValue_h
#include <vtkm/cont/ErrorControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorControlInternal_h
#define vtkm_cont_ErrorControlInternal_h
#ifndef vtk_m_cont_ErrorControlInternal_h
#define vtk_m_cont_ErrorControlInternal_h
#include <vtkm/cont/ErrorControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorControlOutOfMemory_h
#define vtkm_cont_ErrorControlOutOfMemory_h
#ifndef vtk_m_cont_ErrorControlOutOfMemory_h
#define vtk_m_cont_ErrorControlOutOfMemory_h
#include <vtkm/cont/ErrorControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_ErrorExecution_h
#define vtkm_cont_ErrorExecution_h
#ifndef vtk_m_cont_ErrorExecution_h
#define vtk_m_cont_ErrorExecution_h
#include <vtkm/cont/Error.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_exec_ArrayHandleExecutionManager_h
#define vtkm_cont_exec_ArrayHandleExecutionManager_h
#ifndef vtk_m_cont_exec_ArrayHandleExecutionManager_h
#define vtk_m_cont_exec_ArrayHandleExecutionManager_h
#include <vtkm/cont/ArrayContainerControl.h>
#include <vtkm/cont/ErrorControlInternal.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayManagerExecution_h
#define vtkm_cont_internal_ArrayManagerExecution_h
#ifndef vtk_m_cont_internal_ArrayManagerExecution_h
#define vtk_m_cont_internal_ArrayManagerExecution_h
#include <vtkm/cont/internal/DeviceAdapterTag.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayManagerExecutionSerial_h
#define vtkm_cont_internal_ArrayManagerExecutionSerial_h
#ifndef vtk_m_cont_internal_ArrayManagerExecutionSerial_h
#define vtk_m_cont_internal_ArrayManagerExecutionSerial_h
#include <vtkm/cont/internal/ArrayManagerExecution.h>
#include <vtkm/cont/internal/ArrayManagerExecutionShareWithControl.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayManagerExecutionShareWithControl_h
#define vtkm_cont_internal_ArrayManagerExecutionShareWithControl_h
#ifndef vtk_m_cont_internal_ArrayManagerExecutionShareWithControl_h
#define vtk_m_cont_internal_ArrayManagerExecutionShareWithControl_h
#include <vtkm/Types.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayPortalFromIterators_h
#define vtkm_cont_internal_ArrayPortalFromIterators_h
#ifndef vtk_m_cont_internal_ArrayPortalFromIterators_h
#define vtk_m_cont_internal_ArrayPortalFromIterators_h
#include <vtkm/Types.h>
#include <vtkm/cont/ArrayPortal.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayPortalShrink_h
#define vtkm_cont_internal_ArrayPortalShrink_h
#ifndef vtk_m_cont_internal_ArrayPortalShrink_h
#define vtk_m_cont_internal_ArrayPortalShrink_h
#include <vtkm/Types.h>
#include <vtkm/cont/ArrayPortal.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_ArrayTransfer_h
#define vtkm_cont_internal_ArrayTransfer_h
#ifndef vtk_m_cont_internal_ArrayTransfer_h
#define vtk_m_cont_internal_ArrayTransfer_h
#include <vtkm/cont/ArrayContainerControl.h>
#include <vtkm/cont/internal/ArrayManagerExecution.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterAlgorithm_h
#define vtkm_cont_internal_DeviceAdapterAlgorithm_h
#ifndef vtk_m_cont_internal_DeviceAdapterAlgorithm_h
#define vtk_m_cont_internal_DeviceAdapterAlgorithm_h
#include <vtkm/Types.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterAlgorithmGeneral_h
#define vtkm_cont_internal_DeviceAdapterAlgorithmGeneral_h
#ifndef vtk_m_cont_internal_DeviceAdapterAlgorithmGeneral_h
#define vtk_m_cont_internal_DeviceAdapterAlgorithmGeneral_h
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleCounting.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterAlgorithmSerial_h
#define vtkm_cont_internal_DeviceAdapterAlgorithmSerial_h
#ifndef vtk_m_cont_internal_DeviceAdapterAlgorithmSerial_h
#define vtk_m_cont_internal_DeviceAdapterAlgorithmSerial_h
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ErrorExecution.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterError_h
#define vtkm_cont_internal_DeviceAdapterError_h
#ifndef vtk_m_cont_internal_DeviceAdapterError_h
#define vtk_m_cont_internal_DeviceAdapterError_h
#include <vtkm/cont/internal/DeviceAdapterTag.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterTag_h
#define vtkm_cont_internal_DeviceAdapterTag_h
#ifndef vtk_m_cont_internal_DeviceAdapterTag_h
#define vtk_m_cont_internal_DeviceAdapterTag_h
#include <vtkm/internal/Configure.h>
#include <vtkm/internal/ExportMacros.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_DeviceAdapterTagSerial_h
#define vtkm_cont_internal_DeviceAdapterTagSerial_h
#ifndef vtk_m_cont_internal_DeviceAdapterTagSerial_h
#define vtk_m_cont_internal_DeviceAdapterTagSerial_h
#include <vtkm/cont/internal/DeviceAdapterTag.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_internal_IteratorFromArrayPortal_h
#define vtkm_cont_internal_IteratorFromArrayPortal_h
#ifndef vtk_m_cont_internal_IteratorFromArrayPortal_h
#define vtk_m_cont_internal_IteratorFromArrayPortal_h
#include <vtkm/cont/ArrayPortal.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_testing_Testing_h
#define vtkm_cont_testing_Testing_h
#ifndef vtk_m_cont_testing_Testing_h
#define vtk_m_cont_testing_Testing_h
#include <vtkm/cont/Error.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_cont_testing_TestingDeviceAdapter_h
#define vtkm_cont_testing_TestingDeviceAdapter_h
#ifndef vtk_m_cont_testing_TestingDeviceAdapter_h
#define vtk_m_cont_testing_TestingDeviceAdapter_h
#include <vtkm/cont/ArrayContainerControlBasic.h>
#include <vtkm/cont/ArrayHandle.h>
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_internal_Configure_h
#define vtkm_internal_Configure_h
#ifndef vtk_m_internal_Configure_h
#define vtk_m_internal_Configure_h
#if !defined(VTKM_USE_DOUBLE_PRECISION) && !defined(VTKM_NO_DOUBLE_PRECISION)
......
......@@ -26,8 +26,8 @@
# error Incorrect header order. Include this header before any other VTKm headers.
#endif
#ifndef vtkm_internal_Configure32_h
#define vtkm_internal_Configure32_h
#ifndef vtk_m_internal_Configure32_h
#define vtk_m_internal_Configure32_h
#define VTKM_NO_DOUBLE_PRECISION
#define VTKM_NO_64BIT_IDS
......
......@@ -26,8 +26,8 @@
# error Incorrect header order. Include this header before any other VTKm headers.
#endif
#ifndef vtkm_internal_Configure32_h
#define vtkm_internal_Configure32_h
#ifndef vtk_m_internal_Configure32_h
#define vtk_m_internal_Configure32_h
#define VTKM_USE_DOUBLE_PRECISION
#define VTKM_USE_64BIT_IDS
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_internal__ExportMacros_h
#define vtkm_internal__ExportMacros_h
#ifndef vtk_m_internal__ExportMacros_h
#define vtk_m_internal__ExportMacros_h
/*!
* Export macros for various parts of the VTKm library.
......
......@@ -17,8 +17,8 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtkm_testing_Testing_h
#define vtkm_testing_Testing_h
#ifndef vtk_m_testing_Testing_h
#define vtk_m_testing_Testing_h
#include <vtkm/Types.h>
#include <vtkm/TypeTraits.h>
......@@ -34,7 +34,7 @@
// control environment have more possible exceptions.) This is not guaranteed
// to work. To make it more likely, place the Testing.h include last.
#ifdef vtkm_cont_Error_h
#ifndef vtkm_cont_testing_Testing_h
#ifndef vtk_m_cont_testing_Testing_h
#error Use vtkm::cont::testing::Testing instead of vtkm::testing::Testing.
#else
#define VTKM_TESTING_IN_CONT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment