Ubuntu TV Media Scanner
A centralized index for removable media content.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
mediascanner::Source Class Reference

The Source class provides access to the GLib event source mechanism. More...

#include <mediascanner/glibutils.h>

+ Inheritance diagram for mediascanner::Source:

Public Types

typedef std::function< bool()> SourceFunction
 The signature of a regular idle source. More...
 
typedef std::function< void()> OneCallFunction
 The signature of a single-call idle source. More...
 

Static Public Member Functions

static bool Remove (unsigned id)
 Removes an event source handler. More...
 

Static Protected Member Functions

static gboolean on_source_function (gpointer data)
 
static gboolean on_one_call_function (gpointer data)
 

Detailed Description

The Source class provides access to the GLib event source mechanism.

Member Typedef Documentation

typedef std::function<void()> mediascanner::Source::OneCallFunction

The signature of a single-call idle source.

This function is called excactly once. After returning it is automatically removed from the list of event sources and will not be called again.

typedef std::function<bool()> mediascanner::Source::SourceFunction

The signature of a regular idle source.

Returns
If this function returns false it is automatically removed from the list of event sources and will not be called again.

Member Function Documentation

static gboolean mediascanner::Source::on_one_call_function ( gpointer  data)
inlinestaticprotected
static gboolean mediascanner::Source::on_source_function ( gpointer  data)
inlinestaticprotected
static bool mediascanner::Source::Remove ( unsigned  id)
inlinestatic

Removes an event source handler.

Parameters
idThe source handler's identifier.
Returns
True if the identifier was valid and the handler got removed.