OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SectorProcessorJob Class Reference

For support of multithreading. More...

#include <ossimViewshedTool.h>

Inheritance diagram for SectorProcessorJob:
ossimJob

Public Member Functions

 SectorProcessorJob (ossimViewshedTool *vs_util, ossim_uint32 sector, ossim_uint32 numRadials)
 
- Public Member Functions inherited from ossimJob
 ossimJob ()
 
virtual void start ()
 Main entry point to the job. More...
 
std::shared_ptr< ossimJobgetSharedFromThis ()
 This is a convenience method to get the shared representation of this pointer. More...
 
std::shared_ptr< const ossimJobgetSharedFromThis () 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 ossimStringname () const
 
void setId (const ossimString &value)
 
const ossimStringid () const
 
void setDescription (const ossimString &value)
 
const ossimStringdescription () const
 
std::shared_ptr< ossimJobCallbackcallback ()
 

Protected Member Functions

virtual void run ()
 Abstract method and must be overriden by the base class. More...
 

Private Attributes

ossimViewshedToolm_vsUtil
 
ossim_uint32 m_sector
 
ossim_uint32 m_numRadials
 

Friends

class ossimViewshedTool
 

Additional Inherited Members

- Public Types inherited from ossimJob
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
 
- Protected Attributes inherited from ossimJob
std::mutex m_jobMutex
 
ossimString m_name
 
ossimString m_description
 
ossimString m_id
 
State m_state
 
double m_priority
 
std::shared_ptr< ossimJobCallbackm_callback
 

Detailed Description

For support of multithreading.

The –tbs option directs ossimViewshedUtil to create a thread for each sector (using the SectorProcessorJob). Otherwise, the threads are mapped to a single radial. There are 8 sectors total (45 deg each) so a max of 8 threads are launched. Thus it may be faster to use the RadialProcessorJob scheme (default) when the number of available cores > 8.

Definition at line 122 of file ossimViewshedTool.h.

Constructor & Destructor Documentation

◆ SectorProcessorJob()

SectorProcessorJob::SectorProcessorJob ( ossimViewshedTool vs_util,
ossim_uint32  sector,
ossim_uint32  numRadials 
)
inline

Definition at line 126 of file ossimViewshedTool.h.

127  : m_vsUtil (vs_util), m_sector (sector), m_numRadials (numRadials) {}
ossimViewshedTool * m_vsUtil
ossim_uint32 m_numRadials

Member Function Documentation

◆ run()

void SectorProcessorJob::run ( )
protectedvirtual

Abstract method and must be overriden by the base class.

The base ossimJob will call run from the start method after setting some variables.

Implements ossimJob.

Definition at line 890 of file ossimViewshedTool.cpp.

References RadialProcessor::doRadial(), m_numRadials, m_sector, and m_vsUtil.

891 {
892  // Loop over all the sector's radials and walk over each one.
893  for (ossim_uint32 r=0; r<=m_numRadials; ++r)
894  {
896  }
897 }
unsigned int ossim_uint32
ossimViewshedTool * m_vsUtil
static void doRadial(ossimViewshedTool *vs, ossim_uint32 s, ossim_uint32 r)
ossim_uint32 m_numRadials

Friends And Related Function Documentation

◆ ossimViewshedTool

friend class ossimViewshedTool
friend

Definition at line 124 of file ossimViewshedTool.h.

Member Data Documentation

◆ m_numRadials

ossim_uint32 SectorProcessorJob::m_numRadials
private

Definition at line 135 of file ossimViewshedTool.h.

Referenced by run().

◆ m_sector

ossim_uint32 SectorProcessorJob::m_sector
private

Definition at line 134 of file ossimViewshedTool.h.

Referenced by run().

◆ m_vsUtil

ossimViewshedTool* SectorProcessorJob::m_vsUtil
private

Definition at line 133 of file ossimViewshedTool.h.

Referenced by run().


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