Central place for registering and updating user metrics.
More...
#include <libusermetricsinput/MetricManager.h>
|
| MetricManager (QObject *parent=0) |
| You cannot use this constructor. This is a pure-virtual class.
|
|
virtual | ~MetricManager () |
| Destructs the metric manager and associated Metric instances.
|
|
virtual MetricPtr | add (const QString &dataSourceId, const QString &formatString, const QString &emptyDataString="", const QString &textDomain="")=0 |
| Register a new Metric.
|
|
virtual MetricPtr | add (const MetricParameters ¶meters)=0 |
| Register a new Metric.
|
|
Central place for registering and updating user metrics.
This is a long-lived class that can exist for the whole application lifecycle.
◆ MetricManager()
UserMetricsInput::MetricManager::MetricManager |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
You cannot use this constructor. This is a pure-virtual class.
◆ ~MetricManager()
virtual UserMetricsInput::MetricManager::~MetricManager |
( |
| ) |
|
|
virtual |
Destructs the metric manager and associated Metric instances.
◆ add() [1/2]
Register a new Metric.
- Parameters
-
parameters | The parameters of the Metric to register |
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.
◆ add() [2/2]
virtual MetricPtr UserMetricsInput::MetricManager::add |
( |
const QString & |
dataSourceId, |
|
|
const QString & |
formatString, |
|
|
const QString & |
emptyDataString = "" , |
|
|
const QString & |
textDomain = "" |
|
) |
| |
|
pure virtual |
Register a new Metric.
- Parameters
-
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.
◆ getInstance()
static MetricManager * UserMetricsInput::MetricManager::getInstance |
( |
| ) |
|
|
static |
Gets a new instance of the MetricManager.
If you want a singleton instance then hold onto this.
The documentation for this class was generated from the following file: