glibmm 2.80.0
Public Types | Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
Glib::MainLoop Class Reference

#include <glibmm/main.h>

Public Types

using CppObjectType = Glib::MainLoop
 
using BaseObjectType = GMainLoop
 

Public Member Functions

void run ()
 Runs a main loop until quit() is called on the loop.
 
void quit ()
 Stops a MainLoop from running.
 
bool is_running ()
 Checks to see if the main loop is currently being run via run().
 
Glib::RefPtr< MainContextget_context ()
 Returns the MainContext of loop.
 
void reference () const
 Increases the reference count on a MainLoop object by one.
 
void unreference () const
 Decreases the reference count on a MainLoop object by one.
 
GMainLoopgobj ()
 
const GMainLoopgobj () const
 
GMainLoopgobj_copy () const
 

Static Public Member Functions

static Glib::RefPtr< MainLoopcreate (bool is_running=false)
 
static Glib::RefPtr< MainLoopcreate (const Glib::RefPtr< MainContext > &context, bool is_running=false)
 
static int depth ()
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< MainLoopwrap (GMainLoop *gobject, bool take_copy=false)
 

Member Typedef Documentation

◆ BaseObjectType

◆ CppObjectType

Member Function Documentation

◆ create() [1/2]

static Glib::RefPtr< MainLoop > Glib::MainLoop::create ( bool  is_running = false)
static

◆ create() [2/2]

static Glib::RefPtr< MainLoop > Glib::MainLoop::create ( const Glib::RefPtr< MainContext > &  context,
bool  is_running = false 
)
static

◆ depth()

static int Glib::MainLoop::depth ( )
static

◆ get_context()

Glib::RefPtr< MainContext > Glib::MainLoop::get_context ( )

Returns the MainContext of loop.

Returns
The MainContext of loop.

◆ gobj() [1/2]

GMainLoop * Glib::MainLoop::gobj ( )

◆ gobj() [2/2]

const GMainLoop * Glib::MainLoop::gobj ( ) const

◆ gobj_copy()

GMainLoop * Glib::MainLoop::gobj_copy ( ) const

◆ is_running()

bool Glib::MainLoop::is_running ( )

Checks to see if the main loop is currently being run via run().

Returns
true if the mainloop is currently being run.

◆ quit()

void Glib::MainLoop::quit ( )

Stops a MainLoop from running.

Any calls to run() for the loop will return.

◆ reference()

void Glib::MainLoop::reference ( ) const

Increases the reference count on a MainLoop object by one.

◆ run()

void Glib::MainLoop::run ( )

Runs a main loop until quit() is called on the loop.

If this is called for the thread of the loop's MainContext, it will process events from the loop, otherwise it will simply wait.

◆ unreference()

void Glib::MainLoop::unreference ( ) const

Decreases the reference count on a MainLoop object by one.

If the result is zero, free the loop and free all associated memory.