pull.hpp 1.59 KB
Newer Older
1
/*
2 3
    Copyright (c) 2007-2011 iMatix Corporation
    Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
4 5 6 7

    This file is part of 0MQ.

    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 10 11 12 13 14
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    0MQ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    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 19 20
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

21 22
#ifndef __ZMQ_PULL_HPP_INCLUDED__
#define __ZMQ_PULL_HPP_INCLUDED__
23 24

#include "socket_base.hpp"
25
#include "fq.hpp"
26 27 28 29

namespace zmq
{

30
    class pull_t : public socket_base_t
31 32 33
    {
    public:

Martin Sustrik's avatar
Martin Sustrik committed
34
        pull_t (class ctx_t *parent_, uint32_t tid_);
35
        ~pull_t ();
36

37 38
    protected:

39
        //  Overloads of functions from socket_base_t.
40 41
        void xattach_pipes (class reader_t *inpipe_, class writer_t *outpipe_,
            const blob_t &peer_identity_);
42 43 44 45 46
        int xrecv (zmq_msg_t *msg_, int flags_);
        bool xhas_in ();

    private:

47
        //  Hook into the termination process.
48
        void process_term (int linger_);
49

50 51
        //  Fair queueing object for inbound pipes.
        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