|
pianod2
multisource multiuser scriptable networked music player
|
A class to average ratings. More...
#include <ratings.h>
Public Member Functions | |
| void | add (Rating rating) |
| Add mote data to the average. More... | |
| float | operator() (Rating default_value=Rating::UNRATED) |
| Return the average as a star-rating float. More... | |
| double | rating (Rating default_value=Rating::UNRATED) |
| Return the average as a rating-range double. More... | |
| unsigned | sum () const |
| Retrieve the sum of the ratings in the average. More... | |
| unsigned | items () const |
| Retrieve the number of items included in the average. More... | |
Private Attributes | |
| unsigned | count = 0 |
| Number of ratings being averaged. More... | |
| unsigned | total = 0 |
| Total of enumeration values being averaged. More... | |
A class to average ratings.
|
inline |
Add mote data to the average.
| rating | The rating to add. If UNRATED, the rating is ignored. |


|
inline |
Retrieve the number of items included in the average.

|
inline |
Return the average as a star-rating float.
| default_value | Value to return if no values were included in the average. |

|
inline |
Return the average as a rating-range double.
| default_value | Value to return if no values were included in the average. |

|
inline |
Retrieve the sum of the ratings in the average.

|
private |
Number of ratings being averaged.
|
private |
Total of enumeration values being averaged.