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

#include <ossimProcessInterface.h>

Inheritance diagram for ossimProcessInterface:
ossimAtbController ossimChipProcTool ossimEquationUtil ossimHistogramWriter ossimImageFileWriter ossimImageHistogramSource ossimMetadataFileWriter ossimOverviewBuilderBase ossimVertexExtractor

Public Types

enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 

Public Member Functions

 ossimProcessInterface ()
 
virtual ~ossimProcessInterface ()
 
virtual ossimObjectgetObject ()=0
 
virtual const ossimObjectgetObject () const =0
 
virtual bool execute ()=0
 
virtual void abort ()
 
bool needsAborting () const
 
bool isAbortRequested () const
 
bool isAborted () const
 
bool isExecuting () const
 
ossimProcessStatus getProcessStatus () const
 
virtual void setProcessStatus (ossimProcessStatus processStatus)
 
virtual double getPercentComplete () const
 
virtual void setPercentComplete (double percentComplete)
 
virtual ossimListenerManagergetManager ()
 
void enableEvents ()
 
void disableEvents ()
 
void setCurrentMessage (const ossimString &message)
 
virtual std::ostream & print (std::ostream &out) const
 

Protected Attributes

double thePercentComplete
 
ossimProcessStatus theProcessStatus
 
ossimString theMessage
 
bool theEventFlag
 

Friends

OSSIM_DLL std::ostream & operator<< (std::ostream &out, const ossimProcessInterface &data)
 

Detailed Description

Definition at line 21 of file ossimProcessInterface.h.

Member Enumeration Documentation

◆ ossimProcessStatus

Constructor & Destructor Documentation

◆ ossimProcessInterface()

ossimProcessInterface::ossimProcessInterface ( )

◆ ~ossimProcessInterface()

ossimProcessInterface::~ossimProcessInterface ( )
virtual

Definition at line 28 of file ossimProcessInterface.cpp.

29 {
30 }

Member Function Documentation

◆ abort()

void ossimProcessInterface::abort ( )
virtual

◆ disableEvents()

void ossimProcessInterface::disableEvents ( )

Definition at line 101 of file ossimProcessInterface.cpp.

References theEventFlag.

102 {
103  theEventFlag = false;
104 }

◆ enableEvents()

void ossimProcessInterface::enableEvents ( )

Definition at line 96 of file ossimProcessInterface.cpp.

References theEventFlag.

97 {
98  theEventFlag = true;
99 }

◆ execute()

virtual bool ossimProcessInterface::execute ( )
pure virtual

◆ getManager()

ossimListenerManager * ossimProcessInterface::getManager ( )
virtual

Reimplemented in ossimChipProcTool, and ossimEquationUtil.

Definition at line 91 of file ossimProcessInterface.cpp.

References getObject(), and PTR_CAST.

Referenced by setCurrentMessage(), and setPercentComplete().

92 {
94 }
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossimObject * getObject()=0

◆ getObject() [1/2]

virtual ossimObject* ossimProcessInterface::getObject ( )
pure virtual

◆ getObject() [2/2]

virtual const ossimObject* ossimProcessInterface::getObject ( ) const
pure virtual

◆ getPercentComplete()

double ossimProcessInterface::getPercentComplete ( ) const
virtual

Definition at line 71 of file ossimProcessInterface.cpp.

References thePercentComplete.

72 {
73  return thePercentComplete;
74 }

◆ getProcessStatus()

ossimProcessInterface::ossimProcessStatus ossimProcessInterface::getProcessStatus ( ) const

Definition at line 61 of file ossimProcessInterface.cpp.

References theProcessStatus.

62 {
63  return theProcessStatus;
64 }
ossimProcessStatus theProcessStatus

◆ isAborted()

bool ossimProcessInterface::isAborted ( ) const

◆ isAbortRequested()

bool ossimProcessInterface::isAbortRequested ( ) const

◆ isExecuting()

bool ossimProcessInterface::isExecuting ( ) const

◆ needsAborting()

bool ossimProcessInterface::needsAborting ( ) const

◆ print()

std::ostream & ossimProcessInterface::print ( std::ostream &  out) const
virtual

Called by friend operator<< function, derived classes should override if something different is desired.

Reimplemented in ossimGdalOverviewBuilder, and ossimKakaduNitfOverviewBuilder.

Definition at line 121 of file ossimProcessInterface.cpp.

References PROCESS_STATUS_ABORTED, PROCESS_STATUS_EXECUTING, PROCESS_STATUS_NOT_EXECUTING, thePercentComplete, and theProcessStatus.

Referenced by operator<<().

122 {
123  out << "process status: ";
125  {
126  out << "executing" << std::endl;
127  }
129  {
130  out << "aborted" << std::endl;
131  }
133  {
134  out << "not executing" << std::endl;
135  }
136  out << "percent_complete: " << thePercentComplete;
137 
138  return out;
139 }
ossimProcessStatus theProcessStatus

◆ setCurrentMessage()

void ossimProcessInterface::setCurrentMessage ( const ossimString message)

Definition at line 106 of file ossimProcessInterface.cpp.

References ossimListenerManager::fireEvent(), getManager(), getObject(), theEventFlag, theMessage, and thePercentComplete.

Referenced by ossimHistogramWriter::processProgressEvent().

107 {
108  theMessage = message;
109 
110  ossimListenerManager* manager = getManager();
111  if(theEventFlag&&manager)
112  {
115  theMessage,
116  true);
117  manager->fireEvent(event);
118  }
119 }
virtual ossimListenerManager * getManager()
virtual void fireEvent(ossimEvent &event)
virtual ossimObject * getObject()=0

◆ setPercentComplete()

void ossimProcessInterface::setPercentComplete ( double  percentComplete)
virtual

Reimplemented in ossimImageFileWriter, ossimVertexExtractor, and ossimMetadataFileWriter.

Definition at line 76 of file ossimProcessInterface.cpp.

References ossimListenerManager::fireEvent(), getManager(), getObject(), theEventFlag, theMessage, and thePercentComplete.

Referenced by ossimImageHistogramSource::computeFastModeHistogram(), ossimHlzTool::computeHLZ(), ossimImageHistogramSource::computeNormalModeHistogram(), ossimHistogramWriter::processProgressEvent(), ossimMetadataFileWriter::setPercentComplete(), ossimVertexExtractor::setPercentComplete(), and ossimImageFileWriter::setPercentComplete().

77 {
78  thePercentComplete = percentComplete;
79 
80  ossimListenerManager* manager = getManager();
81  if(theEventFlag&&manager)
82  {
85  theMessage,
86  false);
87  manager->fireEvent(event);
88  }
89 }
virtual ossimListenerManager * getManager()
virtual void fireEvent(ossimEvent &event)
virtual ossimObject * getObject()=0

◆ setProcessStatus()

void ossimProcessInterface::setProcessStatus ( ossimProcessStatus  processStatus)
virtual

Definition at line 66 of file ossimProcessInterface.cpp.

References theProcessStatus.

Referenced by abort(), ossimHistogramWriter::abort(), and ossimImageHistogramSource::execute().

67 {
68  theProcessStatus = processStatus;
69 }
ossimProcessStatus theProcessStatus

Friends And Related Function Documentation

◆ operator<<

OSSIM_DLL std::ostream& operator<< ( std::ostream &  out,
const ossimProcessInterface data 
)
friend

Definition at line 141 of file ossimProcessInterface.cpp.

142 {
143  return data.print(out);
144 }
virtual std::ostream & print(std::ostream &out) const

Member Data Documentation

◆ theEventFlag

bool ossimProcessInterface::theEventFlag
protected

◆ theMessage

ossimString ossimProcessInterface::theMessage
protected

Definition at line 80 of file ossimProcessInterface.h.

Referenced by setCurrentMessage(), and setPercentComplete().

◆ thePercentComplete

double ossimProcessInterface::thePercentComplete
protected

◆ theProcessStatus

ossimProcessStatus ossimProcessInterface::theProcessStatus
protected

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