AlarmdQueue

AlarmdQueue — Object type to handle the event queue.

Synopsis




            AlarmdQueue;
AlarmdQueue* alarmd_queue_new               (void);
gulong      alarmd_queue_add_event          (AlarmdQueue *queue,
                                             AlarmdEvent *event);
gboolean    alarmd_queue_remove_event       (AlarmdQueue *queue,
                                             gulong event_id);
glong*      alarmd_queue_query_events       (AlarmdQueue *queue,
                                             gint64 start_time,
                                             gint64 end_time,
                                             gint32 flag_mask,
                                             gint32 flags,
                                             guint *n_events);
AlarmdEvent* alarmd_queue_get_event         (AlarmdQueue *queue,
                                             gulong event_id);

Description

The AlarmdQueue handles the AlarmdEvent objects. It has timer plugins that handle the events; one that can power up the device and one that cannot. If only one timer is available, it is used for all events.

Details

AlarmdQueue

typedef struct {
	AlarmdObject parent_instance;
} AlarmdQueue;


alarmd_queue_new ()

AlarmdQueue* alarmd_queue_new               (void);

Creates new alarmd queue.

Returns : Newly created AlarmdQueue

alarmd_queue_add_event ()

gulong      alarmd_queue_add_event          (AlarmdQueue *queue,
                                             AlarmdEvent *event);

Adds the event to the queue to be launched at apecified time.

queue : A AlarmdQueue the event should be added into.
event : A AlarmdEvent that should be added to the queue.
Returns : Unique identifier for the event.

alarmd_queue_remove_event ()

gboolean    alarmd_queue_remove_event       (AlarmdQueue *queue,
                                             gulong event_id);

Removes the event specified by the identifier event_id from the queue.

queue : The AlamrmdQueue from where the event should be removed from.
event_id : The identifier for the AlarmdEvent.
Returns : TRUE if the event was found and removed, FALSE otherwise.

alarmd_queue_query_events ()

glong*      alarmd_queue_query_events       (AlarmdQueue *queue,
                                             gint64 start_time,
                                             gint64 end_time,
                                             gint32 flag_mask,
                                             gint32 flags,
                                             guint *n_events);

Queries events that occurr between start_time adn end_time with flags chosen with flag_mask that have values specified in flags.

queue : The AlarmdQueue that should be queried.
start_time : Events that launch avter this time should be returned.
end_time : Events that launch before this time should be returned.
flag_mask : Bitfield that specifies whchi fields should be checked.
flags : The values wanted for the flags specified in flag_mask.
n_events : Pointer to an integer that should contain the number of events found.
Returns : Array of identifiers for the found events.

alarmd_queue_get_event ()

AlarmdEvent* alarmd_queue_get_event         (AlarmdQueue *queue,
                                             gulong event_id);

Finds and returns the wanted event from the queue. The event is still on the queue.

queue : The AlarmdQueue that contains the event.
event_id : The identifier for the AlarmdEvent.
Returns : The AlarmdEvent with the wanted identifier or NULL if not found.

See Also

AlarmdEvent