DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/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 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 
8 NVIDIA<sup>&reg;</sup> DriveWorks is a collection of modules with C APIs.
9 
10 @section dwx_naming_functions Functions
11 
12 Module functions are defined in camel case, as following:
13 
14 ```{.cpp}
15 DW_API_PUBLIC
16 dwStatus dwModule_functionName(.., dwModuleHandle_t obj)
17 ```
18 
19 @section dwx_naming_handles Handles
20 
21 Each module provides a handle to access module functions.
22 
23 ```{.cpp}
24 typedef struct dwContextObject * dwContextHandle_t // Defines a type-safe handle to the instance of a module.
25 typedef struct dwContextObject const* dwConstContextHandle_t // Defines a type-safe handle to a const instance of a module.
26 ```
27 
28 @section dwx_naming_structures Structures
29 
30 Structures supporting the module are defined with a typedef and prefixed module name in camel case.
31 
32 ```{.cpp}
33 typedef struct dwMyModuleParameterStruct {
34  float32_t parameterOne;
35  int32_t parameterTwo;
36 } dwMyModuleParameterStruct;
37 ```
38 
39 ## Enums
40 
41 Enums are defined with a prefix of the module name, where each element is:
42 - Prefixed with the module name using `_` as a separator and
43 - In capital letters.
44 
45 ```{.cpp}
46 typedef enum dwMyModulParamFlags
47 {
48  DW_MY_MODULE_PARAM_FLAGS_ONE = 0,
49  DW_MY_MODULE_PARAM_FLAGS_TWO = 1,
50 } dwMyModuleParamFlags;
51 ```