AgsTask

AgsTask — thread safe task

Functions

Properties

AgsTaskLauncher * task-launcher Read / Write

Signals

Types and Values

enum AgsTaskFlags
#define AGS_TYPE_TASK
struct AgsTask
struct AgsTaskClass

Object Hierarchy

    GObject
    ╰── AgsTask

Includes

#include <ags/thread/ags_task.h>

Description

AgsTask object acts an interceptor in a thread safe context.

Functions

AGS_TASK_GET_OBJ_MUTEX()

#define AGS_TASK_GET_OBJ_MUTEX(obj) (&(((AgsTask *) obj)->obj_mutex))

ags_task_test_flags ()

gboolean
ags_task_test_flags (AgsTask *task,
                     guint flags);

Test flags to be set on task .

Parameters

task

the AgsTask

 

flags

the flags

 

Returns

TRUE if flags are set, else FALSE

Since: 3.0.0


ags_task_set_flags ()

void
ags_task_set_flags (AgsTask *task,
                    guint flags);

Enable a feature of AgsTask.

Parameters

task

the AgsTask

 

flags

see enum AgsTaskFlags

 

Since: 3.0.0


ags_task_unset_flags ()

void
ags_task_unset_flags (AgsTask *task,
                      guint flags);

Disable a feature of AgsTask.

Parameters

task

the AgsTask

 

flags

see enum AgsTaskFlags

 

Since: 3.0.0


ags_task_launch ()

void
ags_task_launch (AgsTask *task);

Intercept task.

Parameters

task

an AgsTask

 

Since: 3.0.0


ags_task_failure ()

void
ags_task_failure (AgsTask *task,
                  GError *error);

Signals failure of task.

Parameters

task

an AgsTask

 

error

is NULL on success

 

Since: 3.0.0


ags_task_new ()

AgsTask *
ags_task_new ();

Create a new AgsTask.

Returns

the new AgsTask

Since: 3.0.0


AGS_IS_TASK()

#define AGS_IS_TASK(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_TASK))

AGS_TASK()

#define AGS_TASK(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TASK, AgsTask))

AGS_TASK_CLASS()

#define AGS_TASK_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_TASK, AgsTaskClass))

AGS_TASK_GET_CLASS()

#define AGS_TASK_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_TASK, AgsTaskClass))

ags_task_get_type ()

GType
ags_task_get_type ();

Types and Values

enum AgsTaskFlags

Enum values to control the behavior or indicate internal state of AgsTask by enable/disable as flags.

Members

AGS_TASK_LOCKED

the task is locked

 

AGS_TASK_CYCLIC

call task repeatedly

 

AGS_TYPE_TASK

#define AGS_TYPE_TASK                (ags_task_get_type())

struct AgsTask

struct AgsTask;

struct AgsTaskClass

struct AgsTaskClass {
  GObjectClass gobject;

  void (*launch)(AgsTask *task);

  void (*failure)(AgsTask *task, GError *error);
};

Property Details

The “task-launcher” property

  “task-launcher”            AgsTaskLauncher *

The assigned AgsTaskLauncher

Owner: AgsTask

Flags: Read / Write

Since: 3.0.0

Signal Details

The “failure” signal

void
user_function (AgsTask *task,
               gpointer error,
               gpointer user_data)

The ::failure signal is emited if ::launch fails

Parameters

task

the AgsTask failed to do its work.

 

error

the GError

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.0.0


The “launch” signal

void
user_function (AgsTask *task,
               gpointer user_data)

The ::launch signal is emited in a thread safe context

Parameters

task

the AgsTask to launch

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.0.0