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

LinkGraphJob Class Reference

A job to be executed on a link graph component. More...

#include <linkgraph.h>

Inheritance diagram for LinkGraphJob:
LinkGraphComponent LinkGraph

Public Member Functions

 ~LinkGraphJob ()
 Destructor; Clean up the thread if it's there.
void SpawnThread ()
 Spawn a thread if possible and run the link graph job in the thread.
void Join ()
 Join the calling thread with this job's thread if threading is enabled.

Static Public Member Functions

static void RunLinkGraphJob (void *j)
 Run all handlers for the given Job.
static void AddHandler (ComponentHandler *handler)
 Add a handler to the end of the list.
static void ClearHandlers ()
 Clear the handlers.

Private Types

typedef std::list
< ComponentHandler * > 
HandlerList

Private Member Functions

 LinkGraphJob (const LinkGraphJob &other)
 Private Copy-Constructor: there cannot be two identical LinkGraphJobs.

Private Attributes

ThreadObjectthread
 Thread the job is running in or NULL if it's running in the main thread.

Static Private Attributes

static HandlerList _handlers
 Handlers the job is executing.

Detailed Description

A job to be executed on a link graph component.

It inherits a component and keeps a static list of handlers to be run on it. It may or may not run in a thread and contains a thread object for this option.

Definition at line 204 of file linkgraph.h.


Constructor & Destructor Documentation

LinkGraphJob::LinkGraphJob ( const LinkGraphJob other  )  [inline, private]

Private Copy-Constructor: there cannot be two identical LinkGraphJobs.

Parameters:
other hypothetical other job to be copied.
Note:
It's necessary to explicitly initialize the link graph component in order to silence some compile warnings.

Definition at line 246 of file linkgraph.h.


Member Function Documentation

static void LinkGraphJob::AddHandler ( ComponentHandler handler  )  [inline, static]

Add a handler to the end of the list.

Parameters:
handler Handler to be added.

Definition at line 226 of file linkgraph.h.

References _handlers.

Referenced by InitializeLinkGraphs().

void LinkGraphJob::RunLinkGraphJob ( void *  j  )  [static]

Run all handlers for the given Job.

Parameters:
j Pointer to a link graph job.

Definition at line 403 of file linkgraph.cpp.

References _handlers.

Referenced by SpawnThread().

void LinkGraphJob::SpawnThread (  ) 

Spawn a thread if possible and run the link graph job in the thread.

If that's not possible run the job right now in the current thread.

Definition at line 502 of file linkgraph.cpp.

References ThreadObject::New(), RunLinkGraphJob(), and thread.

Referenced by AfterLoadLinkGraphs(), and LinkGraph::CreateComponent().


Field Documentation

LinkGraphJob::HandlerList LinkGraphJob::_handlers [static, private]

Handlers the job is executing.

Handlers to be run for each job.

Definition at line 238 of file linkgraph.h.

Referenced by AddHandler(), ClearHandlers(), and RunLinkGraphJob().


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