mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-10 19:59:24 +00:00
BEHOLD ! The threadinator !
This commit is contained in:
@ -8,6 +8,12 @@
|
||||
GETTER(Visitor, char*, name);
|
||||
GETTER(Visitor, int, id);
|
||||
|
||||
void * runnable_Visitor(void * void_this){
|
||||
Visitor *this = (Visitor*) void_this;
|
||||
printf("Bonjour, je suis %s et je souhaite rendre visite a %s\n", this->name, this->contact_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void _free__Visitor(THIS(Visitor)){
|
||||
if (this->name != NULL)
|
||||
free(this->name);
|
||||
@ -30,7 +36,8 @@ Visitor *_init_Visitor(int id, char* name, char * contact_name){
|
||||
|
||||
LINK_ALL(Visitor, new_visitor,
|
||||
get_name,
|
||||
get_id
|
||||
get_id,
|
||||
runnable
|
||||
);
|
||||
|
||||
return new_visitor;
|
||||
|
@ -14,6 +14,7 @@ typedef struct o_Visitor {
|
||||
PRIVATE int position;
|
||||
PRIVATE int destination;
|
||||
|
||||
PUBLIC void * (*runnable)(void* void_this);
|
||||
PUBLIC char * (*get_name)(_THIS(Visitor));
|
||||
PUBLIC int (*get_id)(_THIS(Visitor));
|
||||
|
||||
|
Reference in New Issue
Block a user