| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iProgressMeter Struct Reference

This is a general interface for a progress meter. More...

`#include <ivaria/pmeter.h>`

Inheritance diagram for iProgressMeter:

[legend]
List of all members.

## Public Member Functions
virtual void | Abort ()=0
| Abort the meter.
virtual void | Finalize ()=0
| Finalize the meter (i.e. we completed the task sooner than expected).
virtual int | GetCurrent () const =0
| Get the current value of the meter (<= total).
virtual int | GetGranularity () const =0
| Get the refresh granularity.
virtual int | GetTotal () const =0
| Get the total element count represented by the meter.
virtual void | Reset ()=0
| Reset the meter to 0%.
virtual void | Restart ()=0
| Reset the meter and print the initial tick mark ("0%").
virtual void | SetGranularity (int)=0
| Set the refresh granularity.
virtual void | SetProgressDescription (const char *id, const char *description,...)=0
| Set the id and description of what we are currently monitoring.
virtual void | SetProgressDescriptionV (const char *id, const char *description, va_list)=0
| Set the id and description of what we are currently monitoring.
virtual void | SetTotal (int n)=0
| Set the total element count represented by the meter and perform a reset.
virtual void | Step (unsigned int n=1)=0
| Increment the meter by n units, default 1.

## Detailed Description

This is a general interface for a progress meter.

The engine needs an implementation of this to be able to report progress on calculating lighting and other stuff.

Definition at line 33 of file pmeter.h.

## Member Function Documentation

virtual void iProgressMeter::Abort | ( |  | ) | `[pure virtual]`

Abort the meter.

Implemented in csTextProgressMeter.

virtual void iProgressMeter::Finalize | ( |  | ) | `[pure virtual]`

Finalize the meter (i.e. we completed the task sooner than expected).

Implemented in csTextProgressMeter.

virtual int iProgressMeter::GetCurrent | ( |  | ) | const`[pure virtual]`

Get the current value of the meter (<= total).

Implemented in csTextProgressMeter.

virtual int iProgressMeter::GetGranularity | ( |  | ) | const`[pure virtual]`

Get the refresh granularity.

Implemented in csTextProgressMeter.

virtual int iProgressMeter::GetTotal | ( |  | ) | const`[pure virtual]`

Get the total element count represented by the meter.

Implemented in csTextProgressMeter.

virtual void iProgressMeter::Reset | ( |  | ) | `[pure virtual]`

Reset the meter to 0%.

Implemented in csTextProgressMeter.

virtual void iProgressMeter::Restart | ( |  | ) | `[pure virtual]`

Reset the meter and print the initial tick mark ("0%").

Implemented in csTextProgressMeter.

virtual void iProgressMeter::SetGranularity | ( | int |  | ) | `[pure virtual]`

Set the refresh granularity.

Valid values are 1-100, inclusive. Default is 10. The meter is only refreshed after each "granularity" * number of units have passed. For instance, if granularity is 20, then * the meter will only be updated at most 5 times, or every 20%.

Implemented in csTextProgressMeter.

virtual void iProgressMeter::SetProgressDescription | ( | const char * | id,
|  | const char * | description,
|  |  | ... |
| ) |  |  | `[pure virtual]`

Set the id and description of what we are currently monitoring.

An id can be something like "crystalspace.engine.lighting.calculation".

See also:
  Notes about string formatting in Crystal Space

Implemented in csTextProgressMeter.

virtual void iProgressMeter::SetProgressDescriptionV | ( | const char * | id,
|  | const char * | description,
|  | va_list |  |
| ) |  |  | `[pure virtual]`

Set the id and description of what we are currently monitoring.

An id can be something like "crystalspace.engine.lighting.calculation".

See also:
  Notes about string formatting in Crystal Space

Implemented in csTextProgressMeter.

virtual void iProgressMeter::SetTotal | ( | int | n | ) | `[pure virtual]`

Set the total element count represented by the meter and perform a reset.

Implemented in csTextProgressMeter.

virtual void iProgressMeter::Step | ( | unsigned int | n = `1` | ) | `[pure virtual]`

Increment the meter by n units, default 1.

If the meter reaches 100% it should automatically stop itself.

Implemented in csTextProgressMeter.

The documentation for this struct was generated from the following file:

- ivaria/pmeter.h