Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kPeriodic.h
Go to the documentation of this file.
1 
10 #ifndef K_API_PERIODIC_H
11 #define K_API_PERIODIC_H
12 
13 #include <kApi/kApiDef.h>
14 
21 //typedef kObject kPeriodic; --forward-declared in kApiDef.x.h
22 
24 typedef kStatus (kCall *kPeriodicElapsedFx)(kPointer context, kPeriodic timer);
25 
26 #include <kApi/Threads/kPeriodic.x.h>
27 
40 #if defined(K_CPP)
41 kInlineFx(kStatus) kPeriodic_Construct(kPeriodic* timer, const kChar* name, kAlloc allocator)
42 {
43  return xkPeriodic_Construct(timer, name, kTHREAD_PRIORITY_CLASS_NORMAL, 0, allocator);
44 }
45 #endif
46 
64 #if defined(K_CPP)
65 kInlineFx(kStatus) kPeriodic_Construct(kPeriodic* timer, const kChar* name, kThreadPriorityClass priorityClass, k32s priorityOffset, kAlloc allocator)
66 {
67  return xkPeriodic_Construct(timer, name, priorityClass, priorityOffset, allocator);
68 }
69 #endif
70 
85 kFx(kStatus) kPeriodic_SetPriority(kPeriodic timer, kThreadPriorityClass priorityClass, k32s priorityOffset);
86 
103 kFx(kStatus) kPeriodic_SetAffinity(kPeriodic timer, kBitArray affinity);
104 
121 kFx(kStatus) kPeriodic_Start(kPeriodic timer, k64u period, kPeriodicElapsedFx onElapsed, kPointer context);
122 
134 kFx(kStatus) kPeriodic_Stop(kPeriodic timer);
135 
146 kFx(kBool) kPeriodic_Enabled(kPeriodic timer);
147 
160 kFx(k64u) kPeriodic_Period(kPeriodic timer);
161 
162 #endif
kStatus(kCall * kPeriodicElapsedFx)(kPointer context, kPeriodic timer)
Defines the signature of a callback function to receive timer notifications.
Definition: kPeriodic.h:24
kStatus kPeriodic_SetPriority(kPeriodic timer, kThreadPriorityClass priorityClass, k32s priorityOffset)
Sets the priority associated with the periodic callback thread.
Represents a 64-bit unsigned integer.
Represents a void pointer.
kStatus kPeriodic_Construct(kPeriodic *timer, const kChar *name, kAlloc allocator)
Constructs a kPeriodic object.
Definition: kPeriodic.h:41
Abstract base class for memory allocator types.
k64u kPeriodic_Period(kPeriodic timer)
Reports the timer callback period.
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
Represents a single unit (byte) in a UTF-8 character.
typedef kStatus(kCall *kMsgQueueDropFx)(kPointer receiver
Defines the signature of a callback function to handle dropped items.
Represents a 1D array of bits.
kBool kPeriodic_Enabled(kPeriodic timer)
Reports whether periodic timer callbacks are currently enabled.
kStatus kPeriodic_SetAffinity(kPeriodic timer, kBitArray affinity)
Sets the CPUs with which the periodic callback thread should have affinity.
kStatus kPeriodic_Stop(kPeriodic timer)
Stops timer callbacks.
Core Zen type declarations.
Represents a 32-bit signed integer.
#define kTHREAD_PRIORITY_CLASS_NORMAL
Normal priority thread class.
Definition: kApiDef.h:2371
Represents an error code.
Represents a thread priority class.
kStatus kPeriodic_Start(kPeriodic timer, k64u period, kPeriodicElapsedFx onElapsed, kPointer context)
Starts callbacks at the specified period.
#define kCall
kApi standard function calling convention.
Definition: kApiDef.h:15
Represents a boolean value.
Provides a periodic function call.