diff Framework/Messages/IMessage.h @ 1059:e713f1a99861 broker

replacing MessageBroker by weak_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Oct 2019 17:08:34 +0200
parents f0008c55e5f7
children 17660df24c36
line wrap: on
line diff
--- a/Framework/Messages/IMessage.h	Fri Oct 11 13:38:35 2019 +0200
+++ b/Framework/Messages/IMessage.h	Fri Oct 11 17:08:34 2019 +0200
@@ -33,6 +33,12 @@
     const char*  file_;
     int          line_;
 
+    bool IsEqual(const MessageIdentifier& other) const
+    {
+      return (line_ == other.line_ &&
+              strcmp(file_, other.file_) == 0);
+    }
+
   public:
     MessageIdentifier(const char* file,
                       int line) :
@@ -62,6 +68,16 @@
         return strcmp(file_, other.file_) < 0;
       }
     }
+
+    bool operator== (const MessageIdentifier& other) const
+    {
+      return IsEqual(other);
+    }
+
+    bool operator!= (const MessageIdentifier& other) const
+    {
+      return !IsEqual(other);
+    }
   };