Migrated process_message_job_t to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2011-02-10 08:09:36 +01:00
parent 8125dcca59
commit 76331a6493
@@ -35,19 +35,15 @@ struct private_process_message_job_t {
message_t *message;
};
/**
* Implements job_t.destroy.
*/
static void destroy(private_process_message_job_t *this)
METHOD(job_t, destroy, void,
private_process_message_job_t *this)
{
this->message->destroy(this->message);
free(this);
}
/**
* Implementation of job_t.execute.
*/
static void execute(private_process_message_job_t *this)
METHOD(job_t, execute, void,
private_process_message_job_t *this)
{
ike_sa_t *ike_sa;
@@ -93,14 +89,17 @@ static void execute(private_process_message_job_t *this)
*/
process_message_job_t *process_message_job_create(message_t *message)
{
private_process_message_job_t *this = malloc_thing(private_process_message_job_t);
private_process_message_job_t *this;
/* interface functions */
this->public.job_interface.execute = (void (*) (job_t *)) execute;
this->public.job_interface.destroy = (void(*)(job_t*))destroy;
/* private variables */
this->message = message;
INIT(this,
.public = {
.job_interface = {
.execute = _execute,
.destroy = _destroy,
},
},
.message = message,
);
return &(this->public);
}