1 /*
2     Copyright (c) 2007-2011 iMatix Corporation
3     Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
4 
5     This file is part of 0MQ.
6 
7     0MQ is free software; you can redistribute it and/or modify it under
8     the terms of the GNU Lesser General Public License as published by
9     the Free Software Foundation; either version 3 of the License, or
10     (at your option) any later version.
11 
12     0MQ is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU Lesser General Public License for more details.
16 
17     You should have received a copy of the GNU Lesser General Public License
18     along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef __ZMQ_PULL_HPP_INCLUDED__
22 #define __ZMQ_PULL_HPP_INCLUDED__
23 
24 #include "socket_base.hpp"
25 #include "fq.hpp"
26 
27 namespace zmq
28 {
29 
30     class pull_t : public socket_base_t
31     {
32     public:
33 
34         pull_t (class ctx_t *parent_, uint32_t tid_);
35         ~pull_t ();
36 
37     protected:
38 
39         //  Overloads of functions from socket_base_t.
40         void xattach_pipes (class reader_t *inpipe_, class writer_t *outpipe_,
41             const blob_t &peer_identity_);
42         int xrecv (zmq_msg_t *msg_, int flags_);
43         bool xhas_in ();
44 
45     private:
46 
47         //  Hook into the termination process.
48         void process_term (int linger_);
49 
50         //  Fair queueing object for inbound pipes.
51         fq_t fq;
52 
53         pull_t (const pull_t&);
54         const pull_t &operator = (const pull_t&);
55 
56     };
57 
58 }
59 
60 #endif
61