From 174eaf3228599dc9c2fb5b7de3842ab1820a3f4c Mon Sep 17 00:00:00 2001 From: Lucio Trincheri Date: Fri, 13 Dec 2024 12:32:42 -0300 Subject: [PATCH] Re-add isEmpty method for future MultiDimInter implementation --- sbg/dto/interval_dto.cpp | 3 +++ sbg/dto/interval_dto.hpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/sbg/dto/interval_dto.cpp b/sbg/dto/interval_dto.cpp index 4532553..84baf31 100644 --- a/sbg/dto/interval_dto.cpp +++ b/sbg/dto/interval_dto.cpp @@ -30,6 +30,9 @@ IntervalDTO::IntervalDTO(const NAT &begin, const NAT &step, const NAT &end) { } +// Set functions --------------------------------------------------------------- +bool IntervalDTO::isEmpty() const { return end_ < begin_; } + // Operators ------------------------------------------------------------------- std::ostream &operator<<(std::ostream &out, const IntervalDTO &i) { diff --git a/sbg/dto/interval_dto.hpp b/sbg/dto/interval_dto.hpp index aebbb94..0d70ada 100644 --- a/sbg/dto/interval_dto.hpp +++ b/sbg/dto/interval_dto.hpp @@ -44,6 +44,11 @@ struct IntervalDTO { IntervalDTO(const NAT &x); IntervalDTO(const NAT &begin, const NAT &step, const NAT &end); + /** + * @brief Traditional set operations. + */ + bool isEmpty() const; + private: NAT begin_; NAT step_;