1
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
/* Copyright (C) 2012 The giomm Development Team
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
#include <glibmm/interface.h>
23
_PINCLUDE(glibmm/private/interface_p.h)
26
#ifndef DOXYGEN_SHOULD_SKIP_THIS
27
typedef struct _GPollableInputStreamInterface GPollableInputStreamInterface;
28
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
35
/** PollableInputStream - Interface for pollable input streams.
36
* PollableInputStream is implemented by InputStreams that can be polled for
37
* readiness to read. This can be used when interfacing with a non-GIO API that
38
* expects UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
41
class PollableInputStream : public Glib::Interface
43
_CLASS_INTERFACE(PollableInputStream, GPollableInputStream, G_POLLABLE_INPUT_STREAM, GPollableInputStreamInterface)
46
_WRAP_METHOD(bool can_poll() const, g_pollable_input_stream_can_poll)
47
_WRAP_METHOD(bool is_readable() const, g_pollable_input_stream_is_readable)
49
//TODO: _WRAP_METHOD(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), g_pollable_input_stream_create_source)
51
_WRAP_METHOD(gssize read_nonblocking(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}), g_pollable_input_stream_read_nonblocking, errthrow)
53
_WRAP_VFUNC(bool can_poll() const, "can_poll")
54
_WRAP_VFUNC(bool is_readable() const, "is_readable")
56
//TODO: _WRAP_VFUNC(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), "create_source")
58
_WRAP_VFUNC(gssize read_nonblocking(void* buffer, gsize count), "read_nonblocking", errthrow)