acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_structures.h
1// Created by CSTBS on 2021-10-06 19:38 BRT <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5//#include "acme/prototype/comparison/compare.h"
6
7
8//struct TIME { posix_time m_posixtime; nanosecond m_nanosecond; };
9
10struct FREQUENCY { ::f64 m_dHertz; };
11
12constexpr FREQUENCY operator""_Hz(::f128 d) { return { (::f64) d }; }
13
14
15class time;
16
17
18#define DECLARE_COMPARISON_WITH_TIME(EXPORT_CLAUSE_DECL) \
19EXPORT_CLAUSE_DECL bool operator == (const class ::time & time) const; \
20EXPORT_CLAUSE_DECL ::std::strong_ordering operator <=> (const class ::time & time) const;
21//\
22//EXPORT_CLAUSE_DECL bool operator <= (const class ::time & time) const; \
23//EXPORT_CLAUSE_DECL bool operator > (const class ::time & time) const; \
24//EXPORT_CLAUSE_DECL bool operator >= (const class ::time & time) const; \
25//EXPORT_CLAUSE_DECL bool operator != (const class ::time & time) const;
26
27
28#define DEFINE_COMPARISON_WITH_TIME(EXPORT_CLAUSE_DECL, TYPE) \
29EXPORT_CLAUSE_DECL bool TYPE::operator == (const class ::time & time) const { return ((class ::time)*this) == time; } \
30EXPORT_CLAUSE_DECL ::std::strong_ordering TYPE::operator <=> (const class ::time & time) const { return ((class ::time)*this) <=> time; }
31//\
32//EXPORT_CLAUSE_DECL bool TYPE::operator <= (const class ::time & time) const { return ((class ::time)*this) <= time; } \
33//EXPORT_CLAUSE_DECL bool TYPE::operator > (const class ::time & time) const { return ((class ::time)*this) > time; } \
34//EXPORT_CLAUSE_DECL bool TYPE::operator >= (const class ::time & time) const { return ((class ::time)*this) >= time; } \
35//EXPORT_CLAUSE_DECL bool TYPE::operator != (const class ::time & time) const { return ((class ::time)*this) != time; }
36
37
38#define NON_INLINE
39
40
41//#define DECLARE_COMPARISON_WITH_TIME \
42//inline bool operator == (const class time & time); \
43//inline bool operator < (const class time & time); \
44//inline bool operator <= (const class time & time); \
45//inline bool operator > (const class time & time); \
46//inline bool operator >= (const class time & time); \
47//inline bool operator != (const class time & time);
48
49
50//#define INLINE_COMPARISON_WITH_DURATION \
51//inline bool operator == (const class time & time) const { return class ::time(*this) == time; } \
52//inline bool operator < (const class time & time) const { return class ::time(*this) < time; } \
53//inline bool operator <= (const class time & time) const { return class ::time(*this) <= time; } \
54//inline bool operator > (const class time & time) const { return class ::time(*this) > time; } \
55//inline bool operator >= (const class time & time) const { return class ::time(*this) >= time; } \
56//inline bool operator != (const class time & time) const { return class ::time(*this) != time; }
57
58
Definition aaa_time.h:13
Definition _structures.h:10