Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

QArmMetric Class Reference

Class representing ARM metrics. More...

#include <qarmmetric.h>

Inheritance diagram for QArmMetric:

QSimpleArmCounter QSimpleArmGauge QSimpleArmNumId List of all members.

Public Types

enum  QMetricType { COUNTER, GAUGE, ID }

Public Member Functions

 QArmMetric (const QString &_name, const QMetricType _type, const QArmAppDefinition *_app, const QString *_unit)
 ~QArmMetric ()
void setValue (qint64 _value)
qint64 getValue () const
const arm_id_t * getMetricId () const
void fill (armsdk_subbuffer_metric_values_t *_mv) const

Protected Member Functions

void registerMetric (const short slot)

Private Attributes

arm_metric_binding_t metric_binding
arm_metric_t metric
QMetricType m_Type
QString m_Name
QString m_Unit
const arm_id_t * m_AppId

Friends

class QArmMetricList

Detailed Description

Class representing ARM metrics.

Note:
Not all metric types provided with ARM are supported, but for most cases COUNTER, GAUGE and ID should fit well.

Definition at line 64 of file qarmmetric.h.


Member Enumeration Documentation

enum QArmMetric::QMetricType
 

Types of metrics.

Enumeration values:
COUNTER  A counter.
GAUGE  A gauge.
ID  An id.

Definition at line 68 of file qarmmetric.h.


Constructor & Destructor Documentation

QArmMetric::QArmMetric const QString &  _name,
const QMetricType  _type,
const QArmAppDefinition _app,
const QString *  _unit
 

Constructor of metric object.

Parameters:
_name Name of the metric (e.g. "Weight").
_type Type of metric.
_app application with which this metric will be registered.
_unit Unit of metric (e.g. "pound").

Definition at line 53 of file qarmmetric.cpp.

References QArmDefinition::getId(), m_AppId, m_Name, m_Type, and m_Unit.

QArmMetric::~QArmMetric  ) 
 

Destructor.

Definition at line 67 of file qarmmetric.cpp.


Member Function Documentation

void QArmMetric::fill armsdk_subbuffer_metric_values_t *  _mv  )  const
 

Fill the current metric value into the provided sub-buffer.

Parameters:
_mv Metric value sub-buffer to fill.

Definition at line 78 of file qarmmetric.cpp.

References COUNTER, GAUGE, ID, m_Type, and metric.

const arm_id_t * QArmMetric::getMetricId  )  const
 

Returns:
Get the metric binding id.

Definition at line 72 of file qarmmetric.cpp.

References metric_binding.

qint64 QArmMetric::getValue  )  const
 

get the value of the metric.

Definition at line 144 of file qarmmetric.cpp.

References COUNTER, GAUGE, ID, m_Type, and metric.

bool QArmMetric::isCounter  )  const [inline]
 

Returns:
true if metric is a counter.

Definition at line 161 of file qarmmetric.h.

References COUNTER, and m_Type.

bool QArmMetric::isGauge  )  const [inline]
 

Returns:
true if metric is a gauge.

Definition at line 165 of file qarmmetric.h.

References GAUGE, and m_Type.

bool QArmMetric::isId  )  const [inline]
 

Returns:
true if metric is a numeric ID.

Definition at line 169 of file qarmmetric.h.

References ID, and m_Type.

void QArmMetric::registerMetric const short  slot  )  [protected]
 

This method is called from QArmMetricList when a metric is appended to the list.

Parameters:
slot Slot number used for this metric.

Definition at line 106 of file qarmmetric.cpp.

References COUNTER, GAUGE, ID, m_AppId, m_Name, m_Type, m_Unit, metric, and metric_binding.

Referenced by QArmMetricList::append().

void QArmMetric::setValue qint64  _value  ) 
 

set the value of the metric.

Parameters:
_value The value of the metric

Definition at line 134 of file qarmmetric.cpp.

References COUNTER, GAUGE, ID, m_Type, and metric.


Friends And Related Function Documentation

friend class QArmMetricList [friend]
 

Since there exists a strict binding between metric values and metric definitions using the slot mechanism the QArmMetricList class provides the slot number. Therefore it needs to execute the registerMetric() method.

Definition at line 129 of file qarmmetric.h.


Member Data Documentation

const arm_id_t* QArmMetric::m_AppId [private]
 

The ID of the associated application.

Definition at line 157 of file qarmmetric.h.

Referenced by QArmMetric(), and registerMetric().

QString QArmMetric::m_Name [private]
 

The name of metric

Definition at line 149 of file qarmmetric.h.

Referenced by QArmMetric(), and registerMetric().

QMetricType QArmMetric::m_Type [private]
 

The type of metric

Definition at line 145 of file qarmmetric.h.

Referenced by fill(), getValue(), isCounter(), isGauge(), isId(), QArmMetric(), registerMetric(), and setValue().

QString QArmMetric::m_Unit [private]
 

The unit of metric

Definition at line 153 of file qarmmetric.h.

Referenced by QArmMetric(), and registerMetric().

arm_metric_t QArmMetric::metric [private]
 

Definition at line 141 of file qarmmetric.h.

Referenced by fill(), getValue(), registerMetric(), and setValue().

arm_metric_binding_t QArmMetric::metric_binding [private]
 

The structures needed within ARM to register and use metrics

Definition at line 140 of file qarmmetric.h.

Referenced by getMetricId(), and registerMetric().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 19:14:22 2005 for QArm API by  doxygen 1.4.2