]> git.stg.codes - stg.git/commitdiff
Other comparsion functions for OID added
authorMaxim Mamontov <faust.madf@gmail.com>
Tue, 26 Jul 2011 15:40:01 +0000 (18:40 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Tue, 26 Jul 2011 15:40:01 +0000 (18:40 +0300)
projects/stargazer/plugins/other/smux/types.cpp
projects/stargazer/plugins/other/smux/types.h

index ac1d025320fc4e322049f91a956807dc174aa194..f8eb52094a8cb800c4c28479b0da8b6482afaeee 100644 (file)
@@ -113,9 +113,9 @@ if (rvalue.arcs.size() < arcs.size())
 return true;
 }
 
-std::ostream & OID::operator<<(std::ostream & stream) const
+std::ostream & operator<<(std::ostream & stream, const OID & oid)
 {
-for (size_t i = 0; i < arcs.size(); ++i)
-    stream << "." << arcs[i];
+for (size_t i = 0; i < oid.arcs.size(); ++i)
+    stream << "." << oid.arcs[i];
 return stream;
 }
index 26d6e24fbc6c665ebf194f25b0891105b8f3a508..7d7adac2f6e70e5ebed0be7019b2d13c5244feae 100644 (file)
@@ -23,9 +23,12 @@ class OID {
 
         OID & operator=(const OID & rvalue);
         bool operator==(const OID & rvalue) const;
+        bool operator!=(const OID & rvalue) const { return !operator==(rvalue); }
         bool operator<(const OID & rvalue) const;
+        bool operator>(const OID & rvalue) const
+        { return !operator==(rvalue) && !operator<(rvalue); }
 
-        std::ostream & operator<<(std::ostream & stream) const;
+        friend std::ostream & operator<<(std::ostream & stream, const OID & oid);
 
     private:
         std::vector<unsigned> arcs;