From 0b1708c2411d37765b8ada7546c173096d255af7 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 21 May 2008 00:20:11 +0000 Subject: [PATCH] Added the equality operator for tockList in the C++ support code --- support/tock_support_cppcsp.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/support/tock_support_cppcsp.h b/support/tock_support_cppcsp.h index a5cc48d..b805089 100644 --- a/support/tock_support_cppcsp.h +++ b/support/tock_support_cppcsp.h @@ -372,6 +372,30 @@ public: return derefTockList(this); } + inline bool operator==(const tockList& _l) const + { + if (_l.data.size() != data.size()) + return false; + + iterator it, it2; + for (it = data.begin(), it2 = _l.data.begin(); it != data.end();it++,it2++) + { + if (*it == *it2) + { + //Fine, continue + } + else + { + return false; + } + } + return true; + } + + inline bool operator!=(const tockList& _l) const + { + return !(*this == _l); + } }; // Time addition and subtraction: