i_poll_events.hpp 1.36 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
1
/*
2
    Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

    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
18
*/
19
 
Martin Sustrik's avatar
Martin Sustrik committed
20 21
#ifndef __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
#define __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
22
 
Martin Sustrik's avatar
Martin Sustrik committed
23
namespace zmq
Martin Sustrik's avatar
Martin Sustrik committed
24
{
25 26 27 28
 
    // Virtual interface to be exposed by object that want to be notified
    // about events on file descriptors.
 
Martin Sustrik's avatar
Martin Sustrik committed
29 30
    struct i_poll_events
    {
31
        virtual ~i_poll_events () {}
32 33
 
        // Called by I/O thread when file descriptor is ready for reading.
Martin Sustrik's avatar
Martin Sustrik committed
34
        virtual void in_event () = 0;
35 36
 
        // Called by I/O thread when file descriptor is ready for writing.
Martin Sustrik's avatar
Martin Sustrik committed
37
        virtual void out_event () = 0;
38 39
 
        // Called when timer expires.
40
        virtual void timer_event (int id_) = 0;
Martin Sustrik's avatar
Martin Sustrik committed
41
    };
42
 
Martin Sustrik's avatar
Martin Sustrik committed
43
}
44
 
Martin Sustrik's avatar
Martin Sustrik committed
45
#endif