UserMetricsInput::Metric
QObject
libusermetricsinput/Metric.h
UserMetricsInput::Metric::Metric
(QObject *parent=0)
Metric
UserMetricsInput::Metric::Metric
QObject * parent 0

This constructor cannot be used - the class is pure-virtual.

virtual UserMetricsInput::Metric::~Metric
()
~Metric
UserMetricsInput::Metric::~Metric

Destructor.

MetricUpdate * virtual MetricUpdate * UserMetricsInput::Metric::update (const QString &username="")=0 update UserMetricsInput::Metric::update const QString & username ""

Create an MetricUpdate to a particular Metric.

username

The user to update the data for. If blank ("") or omitted then the current user is used.

The MetricUpdate object must be deleted - this is when the actual update will be sent to the storage service.
void virtual void UserMetricsInput::Metric::update (double value, const QString &username="")=0 update UserMetricsInput::Metric::update double value const QString & username ""

Update the "today" value for a simple user metric.

value

Today's value

username

The user to update the data for. If blank ("") or omitted then the current user is used.

void virtual void UserMetricsInput::Metric::increment (double amount=1.0f, const QString &username="")=0 increment UserMetricsInput::Metric::increment double amount 1.0f const QString & username ""

Increment the "today" value for a simple user metric.

amount

How much to increase the metric by - defaults to 1.

username

The user to update the data for. If blank ("") or omitted then the current user is used.

This class represents a single user metric.

For example, "number of e-mails today" or "photos taken today".

This is a long-lived class that can exist for the whole application lifecycle.

QObject
UserMetricsInput::Metric
QObject
UserMetricsInput::Metric
- UserMetricsInput::Metric
  increment
- UserMetricsInput::Metric
  Metric
- UserMetricsInput::Metric
  update
- UserMetricsInput::Metric
  update
- UserMetricsInput::Metric
  ~Metric