Public Member Functions | |
void | SpawnNext () |
Start the next job in the schedule. | |
void | JoinNext () |
Join the next finished job, if available. | |
void | Queue (LinkGraph *lg) |
void | Unqueue (LinkGraph *lg) |
void | SpawnAll () |
Start all threads in the running list. | |
Static Public Member Functions | |
static LinkGraphSchedule * | Instance () |
Retriebe the link graph schedule or create it if necessary. | |
static void | Run (void *j) |
Run all handlers for the given Job. | |
static void | Clear () |
Clear all link graphs and jobs from the schedule. | |
Static Public Attributes | |
static const uint | SPAWN_JOIN_TICK = 21 |
Tick when jobs are spawned or joined every day. | |
Protected Attributes | |
ComponentHandler * | handlers [6] |
Handlers to be run for each job. | |
GraphList | schedule |
Queue for new jobs. | |
JobList | running |
Currently running jobs. | |
Private Types | |
typedef std::list< LinkGraph * > | GraphList |
typedef std::list< LinkGraphJob * > | JobList |
Private Member Functions | |
LinkGraphSchedule () | |
Create a link graph schedule and initialize its handlers. | |
~LinkGraphSchedule () | |
Delete a link graph schedule and its handlers. | |
Friends | |
const SaveLoad * | GetLinkGraphScheduleDesc () |
Get a SaveLoad array for the link graph schedule. |
Definition at line 363 of file linkgraph.h.
void LinkGraphSchedule::Run | ( | void * | j | ) | [static] |
Run all handlers for the given Job.
j | Pointer to a link graph job. |
Definition at line 351 of file linkgraph.cpp.
References handlers, Instance(), lengthof, ComponentHandler::Run(), and schedule.
Referenced by LinkGraphJob::SpawnThread().
void LinkGraphSchedule::SpawnAll | ( | ) |
Start all threads in the running list.
This is only useful for save/load. Usually threads are started when the job is created.
Definition at line 397 of file linkgraph.cpp.
References running.
Referenced by AfterLoadLinkGraphs().
const SaveLoad* GetLinkGraphScheduleDesc | ( | ) | [friend] |
Get a SaveLoad array for the link graph schedule.
Definition at line 87 of file linkgraph_sl.cpp.