A job to be executed on a link graph component. More...
#include <linkgraph.h>
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 | |
ThreadObject * | thread |
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. |
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.
LinkGraphJob::LinkGraphJob | ( | const LinkGraphJob & | other | ) | [inline, private] |
Private Copy-Constructor: there cannot be two identical LinkGraphJobs.
other | hypothetical other job to be copied. |
Definition at line 246 of file linkgraph.h.
static void LinkGraphJob::AddHandler | ( | ComponentHandler * | handler | ) | [inline, static] |
Add a handler to the end of the list.
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.
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().
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().