You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
815 B
29 lines
815 B
#include <sandbox_request_scheduler.h>
|
|
|
|
|
|
// The global of our polymorphic interface
|
|
sandbox_request_scheduler_config_t sandbox_request_scheduler;
|
|
|
|
// Initializes a concrete implementation of the sandbox request scheduler interface
|
|
void
|
|
sandbox_request_scheduler_initialize(sandbox_request_scheduler_config_t *config)
|
|
{
|
|
memcpy(&sandbox_request_scheduler, config, sizeof(sandbox_request_scheduler_config_t));
|
|
}
|
|
|
|
// Adds a sandbox request
|
|
sandbox_request_t *
|
|
sandbox_request_scheduler_add(sandbox_request_t *sandbox_request)
|
|
{
|
|
assert(sandbox_request_scheduler.add != NULL);
|
|
return sandbox_request_scheduler.add(sandbox_request);
|
|
}
|
|
|
|
// Removes a sandbox request
|
|
sandbox_request_t *
|
|
sandbox_request_scheduler_remove()
|
|
{
|
|
assert(sandbox_request_scheduler.remove != NULL);
|
|
return sandbox_request_scheduler.remove();
|
|
}
|