osgEarth 2.1.1
Public Member Functions | Protected Attributes

osgEarth::ProgressCallback Class Reference

Inheritance diagram for osgEarth::ProgressCallback:
Collaboration diagram for osgEarth::ProgressCallback:

List of all members.

Public Member Functions

 ProgressCallback ()
virtual ~ProgressCallback ()
virtual bool reportProgress (double current, double total, const std::string &msg=std::string())
virtual void onStarted ()
virtual void onCompleted ()
void cancel ()
bool isCanceled () const
std::string & message ()
bool needsRetry () const
void setNeedsRetry (bool needsRetry)

Protected Attributes

volatile bool _canceled
std::string _message
volatile bool _needsRetry

Detailed Description

ProgressCallback is a general purpose interface for functions that need to report progress.

Definition at line 30 of file Progress.


Constructor & Destructor Documentation

ProgressCallback::ProgressCallback ( )

Creates a new ProgressCallback

Definition at line 26 of file Progress.cpp.

                                   :
osg::Referenced( true ),
_canceled(false),
_needsRetry(false)
{
    //NOP
}
virtual osgEarth::ProgressCallback::~ProgressCallback ( ) [inline, virtual]

Definition at line 37 of file Progress.

{ }

Member Function Documentation

void osgEarth::ProgressCallback::cancel ( ) [inline]

Definition at line 58 of file Progress.

{ _canceled = true; }
bool osgEarth::ProgressCallback::isCanceled ( ) const [inline]

Definition at line 59 of file Progress.

{ return _canceled; }

Here is the caller graph for this function:

std::string& osgEarth::ProgressCallback::message ( ) [inline]

Definition at line 61 of file Progress.

{ return _message; }
bool osgEarth::ProgressCallback::needsRetry ( ) const [inline]

Whether or not the task should be retried.

Definition at line 66 of file Progress.

{ return _needsRetry;}

Here is the caller graph for this function:

virtual void osgEarth::ProgressCallback::onCompleted ( ) [inline, virtual]

Definition at line 56 of file Progress.

{ }
virtual void osgEarth::ProgressCallback::onStarted ( ) [inline, virtual]

Definition at line 53 of file Progress.

{ }
bool ProgressCallback::reportProgress ( double  current,
double  total,
const std::string &  msg = std::string() 
) [virtual]

Callback function that will be called.

Parameters:
currentThe current amount of work to be done.
totalThe total amount of work to be done.
msgDescription of what is being done. Useful when total is unknown.
returnsReturns true if the current task should be cancelled, false otherwise.

Reimplemented in osgEarth::ConsoleProgressCallback.

Definition at line 34 of file Progress.cpp.

{
    return false;
}

Here is the caller graph for this function:

void osgEarth::ProgressCallback::setNeedsRetry ( bool  needsRetry) [inline]

Sets whether or not the task should be retried

Definition at line 70 of file Progress.

Here is the caller graph for this function:


Member Data Documentation

volatile bool osgEarth::ProgressCallback::_canceled [protected]

Definition at line 73 of file Progress.

std::string osgEarth::ProgressCallback::_message [protected]

Definition at line 74 of file Progress.

volatile bool osgEarth::ProgressCallback::_needsRetry [protected]

Definition at line 75 of file Progress.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines