From 87550f881db0f6583709f7797becb3eef7d5f254 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Tue, 26 Jul 2011 18:40:01 +0300 Subject: [PATCH] Other comparsion functions for OID added --- projects/stargazer/plugins/other/smux/types.cpp | 6 +++--- projects/stargazer/plugins/other/smux/types.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/stargazer/plugins/other/smux/types.cpp b/projects/stargazer/plugins/other/smux/types.cpp index ac1d0253..f8eb5209 100644 --- a/projects/stargazer/plugins/other/smux/types.cpp +++ b/projects/stargazer/plugins/other/smux/types.cpp @@ -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; } diff --git a/projects/stargazer/plugins/other/smux/types.h b/projects/stargazer/plugins/other/smux/types.h index 26d6e24f..7d7adac2 100644 --- a/projects/stargazer/plugins/other/smux/types.h +++ b/projects/stargazer/plugins/other/smux/types.h @@ -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 arcs; -- 2.43.2