From: Maxim Mamontov Date: Tue, 26 Jul 2011 15:40:01 +0000 (+0300) Subject: Other comparsion functions for OID added X-Git-Tag: 2.408-alpha~74 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/87550f881db0f6583709f7797becb3eef7d5f254 Other comparsion functions for OID added --- 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;