i_inout.hpp 1.43 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 21 22 23
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __ZMQ_I_INOUT_HPP_INCLUDED__
#define __ZMQ_I_INOUT_HPP_INCLUDED__

24
#include "../include/zmq.h"
25

26 27
#include "stdint.hpp"

28 29 30 31 32
namespace zmq
{

    struct i_inout
    {
33 34
        virtual ~i_inout () {}

35
        //  Engine asks for a message to send to the network.
36
        virtual bool read (::zmq_msg_t *msg_) = 0;
Martin Sustrik's avatar
Martin Sustrik committed
37

38
        //  Engine received message from the network and sends it further on.
39
        virtual bool write (::zmq_msg_t *msg_) = 0;
Martin Sustrik's avatar
Martin Sustrik committed
40

41
        //  Flush all the previously written messages.
42
        virtual void flush () = 0;
43

44 45
        //  Engine is dead. Drop all the references to it.
        virtual void detach () = 0;
46 47 48 49 50
    };

}

#endif