*/
portid(__u32 ref, addr node) throw ();
+ /// Compares 2 port ids.
+ bool operator == (const portid& other) const throw ();
+
};
/**
*/
name(__u32 type, __u32 instance) throw ();
+ /// Compares 2 port names.
+ bool operator == (const name& other) const throw ();
+
};
/**
*/
nameseq(__u32 type, __u32 instance) throw ();
+ /// Compares 2 port name sequences.
+ bool operator == (const nameseq& other) const throw ();
+
};
/**
* Allows the topology service to inform the application about
* @b all ports of interest.
*/
- SUB_SERVICE = TIPC_SUB_SERVICE
+ SUB_SERVICE = TIPC_SUB_SERVICE,
+
+ /**
+ * Instruct the topology service to cancel a previously requested
+ * subscription.
+ *
+ * The application simply resends the original subscription request
+ * with SUB_CANCEL logically OR'd into the event filter.
+ *
+ * @note This is implemented in TIPC 1.7+ only (according to TIPC
+ * documentation).
+ */
+ SUB_CANCEL = TIPC_SUB_CANCEL
};
* (or WAIT_FOREVER).
* @param filter An event filter specifying which events are of
* interest to the application (see subscr_t).
- * @param usr_handle An 8 byte user handle that is application-defined.
+ * @param usr_handle An 8 byte user handle that is application-defined,
+ * (treated as a string).
*/
subscr(nameseq seq, __u32 timeout, __u32 filter,
const char* usr_handle = "") throw ();
+ /**
+ * Constructor.
+ *
+ * @param seq The port name sequence of interest to the application.
+ * @param timeout A subscription timeout value, in ms
+ * (or WAIT_FOREVER).
+ * @param filter An event filter specifying which events are of
+ * interest to the application (see subscr_t).
+ * @param usr_handle An 8 byte user handle that is application-defined.
+ * (treated as binary data).
+ * @param handle_size Size of the usr_handle buffer (it should be at
+ * most 8)
+ */
+ subscr(nameseq seq, __u32 timeout, __u32 filter,
+ const char* usr_handle, size_t handle_size)
+ throw ();
+
+ /// Set the user handle as a string.
+ void handle(const char* usr_handle) throw ();
+
+ /// 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.
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 ()
{
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 ()
{
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 ()
seq = s;
timeout = t;
filter = f;
- std::memcpy(usr_handle, uh, sizeof(usr_handle));
+ handle(uh);
+}
+
+inline
+posixx::linux::tipc::subscr::subscr(nameseq s, __u32 t, __u32 f,
+ const char* uh, size_t uh_size) throw ()
+{
+ seq = s;
+ timeout = t;
+ filter = f;
+ handle(uh, uh_size);
+}
+
+inline
+void posixx::linux::tipc::subscr::handle(const char* uh) throw ()
+{
+ std::strncpy(usr_handle, uh, sizeof(usr_handle));
+}
+
+inline
+void posixx::linux::tipc::subscr::handle(const char* uh, size_t uh_size)
+ throw ()
+{
+ 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