X-Git-Url: https://git.llucax.com/software/posixx.git/blobdiff_plain/c0c2538812bb33884c37763d996ae5a960574126..6f13e47380788948b958309c89df400fea6b32fb:/src/linux/tipc.hpp?ds=sidebyside diff --git a/src/linux/tipc.hpp b/src/linux/tipc.hpp index 16f569f..26bae1d 100644 --- a/src/linux/tipc.hpp +++ b/src/linux/tipc.hpp @@ -96,6 +96,9 @@ struct portid: tipc_portid */ portid(__u32 ref, addr node) throw (); + /// Compares 2 port ids. + bool operator == (const portid& other) const throw (); + }; /** @@ -114,6 +117,9 @@ struct name: tipc_name */ name(__u32 type, __u32 instance) throw (); + /// Compares 2 port names. + bool operator == (const name& other) const throw (); + }; /** @@ -141,6 +147,9 @@ struct nameseq: tipc_name_seq */ nameseq(__u32 type, __u32 instance) throw (); + /// Compares 2 port name sequences. + bool operator == (const nameseq& other) const throw (); + }; /** @@ -252,6 +261,9 @@ struct subscr: tipc_subscr /// Set the user handle as binary data. void handle(const char* usr_handle, size_t handle_size) throw (); + /// Compares 2 subscription request messages. + bool operator == (const subscr& other) const throw (); + }; /// Type of events. @@ -439,6 +451,13 @@ posixx::linux::tipc::portid::portid(__u32 r, addr n) throw () node = n; } +inline +bool posixx::linux::tipc::portid::operator == ( + const posixx::linux::tipc::portid& other) const throw () +{ + return memcmp(this, &other, sizeof(*this)) == 0; +} + inline posixx::linux::tipc::name::name(__u32 t, __u32 i) throw () { @@ -446,6 +465,13 @@ posixx::linux::tipc::name::name(__u32 t, __u32 i) throw () instance = i; } +inline +bool posixx::linux::tipc::name::operator == ( + const posixx::linux::tipc::name& other) const throw () +{ + return memcmp(this, &other, sizeof(*this)) == 0; +} + inline posixx::linux::tipc::nameseq::nameseq(__u32 t, __u32 low, __u32 up) throw () { @@ -462,6 +488,13 @@ posixx::linux::tipc::nameseq::nameseq(__u32 t, __u32 instance) throw () upper = instance; } +inline +bool posixx::linux::tipc::nameseq::operator == ( + const posixx::linux::tipc::nameseq& other) const throw () +{ + return memcmp(this, &other, sizeof(*this)) == 0; +} + inline posixx::linux::tipc::subscr::subscr(nameseq s, __u32 t, __u32 f, const char* uh) throw () @@ -495,6 +528,13 @@ void posixx::linux::tipc::subscr::handle(const char* uh, size_t uh_size) std::memcpy(usr_handle, uh, uh_size); } +inline +bool posixx::linux::tipc::subscr::operator == (const subscr& other) const + throw () +{ + return memcmp(this, &other, sizeof(*this)) == 0; +} + inline posixx::linux::tipc::sockaddr::sockaddr() throw () {