glibmm 2.80.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Glib::IOSource Class Reference

#include <glibmm/main.h>

Inheritance diagram for Glib::IOSource:
Inheritance graph
[legend]

Public Types

using CppObjectType = Glib::IOSource
 
- Public Types inherited from Glib::Source
using CppObjectType = Glib::Source
 
using BaseObjectType = GSource
 

Public Member Functions

sigc::connection connect (const sigc::slot< bool(IOCondition)> &slot)
 
- Public Member Functions inherited from Glib::Source
 Source (const Source &)=delete
 
Sourceoperator= (const Source &)=delete
 
unsigned int attach (const Glib::RefPtr< MainContext > &context)
 Adds a Source to a context so that it will be executed within that context.
 
unsigned int attach ()
 Adds a Source to a context so that it will be executed within that context.
 
void destroy ()
 Removes a source from its MainContext, if any, and marks it as destroyed.
 
void set_priority (int priority)
 Sets the priority of a source.
 
int get_priority () const
 Gets the priority of a source.
 
void set_can_recurse (bool can_recurse)
 Sets whether a source can be called recursively.
 
bool get_can_recurse () const
 Checks whether a source is allowed to be called recursively.
 
unsigned int get_id () const
 Returns the numeric ID for a particular source.
 
Glib::RefPtr< MainContextget_context ()
 Gets the MainContext with which the source is associated.
 
GSourcegobj ()
 
const GSourcegobj () const
 
GSourcegobj_copy () const
 
void reference () const
 
void unreference () const
 

Static Public Member Functions

static Glib::RefPtr< IOSourcecreate (PollFD::fd_t fd, IOCondition condition)
 
static Glib::RefPtr< IOSourcecreate (const Glib::RefPtr< IOChannel > &channel, IOCondition condition)
 
- Static Public Member Functions inherited from Glib::Source
static Glib::RefPtr< Sourcecreate ()
 

Protected Member Functions

 IOSource (PollFD::fd_t fd, IOCondition condition)
 
 IOSource (const Glib::RefPtr< IOChannel > &channel, IOCondition condition)
 
 IOSource (GSource *cast_item, GSourceFunc callback_func)
 Wrap an existing GSource object and install the given callback function.
 
 ~IOSource () noexcept override
 
bool prepare (int &timeout) override
 
bool check () override
 
bool dispatch (sigc::slot_base *slot) override
 
- Protected Member Functions inherited from Glib::Source
 Source ()
 Construct an object that uses the virtual functions prepare(), check() and dispatch().
 
 Source (GSource *cast_item, GSourceFunc callback_func)
 Wrap an existing GSource object and install the given callback function.
 
virtual ~Source () noexcept
 
sigc::connection connect_generic (const sigc::slot_base &slot)
 
void add_poll (PollFD &poll_fd)
 Adds a file descriptor to the set of file descriptors polled for this source.
 
void remove_poll (PollFD &poll_fd)
 Removes a file descriptor from the set of file descriptors polled for this source.
 
gint64 get_time () const
 Gets the time to be used when checking this source.
 

Member Typedef Documentation

◆ CppObjectType

Constructor & Destructor Documentation

◆ IOSource() [1/3]

Glib::IOSource::IOSource ( PollFD::fd_t  fd,
IOCondition  condition 
)
protected

◆ IOSource() [2/3]

Glib::IOSource::IOSource ( const Glib::RefPtr< IOChannel > &  channel,
IOCondition  condition 
)
protected

◆ IOSource() [3/3]

Glib::IOSource::IOSource ( GSource cast_item,
GSourceFunc  callback_func 
)
protected

Wrap an existing GSource object and install the given callback function.

This constructor is for use by derived types that need to wrap a GSource object. The callback function is called from GLib (a C library). It shall have C linkage. (Many compilers accept a function with C++ linkage. If you use only such compilers, the callback function can be a static member function.)

See also
Source::Source(GSource*, GSourceFunc).
Since glibmm 2.42:

◆ ~IOSource()

Glib::IOSource::~IOSource ( )
overrideprotectednoexcept

Member Function Documentation

◆ check()

bool Glib::IOSource::check ( )
overrideprotectedvirtual

Implements Glib::Source.

◆ connect()

sigc::connection Glib::IOSource::connect ( const sigc::slot< bool(IOCondition)> &  slot)

◆ create() [1/2]

static Glib::RefPtr< IOSource > Glib::IOSource::create ( const Glib::RefPtr< IOChannel > &  channel,
IOCondition  condition 
)
static

◆ create() [2/2]

static Glib::RefPtr< IOSource > Glib::IOSource::create ( PollFD::fd_t  fd,
IOCondition  condition 
)
static

◆ dispatch()

bool Glib::IOSource::dispatch ( sigc::slot_base *  slot)
overrideprotectedvirtual

Implements Glib::Source.

◆ prepare()

bool Glib::IOSource::prepare ( int timeout)
overrideprotectedvirtual

Implements Glib::Source.