DriveWorks SDK Reference
3.5.78 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-2020 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 
48 #ifndef DW_CORE_TIMER_H_
49 #define DW_CORE_TIMER_H_
50 
51 #include <dw/core/Exports.h>
52 #include <dw/core/Types.h>
53 #include <dw/core/Status.h>
54 #include <dw/core/Context.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 typedef struct dwTimerObject* dwTimerHandle_t;
61 typedef struct dwTimerObject const* dwConstTimerHandle_t;
62 typedef void (*dwTimerWork)(void*);
63 
80 dwStatus dwTimer_initialize(dwTimerHandle_t* timer, const char* timerName,
81  dwContextHandle_t context);
82 
92 dwStatus dwTimer_release(dwTimerHandle_t timer);
93 
104 dwStatus dwTimer_cancelSync(dwTimerHandle_t timer);
105 
115 dwStatus dwTimer_cancelAsync(dwTimerHandle_t timer);
116 
129 dwStatus dwTimer_scheduleTaskOneShot(const dwTimerWork task, void* clientData,
130  const dwTime_t startTime, dwTimerHandle_t timer);
131 
145 dwStatus dwTimer_scheduleTaskRecurring(const dwTimerWork task, void* clientData,
146  const dwTime_t startTime, const dwTime_t period, dwTimerHandle_t timer);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
153 #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.
void(* dwTimerWork)(void *)
Definition: Timer.h:62
NVIDIA DriveWorks API: Core Methods
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:178
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
struct dwTimerObject * dwTimerHandle_t
Definition: Timer.h:60
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
struct dwTimerObject const * dwConstTimerHandle_t
Definition: Timer.h:61
NVIDIA DriveWorks API: Core Exports
DW_API_PUBLIC dwStatus dwTimer_release(dwTimerHandle_t timer)
Release the timer instance.
#define DW_API_PUBLIC
Definition: Exports.h:56
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