Statistics
| Branch: | Tag: | Revision:

sssimulator / EventScheduler / event_scheduler.h @ master

History | View | Annotate | Download (798 Bytes)

1 af271552 luca
/*
2
 * this is sssim: the simple & stupid simulator
3
 *
4
 *  copyright (c) 2015 luca baldesi
5
 *
6
 *  this is free software; see gpl-3.0.txt
7
 */
8
9
#ifndef __EVENT_SCHEDULER_H__
10
#define __EVENT_SCHEDULER_H__ 1
11
12
#include <stdint.h>
13
#include "ord_array.h"
14
#include "action_event.h"
15
16 bf3d3ebd Luca Baldesi
#define LOW_EVENT_PRIORITY 0
17
#define HIGH_EVENT_PRIORITY 1
18
19 af271552 luca
struct event_scheduler * event_scheduler_new(const uint32_t size);
20
21
void event_scheduler_destroy(struct event_scheduler **es);
22
23 0bf1a874 Luca Baldesi
int event_scheduler_insert(struct event_scheduler *es, struct action_event * e, double interval, uint8_t priority);
24 af271552 luca
25
struct action_event * event_scheduler_pop(struct event_scheduler *es);
26
27
uint32_t event_scheduler_queue_length(struct event_scheduler *es);
28
29
double event_scheduler_elapsed_time(const struct event_scheduler *es);
30
31
#endif