DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

doc/tutorials/conventions/dwx_api_naming_structures.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_naming_conventions API Naming Conventions and General Structures
4 @tableofcontents
5 
6 NVIDIA<sup>&reg;</sup> DriveWorks is a collection of modules with C APIs.
7 
8 @section dwx_naming_functions Functions
9 
10 Module functions are defined in camel case, as following:
11 
12 ```{.cpp}
13 DW_API_PUBLIC
14 dwStatus dwModule_functionName(.., dwModuleHandle_t obj)
15 ```
16 
17 @section dwx_naming_handles Handles
18 
19 Each module provides a handle to access module functions.
20 
21 ```{.cpp}
22 typedef struct dwContextObject * dwContextHandle_t // Defines a type-safe handle to the instance of a module.
23 typedef struct dwContextObject const* dwConstContextHandle_t // Defines a type-safe handle to a const instance of a module.
24 ```
25 
26 @section dwx_naming_structures Structures
27 
28 Structures supporting the module are defined with a typedef and prefixed module name in camel case.
29 
30 ```{.cpp}
31 typedef struct dwMyModuleParameterStruct {
32  float32_t parameterOne;
33  int32_t parameterTwo;
34 } dwMyModuleParameterStruct;
35 ```
36 
37 ## Enums
38 
39 Enums are defined with a prefix of the module name, where each element is:
40 - Prefixed with the module name using `_` as a separator and
41 - In capital letters.
42 
43 ```{.cpp}
44 typedef enum dwMyModulParamFlags
45 {
46  DW_MY_MODULE_PARAM_FLAGS_ONE = 0,
47  DW_MY_MODULE_PARAM_FLAGS_TWO = 1,
48 } dwMyModuleParamFlags;
49 ```