Skip to main content

samp_sdk/omp/generated/
timers.rs

1//! `ITimersComponent` — generated by `cargo xtask gen-omp` from `Server/Components/Timers/timers.hpp`.
2//! Implemented by `TimersComponent` in the server's `Timers`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13    UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18impl ComponentInterface for ITimersComponent {
19    const UID: UID = TIMERS_COMPONENT_UID;
20}
21
22slots! {
23    /// `ITimer * ITimersComponent::create(TimerTimeOutHandler *, Milliseconds, Milliseconds, unsigned int)`
24    SLOT_CREATE_COUNTED: usize = 19, 16;
25    /// `const size_t ITimersComponent::count()`
26    SLOT_COUNT: usize = 20, 18;
27}
28
29virtual_fns! {
30    /// `ITimer * ITimersComponent::create(TimerTimeOutHandler *, Milliseconds, Milliseconds, unsigned int)`.
31    ///
32    /// # Safety
33    /// `component` must be a live `ITimersComponent`.
34    #[must_use]
35    pub fn timers_create_counted(
36        component: ITimersComponent,
37        handler: *mut TimerTimeOutHandler,
38        initial: Milliseconds,
39        interval: Milliseconds,
40        count: u32,
41    ) -> *mut ITimer = [0, SLOT_CREATE_COUNTED] or std::ptr::null_mut();
42
43    /// `const size_t ITimersComponent::count()`.
44    ///
45    /// # Safety
46    /// `component` must be a live `ITimersComponent`.
47    #[must_use]
48    pub fn timers_count(component: ITimersComponent) -> usize = [0, SLOT_COUNT] or 0;
49}
50
51// What the generator left out, and why.
52// skipped: `ITimer * ITimersComponent::create(TimerTimeOutHandler *, Milliseconds, bool)` — covered by a hand-written wrapper under another name