55 #if !defined(__AMXP_SCHEDULER_H__)
56 #define __AMXP_SCHEDULER_H__
71 #ifndef __AMXC_LLIST_H__
72 #error "Missing include <amxc/amxc_llist.h>"
75 #ifndef __AMXC_HTABLE_H__
76 #error "Missing include <amxc/amxc_htable.h>"
441 const char* cron_expr,
483 const char* cron_begin,
484 const char* cron_end);
544 const char* days_of_week,
608 const char* start_time,
609 const char* end_time,
610 const char* days_of_week);
Ambiorix cron expression parser.
Ambiorix signal manager and signal API header file.
Ambiorix slot API header file.
Ambiorix timer API header file.
int amxp_scheduler_connect(amxp_scheduler_t *scheduler, const char *id, amxp_slot_fn_t fn, void *priv)
Connects a callback function to the scheduler.
int amxp_scheduler_use_local_time(amxp_scheduler_t *scheduler, bool use_local_time)
Use local time or UTC time in calculation for next trigger times.
int amxp_scheduler_set_weekly_begin_end_item(amxp_scheduler_t *scheduler, const char *id, const char *start_time, const char *end_time, const char *days_of_week)
Adds a schedule item or updates a schedule item using a start time, end time and list of week days.
int amxp_scheduler_enable_item(amxp_scheduler_t *scheduler, const char *id, bool enable)
Enables or disable a schedule item.
struct _scheduler_item amxp_scheduler_item_t
Structure containing a schedule item.
int amxp_scheduler_new(amxp_scheduler_t **scheduler)
Allocates a amxp_scheduler_t structures and initializes to an empty scheduler.
int amxp_scheduler_set_weekly_item(amxp_scheduler_t *scheduler, const char *id, const char *time, const char *days_of_week, uint32_t duration)
Adds a schedule item or updates a schedule item using a time and list of week days.
void amxp_scheduler_delete(amxp_scheduler_t **scheduler)
Frees the previously allocated amxp_scheduler_t structure.
int amxp_scheduler_disconnect(amxp_scheduler_t *scheduler, const char *id, amxp_slot_fn_t fn)
Disconnects a callback function from the scheduler.
int amxp_scheduler_remove_item(amxp_scheduler_t *scheduler, const char *id)
Removes a schedule item from the scheduler.
amxp_signal_mngr_t * amxp_scheduler_get_sigmngr(amxp_scheduler_t *scheduler)
Gets the signal manager of a scheduler.
int amxp_scheduler_enable(amxp_scheduler_t *scheduler, bool enable)
Enables or disable the scheduler.
int amxp_scheduler_set_cron_begin_end_item(amxp_scheduler_t *scheduler, const char *id, const char *cron_begin, const char *cron_end)
Adds a schedule item or updates a schedule item using a cron expressions.
int amxp_scheduler_set_cron_item(amxp_scheduler_t *scheduler, const char *id, const char *cron_expr, uint32_t duration)
Adds a schedule item or updates a schedule item using a cron expression.
struct _scheduler amxp_scheduler_t
Structure containing a scheduler.
int amxp_scheduler_init(amxp_scheduler_t *scheduler)
Initializes a amxp_scheduler_t to an empty scheduler.
int amxp_scheduler_update(amxp_scheduler_t *scheduler)
Forces recalculation of the schedule items' next occurrence time.
void amxp_scheduler_clean(amxp_scheduler_t *scheduler)
Cleans the scheduler.
void(* amxp_slot_fn_t)(const char *const sig_name, const amxc_var_t *const data, void *const priv)
Slot callback function signature.
Structure containing the signal manager information.
Structure containing parsed cron expression.
Structure containing a schedule item.
amxp_cron_expr_t end_cron
Structure containing a scheduler.
amxp_signal_mngr_t sigmngr
amxc_llist_t ordered_items