Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::GeoProgress

    └>Geo::IGeoProgressProxy

Helper class to manage an IGeoProgressProxy.

Task that take a long time to complete should use an instance of this class to inform clients (through the IGeoProgressProxy interface) of the current progress. Notes on usage: a GeoProgress represents an interval of the total amount of work done. It can be split into bits using CreateSubProgress: it is normally convenient to do this when calling the subfunction.

All the splits retain pointers to the same float giving the overall progress, so any can be interrogated.

Creating a subprogress automatically sets the elapsed progress to the start of that interval. But deleting it doesn't set it to the end - unfortunately we have temporaries that get deleted, so it is a useful convention to call SetProportionDone(1.0f) at the end of progress-tracking functions.

Note that progress is always in the range 0 <= progress <= 1.

Functions

NameDescription
~IGeoProgressProxy()

Virtual destructor.

CreateProgress()

Create a progress object updates nothing.

CreateProgress(IGeoProgressProxy *)

Create a progress object that will use this proxy.

CreateSubProgress(float, float)

Create a subinterval of the current progress.

CreateSubProgress(float, float, const void *)

Create a subinterval of the current progress.

GeoProgress()

Constructor.

GetState()

Gets/sets user-defined state information.

ReportError(const GeoError &)

Forwards errors to the underlying proxy.

ReportError(const GeoError &)

Called when an error (or warning) is encountered by the task.

SetProgressString(const char *)

Set message.

SetProgressString(const char *)

Called by progress tracked tasks to inform clients of the current (sub) task.

SetProportionDone(float)

Set proportion of the current function's task done.

SetProportionDone(float)

Called when a further chunk of work has been performed on the current (sub) task.

SetState(const void *)

Gets/sets user-defined state information.

ShouldCancel()

Should we cancel?

ShouldCancel()

Request a cancel of the current task.


Anchor
a4e3ad0ec17ba51e001e79989f210d511
a4e3ad0ec17ba51e001e79989f210d511

virtual Geo::IGeoProgressProxy::~IGeoProgressProxy

...

protected: virtual ~IGeoProgressProxy()

...

Virtual destructor.


Anchor
a3b657cefdd57ee25e631055c151ec3bd
a3b657cefdd57ee25e631055c151ec3bd

static GeoProgress Geo::GeoProgress::CreateProgress

...

public: GeoProgress CreateProgress()

...

Create a progress object updates nothing.


Anchor
a2f28dea5cb000dc5f1615629f7bc3924
a2f28dea5cb000dc5f1615629f7bc3924

static GeoProgress Geo::GeoProgress::CreateProgress

...

public: GeoProgress CreateProgress
(
    IGeoProgressProxy * proxy
)

...

Create a progress object that will use this proxy.

Parameters
[in]proxy

- The progress proxy to update via this progress object.


Anchor
ab738746fb9443baee29f477c0241bddb
ab738746fb9443baee29f477c0241bddb

GeoProgress Geo::GeoProgress::CreateSubProgress

...

public: GeoProgress CreateSubProgress
(
    float start,
    float end
)

...

Create a subinterval of the current progress.

Start and end are proportions of the current function's time interval. Start and end must be in 0->1. Optionally takes state information to store in the subprogress object.


Anchor
a02d5a058325f2c4d600d99fc2583efb2
a02d5a058325f2c4d600d99fc2583efb2

GeoProgress Geo::GeoProgress::CreateSubProgress

...

public: GeoProgress CreateSubProgress
(
    float start,
    float end,
    const void * state
)

...

Create a subinterval of the current progress.

Start and end are proportions of the current function's time interval. Start and end must be in 0->1. Optionally takes state information to store in the subprogress object.


Anchor
a0c503fe91bcc25b50d5f244886a80ad6
a0c503fe91bcc25b50d5f244886a80ad6

Geo::GeoProgress::GeoProgress

...

public: GeoProgress()

...

Constructor.


Anchor
a13f1de0d50a0a433bb589be9c7849972
a13f1de0d50a0a433bb589be9c7849972

const void* Geo::GeoProgress::GetState

...

public: const void * GetState() const

...

Gets/sets user-defined state information.

This can be used to pass error-reporting information (e.g. the ID of the object being processed) to lower-level functions.


Anchor
a67aae44a3ada410b1bffdd45624d3895
a67aae44a3ada410b1bffdd45624d3895

virtual void Geo::GeoProgress::ReportError

...

public: virtual void ReportError
(
    const GeoError & error
)

...

Forwards errors to the underlying proxy.


Anchor
ae7db84009b2e1d0ef00ee90aac297140
ae7db84009b2e1d0ef00ee90aac297140

virtual void Geo::IGeoProgressProxy::ReportError

...

public: void ReportError
(
    const GeoError & error
)

...

Called when an error (or warning) is encountered by the task.

Details of the error can be found in the Error struct. The Error struct is valid only for the lifetime of the call to ReportError and cannot be copied.


Anchor
adde78cb50d9c841ecb636cb2c7c6315f
adde78cb50d9c841ecb636cb2c7c6315f

virtual void Geo::GeoProgress::SetProgressString

...

public: virtual void SetProgressString
(
    const char * desc
)

...

Set message.


Anchor
af2e5bf1ba55e08530df795a0bb060fcd
af2e5bf1ba55e08530df795a0bb060fcd

virtual void Geo::IGeoProgressProxy::SetProgressString

...

public: void SetProgressString
(
    const char * desc
)

...

Called by progress tracked tasks to inform clients of the current (sub) task.


Anchor
a65615a641dda41fc68b582e0e5607828
a65615a641dda41fc68b582e0e5607828

virtual void Geo::GeoProgress::SetProportionDone

...

public: virtual void SetProportionDone
(
    float localProgress
)

...

Set proportion of the current function's task done.


Anchor
a03de98aa9da2249160ef2cba25553b6e
a03de98aa9da2249160ef2cba25553b6e

virtual void Geo::IGeoProgressProxy::SetProportionDone

...

public: void SetProportionDone
(
    float globalProgress
)

...

Called when a further chunk of work has been performed on the current (sub) task.

Parameters
[in]globalProgress

The total percentage of work completed on this task [0,1].


Anchor
aeb3de91a9554336432a0b93186b25ac6
aeb3de91a9554336432a0b93186b25ac6

void Geo::GeoProgress::SetState

...

public: void SetState
(
    const void * state
)

...

Gets/sets user-defined state information.

This can be used to pass error-reporting information (e.g. the ID of the object being processed) to lower-level functions.


Anchor
aef41fc50a9a8466403b8f16bba961847
aef41fc50a9a8466403b8f16bba961847

virtual bool Geo::GeoProgress::ShouldCancel

...

public: virtual bool ShouldCancel()

...

Should we cancel?


Anchor
abe8cf09a3e673d6a191209f50d2655cb
abe8cf09a3e673d6a191209f50d2655cb

virtual bool Geo::IGeoProgressProxy::ShouldCancel

...

public: bool ShouldCancel()

...

Request a cancel of the current task.

This function will be called periodically by progress tracked tasks. Use this opportunity to request a halt to the current task.