OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
This is the job callback interface It allows one to attach and listen for different states of the job and if properties have changed. More...
#include <ossimJob.h>
Public Types | |
enum | State { ossimJob_NONE = 0, ossimJob_READY = 1, ossimJob_RUNNING = 2, ossimJob_CANCEL = 4, ossimJob_FINISHED = 8, ossimJob_ALL = (ossimJob_READY|ossimJob_RUNNING|ossimJob_CANCEL|ossimJob_FINISHED) } |
This is a Bit vector. More... | |
typedef std::list< std::shared_ptr< ossimJob > > | List |
Public Member Functions | |
ossimJob () | |
virtual void | start () |
Main entry point to the job. More... | |
std::shared_ptr< ossimJob > | getSharedFromThis () |
This is a convenience method to get the shared representation of this pointer. More... | |
std::shared_ptr< const ossimJob > | getSharedFromThis () const |
This is a convenience method to get the shared representation of this pointer. More... | |
void | setPercentComplete (double value) |
When the pernet complete is set for the job it will call any callbacks and nofity percentCompleteChanged. More... | |
void | setPriority (double value) |
sets the priority of the job More... | |
double | priority () const |
virtual void | release () |
If derived interfaces implement a block this will allow one to release. More... | |
State | state () const |
virtual void | resetState (int value) |
Will clear out the state and the call setState. More... | |
virtual void | setState (int value, bool on=true) |
Will allow you to set the state of the job. More... | |
bool | isCanceled () const |
virtual void | cancel () |
Sets the state if the object as cancelled. More... | |
virtual void | ready () |
Sets the state if the object as ready. More... | |
virtual void | running () |
Sets the state if the object as running. More... | |
virtual void | finished () |
Sets the state if the object as finished. More... | |
bool | isReady () const |
bool | isStopped () const |
bool | isFinished () const |
bool | isRunning () const |
void | setCallback (std::shared_ptr< ossimJobCallback > callback) |
void | setName (const ossimString &value) |
Sets the name of a job. More... | |
const ossimString & | name () const |
void | setId (const ossimString &value) |
const ossimString & | id () const |
void | setDescription (const ossimString &value) |
const ossimString & | description () const |
std::shared_ptr< ossimJobCallback > | callback () |
Protected Member Functions | |
virtual void | run ()=0 |
Abstract method and must be overriden by the base class. More... | |
Protected Attributes | |
std::mutex | m_jobMutex |
ossimString | m_name |
ossimString | m_description |
ossimString | m_id |
State | m_state |
double | m_priority |
std::shared_ptr< ossimJobCallback > | m_callback |
This is the job callback interface It allows one to attach and listen for different states of the job and if properties have changed.
Definition at line 149 of file ossimJob.h.
typedef std::list<std::shared_ptr<ossimJob> > ossimJob::List |
Definition at line 152 of file ossimJob.h.
enum ossimJob::State |
This is a Bit vector.
The only value that can be assigned as both active is FINISHED and CANCEL. CANCELED job may not yet be finished. Once the job is finished the Cancel is complete
Enumerator | |
---|---|
ossimJob_NONE | |
ossimJob_READY | |
ossimJob_RUNNING | |
ossimJob_CANCEL | |
ossimJob_FINISHED | |
ossimJob_ALL |
Definition at line 158 of file ossimJob.h.
|
inline |
Definition at line 168 of file ossimJob.h.
|
inline |
|
inlinevirtual |
Sets the state if the object as cancelled.
Definition at line 291 of file ossimJob.h.
|
inline |
|
inlinevirtual |
Sets the state if the object as finished.
Definition at line 316 of file ossimJob.h.
Referenced by ossimMultiThreadSequencer::ossimGetTileJob::run().
|
inline |
This is a convenience method to get the shared representation of this pointer.
Definition at line 185 of file ossimJob.h.
Referenced by setState().
|
inline |
This is a convenience method to get the shared representation of this pointer.
Definition at line 195 of file ossimJob.h.
|
inline |
Definition at line 428 of file ossimJob.h.
|
inline |
Definition at line 282 of file ossimJob.h.
|
inline |
Definition at line 350 of file ossimJob.h.
|
inline |
Definition at line 332 of file ossimJob.h.
|
inline |
Definition at line 359 of file ossimJob.h.
|
inline |
Definition at line 341 of file ossimJob.h.
|
inline |
|
inline |
Definition at line 228 of file ossimJob.h.
|
inlinevirtual |
Sets the state if the object as ready.
Definition at line 300 of file ossimJob.h.
|
inlinevirtual |
If derived interfaces implement a block this will allow one to release.
Derived classes must override.
Definition at line 237 of file ossimJob.h.
|
inlinevirtual |
Will clear out the state and the call setState.
value | is the state you wish to reset to |
Definition at line 253 of file ossimJob.h.
|
protectedpure virtual |
Abstract method and must be overriden by the base class.
The base ossimJob will call run from the start method after setting some variables.
Implemented in ossimFileWalker::ossimFileWalkerJob, RadialProcessorJob, SectorProcessorJob, ossimHlzTool::PatchProcessorJob, and ossimMultiThreadSequencer::ossimGetTileJob.
Referenced by start().
|
inlinevirtual |
Sets the state if the object as running.
Definition at line 308 of file ossimJob.h.
Referenced by ossimMultiThreadSequencer::ossimGetTileJob::run().
|
inline |
callback | callback used to call different state of a job |
Definition at line 368 of file ossimJob.h.
|
inline |
Definition at line 437 of file ossimJob.h.
|
inline |
Definition at line 409 of file ossimJob.h.
|
inline |
Sets the name of a job.
value | the name of the job |
Definition at line 379 of file ossimJob.h.
|
inline |
When the pernet complete is set for the job it will call any callbacks and nofity percentCompleteChanged.
percent complete
Definition at line 205 of file ossimJob.h.
|
inline |
sets the priority of the job
value | priority value |
Definition at line 219 of file ossimJob.h.
|
virtual |
Will allow you to set the state of the job.
value | is the state you wish to set to |
on | will turn the value on if on is true and turn it off otherwise. |
Definition at line 14 of file ossimJob.cpp.
References callback(), getSharedFromThis(), m_callback, m_jobMutex, m_state, ossimJob_ALL, ossimJob_CANCEL, ossimJob_FINISHED, ossimJob_READY, and ossimJob_RUNNING.
Referenced by start().
|
virtual |
Main entry point to the job.
It will set the state as running and then call the pure virtual method run. Once completed the job is marked finished only if the job was not canceled.
Classes must override the run method.
Definition at line 4 of file ossimJob.cpp.
References ossimJob_CANCEL, ossimJob_FINISHED, ossimJob_RUNNING, run(), setState(), and state().
|
inline |
|
protected |
Definition at line 474 of file ossimJob.h.
Referenced by setState().
|
protected |
Definition at line 470 of file ossimJob.h.
|
protected |
Definition at line 471 of file ossimJob.h.
|
mutableprotected |
Definition at line 468 of file ossimJob.h.
Referenced by setState().
|
protected |
Definition at line 469 of file ossimJob.h.
|
protected |
Definition at line 473 of file ossimJob.h.
|
protected |
Definition at line 472 of file ossimJob.h.
Referenced by setState().