acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_wait.h
1// Created by camilo on 2021-10-04 04:57 BRT <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5//#include "acme/prototype/time/time.h"
6
7
8#ifdef wait
9#undef wait
10#endif // wait
11
12
13struct WAIT
14{
15
16 ::i64 m_iNanosecond;
17
18};
19
20
21class CLASS_DECL_ACME wait :
22 public WAIT
23{
24public:
25
26
27 wait(no_initialize_t) {}
28 constexpr wait() {}
29 constexpr wait(::i64 iNanosecond) { m_iNanosecond = iNanosecond; }
30 constexpr wait(::i64 iSecond, ::i64 iNanosecond): wait(iNanosecond + iSecond * 1'000'000'000) { }
31 wait(::f64 dWait): wait((::i64) (dWait * 1'000'000'000.0)) {}
32 wait(const struct TIME& time) : wait(time.m_iSecond, time.m_iNanosecond) {}
33 wait(const class wait& wait) : wait(wait.m_iNanosecond) {}
34
35 static inline ::wait infinite() { return {infinite_milliseconds().m_i, 0}; }
36
37 static inline integral_millisecond infinite_milliseconds() { return numeric_info<::u32>::maximum(); }
38
39 constexpr WAIT infinite_nanoseconds() { return { numeric_info<::u32>::maximum() * 1'000'000'000 }; }
40
41 constexpr bool is_infinite() { return m_iNanosecond >= infinite_nanoseconds().m_iNanosecond; }
42
43 constexpr bool is_null() const { return m_iNanosecond <= 0; }
44
45
46};
47
48
49
Definition aaa_time.h:13
Definition aaa_wait.h:14
Definition _tags.h:5