#include <stdint.h>
#include <stdlib.h>
#include "ecs.h"
#include "../include/koishi.h"
#include "list.h"
#include "common.h"
#include "coevent.h"
Aller au code source de ce fichier.
◆ BoxedTask
| typedef struct BoxedTask BoxedTask |
Une BoxedTask est une référence faible a une task.
◆ CoStatus
◆ CoTask
| typedef struct CoTask CoTask |
◆ CoTaskFunc
| typedef void *(* CoTaskFunc) (void *arg, size_t argsize) |
◆ CoWaitResult
| typedef struct CoWaitResult CoWaitResult |
◆ CoStatus
| Valeurs énumérées |
|---|
| CO_STATUS_SUSPENDED | |
| CO_STATUS_RUNNING | |
| CO_STATUS_IDLE | |
| CO_STATUS_DEAD | |
◆ cotask_active()
| CoTask * cotask_active |
( |
void | | ) |
|
Renvoie la cotask actuellement en train de run.
- Renvoie
- CoTask*
◆ cotask_bind_to_entity()
Rattache une tache a une entité
- Paramètres
-
- Renvoie
- Entity
◆ cotask_box()
Emballer une task dans une boite (ref faible).
- Paramètres
-
- Renvoie
- BoxedTask
◆ cotask_cancel()
| void cotask_cancel |
( |
CoTask * | task | ) |
|
Annule une tache.
- Paramètres
-
◆ cotask_force_finish()
| void cotask_force_finish |
( |
CoTask * | task | ) |
|
◆ cotask_free()
| void cotask_free |
( |
CoTask * | task | ) |
|
◆ cotask_get_events()
| CoTaskEvents * cotask_get_events |
( |
CoTask * | task | ) |
|
Renvoie les événements d'une tache.
- Paramètres
-
- Renvoie
- CoTaskEvents*
◆ cotask_get_sched()
Renvoie le scheduler d'une tache.
- Paramètres
-
- Renvoie
- CoSched*
◆ cotask_host_entity()
◆ cotask_host_events()
| void cotask_host_events |
( |
CoTask * | task, |
|
|
unsigned int | num_events, |
|
|
CoEvent | events[num_events] ) |
◆ cotask_resume()
| void * cotask_resume |
( |
CoTask * | task, |
|
|
void * | arg ) |
Redonne la main a la task.
- Paramètres
-
- Renvoie
- void*
◆ cotask_status()
Renvoie le statut de la task.
- Paramètres
-
- Renvoie
- CoStatus
◆ cotask_unbox()
A partir d'une boite, retrouver la task correspondante.
Si l'id de la boite ne correspond pas a l'id de la task, alors cette derniere a été recyclée et on renvoie NULL
- Paramètres
-
- Renvoie
- CoTask*
◆ cotask_wait()
| int cotask_wait |
( |
int | delay | ) |
|
Permet de yield pdt delay frames.
- Paramètres
-
- Renvoie
- int nombre de frames restantes
◆ cotask_wait_event()
◆ cotask_wait_event_once()
Wait un événement une seule fois.
- Paramètres
-
- Renvoie
- CoWaitResult
◆ cotask_wait_event_or_die()
Wait un événement, sinon cancel la tache.
- Paramètres
-
- Renvoie
- CoWaitResult
◆ cotask_wait_subtasks()
| int cotask_wait_subtasks |
( |
void | | ) |
|
Wait les soustaches actives.
- Renvoie
- int
◆ cotask_yield()
| void * cotask_yield |
( |
void * | arg | ) |
|
Yield la coroutine active (redonne la main au main).
- Paramètres
-
- Renvoie
- void*
◆ LIST_ANCHOR()
| typedef LIST_ANCHOR |
( |
CoTask | | ) |
|