From edfd05df8ef58afc498795cb74906c07ee396f76 Mon Sep 17 00:00:00 2001
From: Jon Dyte <jon@totient.co.uk>
Date: Wed, 7 Apr 2010 08:20:01 +0200
Subject: devices can be created via API

---
 include/zmq.h   | 10 ++++++++++
 include/zmq.hpp |  7 +++++++
 2 files changed, 17 insertions(+)

(limited to 'include')

diff --git a/include/zmq.h b/include/zmq.h
index a1fcf31..3d641ef 100644
--- a/include/zmq.h
+++ b/include/zmq.h
@@ -224,6 +224,16 @@ ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
 //  compiled with different CRT library.
 ZMQ_EXPORT int zmq_errno ();
 
+////////////////////////////////////////////////////////////////////////////////
+//  Devices - Experimental
+////////////////////////////////////////////////////////////////////////////////
+
+#define ZMQ_STREAMER 1
+#define ZMQ_FORWARDER 2
+#define ZMQ_QUEUE 3
+
+ZMQ_EXPORT int zmq_device (int device, void * insocket, void* outsocket);
+
 ////////////////////////////////////////////////////////////////////////////////
 //  Helper functions.
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/include/zmq.hpp b/include/zmq.hpp
index 6228133..63d2835 100644
--- a/include/zmq.hpp
+++ b/include/zmq.hpp
@@ -56,6 +56,13 @@ namespace zmq
         return rc;
     }
 
+    inline void device (int device_, void * insocket_, void* outsocket_)
+    {
+        int rc = zmq_device (device_, insocket_, outsocket_);
+        if (rc != 0)
+            throw error_t ();
+    }
+
     class message_t : private zmq_msg_t
     {
         friend class socket_t;
-- 
cgit v1.2.3