i_poll_events.hpp 1.41 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
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 8 9 10 11 12 13 14 15 16 17 18

    This file is part of 0MQ.

    0MQ is free software; you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by
    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
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
Martin Sustrik's avatar
Martin Sustrik committed
19
*/
20
 
Martin Sustrik's avatar
Martin Sustrik committed
21 22
#ifndef __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
#define __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
23
 
Martin Sustrik's avatar
Martin Sustrik committed
24
namespace zmq
Martin Sustrik's avatar
Martin Sustrik committed
25
{
26 27 28 29
 
    // Virtual interface to be exposed by object that want to be notified
    // about events on file descriptors.
 
Martin Sustrik's avatar
Martin Sustrik committed
30 31
    struct i_poll_events
    {
32
        virtual ~i_poll_events () {}
33 34
 
        // Called by I/O thread when file descriptor is ready for reading.
Martin Sustrik's avatar
Martin Sustrik committed
35
        virtual void in_event () = 0;
36 37
 
        // Called by I/O thread when file descriptor is ready for writing.
Martin Sustrik's avatar
Martin Sustrik committed
38
        virtual void out_event () = 0;
39 40
 
        // Called when timer expires.
41
        virtual void timer_event (int id_) = 0;
Martin Sustrik's avatar
Martin Sustrik committed
42
    };
43
 
Martin Sustrik's avatar
Martin Sustrik committed
44
}
45
 
Martin Sustrik's avatar
Martin Sustrik committed
46
#endif