OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimProcessInterface.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*************************************************************************
11 // $Id: ossimProcessInterface.cpp 9094 2006-06-13 19:12:40Z dburken $
12 
13 #include <ostream>
14 
17 
18 RTTI_DEF(ossimProcessInterface, "ossimProcessInterface");
19 
21  :thePercentComplete(0.0),
22  theProcessStatus(PROCESS_STATUS_NOT_EXECUTING),
23  theMessage(""),
24  theEventFlag(true)
25 {
26 }
27 
29 {
30 }
31 
33 {
35  {
37  }
38 }
39 
41 {
42  return ( isAborted()|| isAbortRequested() );
43 }
44 
46 {
48 }
49 
51 {
53 }
54 
56 {
59 }
60 
62 {
63  return theProcessStatus;
64 }
65 
67 {
68  theProcessStatus = processStatus;
69 }
70 
72 {
73  return thePercentComplete;
74 }
75 
76 void ossimProcessInterface::setPercentComplete(double percentComplete)
77 {
78  thePercentComplete = percentComplete;
79 
80  ossimListenerManager* manager = getManager();
81  if(theEventFlag&&manager)
82  {
85  theMessage,
86  false);
87  manager->fireEvent(event);
88  }
89 }
90 
92 {
94 }
95 
97 {
98  theEventFlag = true;
99 }
100 
102 {
103  theEventFlag = false;
104 }
105 
107 {
108  theMessage = message;
109 
110  ossimListenerManager* manager = getManager();
111  if(theEventFlag&&manager)
112  {
115  theMessage,
116  true);
117  manager->fireEvent(event);
118  }
119 }
120 
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 }
140 
142 {
143  return data.print(out);
144 }
virtual ossimListenerManager * getManager()
std::ostream & operator<<(std::ostream &out, const ossimProcessInterface &data)
virtual void setPercentComplete(double percentComplete)
virtual void setProcessStatus(ossimProcessStatus processStatus)
virtual void fireEvent(ossimEvent &event)
virtual double getPercentComplete() const
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ossimProcessStatus theProcessStatus
ossimProcessStatus getProcessStatus() const
virtual ossimObject * getObject()=0
virtual std::ostream & print(std::ostream &out) const
RTTI_DEF(ossimProcessInterface, "ossimProcessInterface")
void setCurrentMessage(const ossimString &message)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23