updated Doxyfile
[strongswan.git] / src / charon / processing / scheduler.h
1 /*
2 * Copyright (C) 2005-2007 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * $Id$
17 */
18
19 /**
20 * @defgroup scheduler scheduler
21 * @{ @ingroup processing
22 */
23
24 #ifndef SCHEDULER_H_
25 #define SCHEDULER_H_
26
27 typedef struct scheduler_t scheduler_t;
28
29 #include <library.h>
30 #include <processing/jobs/job.h>
31
32 /**
33 * The scheduler queues and executes timed events.
34 *
35 * The scheduler stores timed events and passes them to the processor.
36 */
37 struct scheduler_t {
38
39 /**
40 * Adds a event to the queue, using a relative time offset.
41 *
42 * Schedules a job for execution using a relative time offset.
43 *
44 * @param job job to schedule
45 * @param time relative to to schedule job (in ms)
46 */
47 void (*schedule_job) (scheduler_t *this, job_t *job, u_int32_t time);
48
49 /**
50 * Returns number of jobs scheduled.
51 *
52 * @return number of scheduled jobs
53 */
54 u_int (*get_job_load) (scheduler_t *this);
55
56 /**
57 * Destroys a scheduler object.
58 */
59 void (*destroy) (scheduler_t *this);
60 };
61
62 /**
63 * Create a scheduler.
64 *
65 * @return scheduler_t object
66 */
67 scheduler_t *scheduler_create(void);
68
69 #endif /** SCHEDULER_H_ @}*/