added greater-than operator to Kumu::Identifier 13/head
authorMatthew Sheby <matthew.sheby@eikongroup.co.uk>
Tue, 20 Aug 2019 06:15:42 +0000 (23:15 -0700)
committerMatthew Sheby <matthew.sheby@eikongroup.co.uk>
Tue, 20 Aug 2019 06:15:42 +0000 (23:15 -0700)
src/KM_util.h

index e8004c151ac91f9080ebcda1f5109050a2b823ac..f3f60f187b3715b9a1d50e7af4412a3254047d8f 100755 (executable)
@@ -303,6 +303,18 @@ namespace Kumu
        return false;
       }
 
+      inline bool operator>(const Identifier& rhs) const {
+       ui32_t test_size = xmin(rhs.Size(), SIZE);
+
+       for ( ui32_t i = 0; i < test_size; i++ )
+         {
+           if ( m_Value[i] != rhs.m_Value[i] )
+             return m_Value[i] > rhs.m_Value[i];
+         }
+       
+       return false;
+      }
+
       inline bool operator==(const Identifier& rhs) const {
        if ( rhs.Size() != SIZE ) return false;
        return ( memcmp(m_Value, rhs.m_Value, SIZE) == 0 );