Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Types | Private Member Functions | Friends

LinkGraphSchedule Class Reference

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 LinkGraphScheduleInstance ()
 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

ComponentHandlerhandlers [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 SaveLoadGetLinkGraphScheduleDesc ()
 Get a SaveLoad array for the link graph schedule.

Detailed Description

Definition at line 363 of file linkgraph.h.


Member Function Documentation

void LinkGraphSchedule::Run ( void *  j  )  [static]

Run all handlers for the given Job.

Parameters:
j Pointer to a link graph job.

Definition at line 354 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 400 of file linkgraph.cpp.

References running.

Referenced by AfterLoadLinkGraphs().


Friends And Related Function Documentation

const SaveLoad* GetLinkGraphScheduleDesc (  )  [friend]

Get a SaveLoad array for the link graph schedule.

Returns:
SaveLoad array for the link graph schedule.

Definition at line 87 of file linkgraph_sl.cpp.


The documentation for this class was generated from the following files: