DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Timer.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2017-2021 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // 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* timer, const char* timerName,
79  dwContextHandle_t context);
80 
91 dwStatus dwTimer_release(dwTimerHandle_t timer);
92 
104 dwStatus dwTimer_cancelSync(dwTimerHandle_t timer);
105 
116 dwStatus dwTimer_cancelAsync(dwTimerHandle_t timer);
117 
133 dwStatus dwTimer_scheduleTaskOneShot(const dwTimerWork task, void* clientData,
134  const dwTime_t startTime, dwTimerHandle_t timer);
135 
152 dwStatus dwTimer_scheduleTaskRecurring(const dwTimerWork task, void* clientData,
153  const dwTime_t startTime, const dwTime_t period, dwTimerHandle_t 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_scheduleTaskOneShot(const dwTimerWork task, void *clientData, const dwTime_t startTime, dwTimerHandle_t timer)
Scheduled a task to be run at a future time (non-recurring)
DW_API_PUBLIC dwStatus dwTimer_cancelAsync(dwTimerHandle_t timer)
Asynchronously cancels all scheduled work associated with this timer.
DW_API_PUBLIC dwStatus dwTimer_cancelSync(dwTimerHandle_t timer)
Synchronously cancels all scheduled work associated with this timer.
DW_API_PUBLIC dwStatus dwTimer_scheduleTaskRecurring(const dwTimerWork task, void *clientData, const dwTime_t startTime, const dwTime_t period, dwTimerHandle_t timer)
Scheduled a task to be run at a future time (recurring)
dwStatus
Status definition.
Definition: Status.h:180
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
struct dwTimerObject * dwTimerHandle_t
Definition: Timer.h:58
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:79
NVIDIA DriveWorks API: Core Methods
struct dwTimerObject const * dwConstTimerHandle_t
Definition: Timer.h:59
void(* dwTimerWork)(void *ptr)
Definition: Timer.h:60
DW_API_PUBLIC dwStatus dwTimer_release(dwTimerHandle_t timer)
Release the timer instance.
#define DW_API_PUBLIC
Definition: Exports.h:54
DW_API_PUBLIC dwStatus dwTimer_initialize(dwTimerHandle_t *timer, const char *timerName, dwContextHandle_t context)
Creates and initializes a DW Timer.
NVIDIA DriveWorks API: Core Status Methods
NVIDIA DriveWorks API: Core Exports