Top | ![]() |
![]() |
![]() |
![]() |
InfStandaloneIo * | inf_standalone_io_new () |
void | inf_standalone_io_iteration () |
void | inf_standalone_io_iteration_timeout () |
void | inf_standalone_io_loop () |
void | inf_standalone_io_loop_quit () |
gboolean | inf_standalone_io_loop_running () |
InfStandaloneIo is a simple implementation of the InfIo interface. It implements a basic application event loop with support for listening on sockets, scheduling timeouts and inter-thread notifications. The class is fully thread-safe.
This class can be perfectly used for all functions in libinfinity that require a InfIo object to wait for events. If, on top of that more functionality is required, or the main loop needs to be integrated with another library such as a UI toolkit, a custom class should be created instead which implements the InfIo interface. For the GTK+ toolkit, there is InfGtkIo in the libinfgtk library, to integrate with the Glib main loop.
InfStandaloneIo *
inf_standalone_io_new (void
);
Creates a new InfStandaloneIo.
[constructor]
void
inf_standalone_io_iteration (InfStandaloneIo *io
);
Performs a single iteration of io
. The call will block until a first
event has occurred. Then, it will process that event and return.
void inf_standalone_io_iteration_timeout (InfStandaloneIo *io
,guint timeout
);
Performs a single iteration of io
. The call will block until either an
event occurred or timeout
milliseconds have elapsed. If an event occurred,
the event will be processed before returning.
void
inf_standalone_io_loop (InfStandaloneIo *io
);
This call will cause io
to wait for events and process them, but not
return until inf_standalone_io_loop_quit()
is called.
void
inf_standalone_io_loop_quit (InfStandaloneIo *io
);
Exits a loop in which io
is running through a call to
inf_standalone_io_loop()
.
gboolean
inf_standalone_io_loop_running (InfStandaloneIo *io
);
Returns whether io
runs currently in a loop initiated with
inf_standalone_io_loop()
.
struct InfStandaloneIo;
InfStandaloneIo is an opaque data type. You should only access it via the public API functions.