From e4e6eb1ab0cb7528d07c310c4ca8efaa5cf556df Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 15 Jan 2009 20:54:11 +0100 Subject: [PATCH] add new comparison operators. --- src/simulator/scheduler.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/simulator/scheduler.h b/src/simulator/scheduler.h index 72331baba..394987f7c 100644 --- a/src/simulator/scheduler.h +++ b/src/simulator/scheduler.h @@ -115,6 +115,28 @@ inline bool operator < (const Scheduler::EventKey &a, const Scheduler::EventKey return false; } } +inline bool operator != (const Scheduler::EventKey &a, const Scheduler::EventKey &b) +{ + return a.m_uid != b.m_uid; +} +inline bool operator > (const Scheduler::EventKey &a, const Scheduler::EventKey &b) +{ + if (a.m_ts > b.m_ts) + { + return true; + } + else if (a.m_ts == b.m_ts && + a.m_uid > b.m_uid) + { + return true; + } + else + { + return false; + } +} + + inline bool operator < (const Scheduler::Event &a, const Scheduler::Event &b) {