DriveWorks SDK Reference
5.4.5418 Release
For Test and Development only

Timer.h
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2017-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is strictly prohibited.
28 //
30 
46 #ifndef DW_CORE_TIMER_H_
47 #define DW_CORE_TIMER_H_
48 
49 #include <dw/core/base/Exports.h>
50 #include <dw/core/base/Types.h>
51 #include <dw/core/base/Status.h>
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 typedef struct dwTimerObject* dwTimerHandle_t;
59 typedef struct dwTimerObject const* dwConstTimerHandle_t;
60 typedef void (*dwTimerWork)(void* ptr);
61 
78 dwStatus dwTimer_initialize(dwTimerHandle_t* const timer, char8_t const* const timerName,
79  dwContextHandle_t const context);
80 
91 dwStatus dwTimer_release(dwTimerHandle_t const timer);
92 
104 dwStatus dwTimer_cancelSync(dwTimerHandle_t const timer);
105 
116 dwStatus dwTimer_cancelAsync(dwTimerHandle_t const timer);
117 
133 dwStatus dwTimer_scheduleTaskOneShot(dwTimerWork const task, void* const clientData,
134  dwTime_t const startTime, dwTimerHandle_t const timer);
135 
152 dwStatus dwTimer_scheduleTaskRecurring(dwTimerWork const task, void* const clientData,
153  dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer);
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
160 #endif // DW_CORE_TIMER_H_
NVIDIA DriveWorks API: Core Types
DW_API_PUBLIC dwStatus dwTimer_initialize(dwTimerHandle_t *const timer, char8_t const *const timerName, dwContextHandle_t const context)
Creates and initializes a DW Timer.
dwStatus
Status definition.
Definition: Status.h:180
DW_API_PUBLIC dwStatus dwTimer_release(dwTimerHandle_t const timer)
Release the timer instance.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
DW_API_PUBLIC dwStatus dwTimer_cancelAsync(dwTimerHandle_t const timer)
Asynchronously cancels all scheduled work associated with this timer.
DW_API_PUBLIC dwStatus dwTimer_scheduleTaskRecurring(dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer)
Scheduled a task to be run at a future time (recurring)
struct dwTimerObject * dwTimerHandle_t
Definition: Timer.h:58
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:79
NVIDIA DriveWorks API: Core Methods
char char8_t
Definition: Types.h:72
struct dwTimerObject const * dwConstTimerHandle_t
Definition: Timer.h:59
DW_API_PUBLIC dwStatus dwTimer_scheduleTaskOneShot(dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTimerHandle_t const timer)
Scheduled a task to be run at a future time (non-recurring)
void(* dwTimerWork)(void *ptr)
Definition: Timer.h:60
DW_API_PUBLIC dwStatus dwTimer_cancelSync(dwTimerHandle_t const timer)
Synchronously cancels all scheduled work associated with this timer.
#define DW_API_PUBLIC
Definition: Exports.h:54
NVIDIA DriveWorks API: Core Status Methods
NVIDIA DriveWorks API: Core Exports