File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2663,6 +2663,17 @@ template<typename T = no_user_data> class poller_t
2663
2663
add_impl (socket, events, nullptr );
2664
2664
}
2665
2665
2666
+ template <
2667
+ typename Dummy = void ,
2668
+ typename =
2669
+ typename std::enable_if<!std::is_same<T, no_user_data>::value, Dummy>::type>
2670
+ void add (fd_t fd, event_flags events, T *user_data)
2671
+ {
2672
+ add_impl (fd, events, user_data);
2673
+ }
2674
+
2675
+ void add (fd_t fd, event_flags events) { add_impl (fd, events, nullptr ); }
2676
+
2666
2677
void remove (zmq::socket_ref socket)
2667
2678
{
2668
2679
if (0 != zmq_poller_remove (poller_ptr.get (), socket.handle ())) {
@@ -2729,6 +2740,15 @@ template<typename T = no_user_data> class poller_t
2729
2740
throw error_t ();
2730
2741
}
2731
2742
}
2743
+
2744
+ void add_impl (fd_t fd, event_flags events, T *user_data)
2745
+ {
2746
+ if (0
2747
+ != zmq_poller_add_fd (poller_ptr.get (), fd, user_data,
2748
+ static_cast <short >(events))) {
2749
+ throw error_t ();
2750
+ }
2751
+ }
2732
2752
};
2733
2753
#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER)
2734
2754
You can’t perform that action at this time.
0 commit comments