libmoost
|
#include <skeleton.hpp>
Public Types | |
typedef CounterType | counter_type |
A policy needs to define the counter_type, which should generally be an integer type. | |
Public Member Functions | |
skeleton (std::ostream &out=std::cout) | |
Your policy should implement a constructor appropriate for its needs. | |
counter_type | operator+= (counter_type const incr) |
counter_type | operator++ () |
counter_type | operator++ (int) |
counter_type | count () const |
A policy should implement a count const method to return the current counter_type by **value**. | |
counter_type | expected_count () const |
Private Member Functions | |
void | animate () |
Private Attributes | |
counter_type | counter_ |
std::ostream & | out_ |
use one of the standard policies or roll your own if you wish! A policy can either be bounded to a count and used to display progress for that fixed window or it can be unbounded and just display some changing output to reassure the user something is actually happened and your application hasn't frozen during an intensive task. CounterType is the type that will be used for counter_type. Making this type a template parameter is strictly option; it can be hard coded into the policy if that is appropriate.
Definition at line 45 of file skeleton.hpp.
typedef CounterType moost::progress::policy::skeleton< CounterType >::counter_type |
A policy needs to define the counter_type, which should generally be an integer type.
Definition at line 49 of file skeleton.hpp.
moost::progress::policy::skeleton< CounterType >::skeleton | ( | std::ostream & | out = std::cout | ) | [inline] |
Your policy should implement a constructor appropriate for its needs.
Definition at line 52 of file skeleton.hpp.
void moost::progress::policy::skeleton< CounterType >::animate | ( | ) | [inline, private] |
counter_type moost::progress::policy::skeleton< CounterType >::count | ( | ) | const [inline] |
A policy should implement a count const method to return the current counter_type by **value**.
Definition at line 79 of file skeleton.hpp.
counter_type moost::progress::policy::skeleton< CounterType >::expected_count | ( | ) | const [inline] |
A policy should implement a expected_count const method to return the expected max value the counter should reach. If your policy has no concept of an expected count you can return whatever you like but in general best to return something sensible like 0, -1 or numeric_limits<counter_type>::max()
Definition at line 87 of file skeleton.hpp.
counter_type moost::progress::policy::skeleton< CounterType >::operator++ | ( | ) | [inline] |
A policy must implement pre and post increment operators that should return a counter_type by **value**. The value and meaning of the returned value are arbitrary but generally it should be the accumulative result of the calls to the pre and post increment operators.
Definition at line 66 of file skeleton.hpp.
counter_type moost::progress::policy::skeleton< CounterType >::operator++ | ( | int | ) | [inline] |
Definition at line 71 of file skeleton.hpp.
counter_type moost::progress::policy::skeleton< CounterType >::operator+= | ( | counter_type const | incr | ) | [inline] |
counter_type moost::progress::policy::skeleton< CounterType >::counter_ [private] |
Definition at line 101 of file skeleton.hpp.
std::ostream& moost::progress::policy::skeleton< CounterType >::out_ [private] |
Definition at line 102 of file skeleton.hpp.