libusermetrics
|
Central place for registering and updating user metrics. More...
#include <libusermetricsinput/MetricManager.h>
Public Member Functions | |
MetricManager (QObject *parent=0) | |
You cannot use this constructor. This is a pure-virtual class. More... | |
virtual | ~MetricManager () |
Destructs the metric manager and associated Metric instances. More... | |
virtual MetricPtr | add (const QString &dataSourceId, const QString &formatString, const QString &emptyDataString="", const QString &textDomain="")=0 |
Register a new Metric. More... | |
virtual MetricPtr | add (const MetricParameters ¶meters)=0 |
Register a new Metric. More... | |
Static Public Member Functions | |
static MetricManager * | getInstance () |
Gets a new instance of the MetricManager. More... | |
Central place for registering and updating user metrics.
This is a long-lived class that can exist for the whole application lifecycle.
|
explicit |
You cannot use this constructor. This is a pure-virtual class.
|
virtual |
Destructs the metric manager and associated Metric instances.
|
pure virtual |
|
pure virtual |
Register a new Metric.
dataSourceId | The unique ID of the data source, e.g. "facebook" |
formatString | The string to print in the output API, e.g. "<b>%1</b> messages received today" |
emptyDataString | The string to print in the case of no data, e.g. "No messages received today" |
textDomain | The translation domain |
This will register a new user Metric with the above parameters. It is acceptable to call this method more than once. The same Metric instance will be returned.
|
static |
Gets a new instance of the MetricManager.
If you want a singleton instance then hold onto this.