libzmq master
The Intelligent Transport Layer

rep.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright (c) 2009-2011 250bpm s.r.o.
00003     Copyright (c) 2007-2011 iMatix Corporation
00004     Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
00005 
00006     This file is part of 0MQ.
00007 
00008     0MQ is free software; you can redistribute it and/or modify it under
00009     the terms of the GNU Lesser General Public License as published by
00010     the Free Software Foundation; either version 3 of the License, or
00011     (at your option) any later version.
00012 
00013     0MQ is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public License
00019     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef __ZMQ_REP_HPP_INCLUDED__
00023 #define __ZMQ_REP_HPP_INCLUDED__
00024 
00025 #include "xrep.hpp"
00026 
00027 namespace zmq
00028 {
00029 
00030     class rep_t : public xrep_t
00031     {
00032     public:
00033 
00034         rep_t (class ctx_t *parent_, uint32_t tid_);
00035         ~rep_t ();
00036 
00037         //  Overloads of functions from socket_base_t.
00038         int xsend (class msg_t *msg_, int flags_);
00039         int xrecv (class msg_t *msg_, int flags_);
00040         bool xhas_in ();
00041         bool xhas_out ();
00042 
00043     private:
00044 
00045         //  If true, we are in process of sending the reply. If false we are
00046         //  in process of receiving a request.
00047         bool sending_reply;
00048 
00049         //  If true, we are starting to receive a request. The beginning
00050         //  of the request is the backtrace stack.
00051         bool request_begins;
00052 
00053         rep_t (const rep_t&);
00054         const rep_t &operator = (const rep_t&);
00055 
00056     };
00057 
00058     class rep_session_t : public xrep_session_t
00059     {
00060     public:
00061 
00062         rep_session_t (class io_thread_t *io_thread_, bool connect_,
00063             class socket_base_t *socket_, const options_t &options_,
00064             const char *protocol_, const char *address_);
00065         ~rep_session_t ();
00066 
00067     private:
00068 
00069         rep_session_t (const rep_session_t&);
00070         const rep_session_t &operator = (const rep_session_t&);
00071     };
00072 
00073 }
00074 
00075 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines