mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Fix formatting of CodingConventions.md.
The current page has some issue: https://gitlab.kitware.com/vtk/vtk-m/blob/master/docs/CodingConventions.md
This commit is contained in:
parent
48c31b57a2
commit
024b8a3067
@ -15,7 +15,7 @@ coding and because we expect vtkm to have continual interaction with VTK.
|
|||||||
form. Various copyright specific details are referenced in the LICENSE.txt
|
form. Various copyright specific details are referenced in the LICENSE.txt
|
||||||
file.
|
file.
|
||||||
|
|
||||||
```
|
```
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
// Copyright (c) Kitware, Inc.
|
// Copyright (c) Kitware, Inc.
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
@ -25,7 +25,7 @@ coding and because we expect vtkm to have continual interaction with VTK.
|
|||||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
// PURPOSE. See the above copyright notice for more information.
|
// PURPOSE. See the above copyright notice for more information.
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
+ The CopyrightStatement test checks all files for a similar statement.
|
+ The CopyrightStatement test checks all files for a similar statement.
|
||||||
The test will print out a suggested text that can be copied and pasted
|
The test will print out a suggested text that can be copied and pasted
|
||||||
@ -41,22 +41,21 @@ coding and because we expect vtkm to have continual interaction with VTK.
|
|||||||
directory, with non alphanumeric characters, such as / and . replaced
|
directory, with non alphanumeric characters, such as / and . replaced
|
||||||
with underscores. The `#endif` part of the guard at the bottom of the
|
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
|
file should include the guard name in a comment. For example, the
|
||||||
vtkm/cont/ArrayHandle.h header contains the guard
|
vtkm/cont/ArrayHandle.h header contains the guard demostrated below.
|
||||||
|
|
||||||
```cpp
|
|
||||||
#ifndef vtk_m_cont_ArrayHandle_h
|
|
||||||
#define vtk_m_cont_ArrayHandle_h
|
|
||||||
```
|
|
||||||
at the top and
|
|
||||||
```cpp
|
|
||||||
#endif //vtk_m_cont_ArrayHandle_h
|
|
||||||
```
|
|
||||||
at the bottom.
|
|
||||||
|
|
||||||
The unique use of vtk_m over vtkm is to allow auto-complete engines the
|
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
|
ability to differentiate between the header guards and VTKM_ macros
|
||||||
that are used within the code base.
|
that are used within the code base.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#ifndef vtk_m_cont_ArrayHandle_h
|
||||||
|
#define vtk_m_cont_ArrayHandle_h
|
||||||
|
|
||||||
|
// All ArrayHandle code here
|
||||||
|
|
||||||
|
#endif //vtk_m_cont_ArrayHandle_h
|
||||||
|
```
|
||||||
|
|
||||||
+ The VTK-m toolkit has several nested namespaces. The declaration of
|
+ The VTK-m toolkit has several nested namespaces. The declaration of
|
||||||
each namespace should be on its own line, and the code inside the
|
each namespace should be on its own line, and the code inside the
|
||||||
namespace bracket should not be indented. The closing brace at the
|
namespace bracket should not be indented. The closing brace at the
|
||||||
@ -64,7 +63,7 @@ coding and because we expect vtkm to have continual interaction with VTK.
|
|||||||
the namespace. Namespaces can be grouped as desired. The following is a
|
the namespace. Namespaces can be grouped as desired. The following is a
|
||||||
valid use of namespaces.
|
valid use of namespaces.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
namespace vtkm {
|
namespace vtkm {
|
||||||
namespace cont {
|
namespace cont {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
@ -73,7 +72,7 @@ class InternalClass;
|
|||||||
class ExposedClass;
|
class ExposedClass;
|
||||||
}
|
}
|
||||||
} // namespace vtkm::cont
|
} // namespace vtkm::cont
|
||||||
```
|
```
|
||||||
|
|
||||||
+ Multiple inheritance is not allowed in VTK-m classes.
|
+ Multiple inheritance is not allowed in VTK-m classes.
|
||||||
|
|
||||||
@ -170,7 +169,7 @@ for (auto v : vector)
|
|||||||
or detail class clearly associated with it, the reference can be
|
or detail class clearly associated with it, the reference can be
|
||||||
shortened to `internal::` or `detail::`.
|
shortened to `internal::` or `detail::`.
|
||||||
|
|
||||||
+ use `this->` inside of methods when accessing class methods and
|
+ Use `this->` inside of methods when accessing class methods and
|
||||||
instance variables to distinguish between local variables and instance
|
instance variables to distinguish between local variables and instance
|
||||||
variables.
|
variables.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user