From d7f8efa5f4949da128ff32443bcb25d4e4571623 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Mon, 2 Nov 2020 20:59:11 +0100 Subject: [PATCH] Add operators --- openVulkanoCpp/Math/Pose.hpp | 8 ++++++++ openVulkanoCpp/Math/Timestamp.hpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 openVulkanoCpp/Math/Pose.hpp diff --git a/openVulkanoCpp/Math/Pose.hpp b/openVulkanoCpp/Math/Pose.hpp new file mode 100644 index 0000000..db2b3ba --- /dev/null +++ b/openVulkanoCpp/Math/Pose.hpp @@ -0,0 +1,8 @@ +// +// Created by georg on 6/8/23. +// + +#ifndef OPENVULKANOCPP_POSE_HPP +#define OPENVULKANOCPP_POSE_HPP + +#endif //OPENVULKANOCPP_POSE_HPP diff --git a/openVulkanoCpp/Math/Timestamp.hpp b/openVulkanoCpp/Math/Timestamp.hpp index 4eb6957..21f95c2 100644 --- a/openVulkanoCpp/Math/Timestamp.hpp +++ b/openVulkanoCpp/Math/Timestamp.hpp @@ -24,4 +24,34 @@ namespace openVulkanoCpp::Math [[nodiscard]] uint64_t GetNanos() const { return timestamp; } [[nodiscard]] double GetSeconds() const { return timestamp * NANOS_TO_SECONDS; } }; + + inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) + { + return lhs.GetNanos() == rhs.GetNanos(); + } + + inline bool operator!=(const Timestamp& lhs, const Timestamp& rhs) + { + return !(lhs == rhs); + } + + inline bool operator<(const Timestamp& lhs, const Timestamp& rhs) + { + return lhs.GetNanos() < rhs.GetNanos(); + } + + inline bool operator>(const Timestamp& lhs, const Timestamp& rhs) + { + return rhs < lhs; + } + + inline bool operator>=(const Timestamp& lhs, const Timestamp& rhs) + { + return !(lhs < rhs); + } + + inline bool operator<=(const Timestamp& lhs, const Timestamp& rhs) + { + return !(rhs < lhs); + } } \ No newline at end of file