QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HrvMessagePrivate Class Reference
Inheritance diagram for HrvMessagePrivate:
[legend]
Collaboration diagram for HrvMessagePrivate:
[legend]

Public Member Functions

 HrvMessagePrivate (HrvMessage *const q)
 
virtual ~HrvMessagePrivate ()
 
- Public Member Functions inherited from AbstractDataMessagePrivate
 AbstractDataMessagePrivate (AbstractDataMessage *const q)
 
virtual ~AbstractDataMessagePrivate ()
 
bool setFields (const DataDefinition *const defn, const QByteArray &record)
 

Public Attributes

quint16 time
 The HrvMessage FIT message's time field. More...
 
- Public Attributes inherited from AbstractDataMessagePrivate
MesgNum globalMessageNumber
 FIT Globla Message Number for this FIT Data Message.
 

Protected Member Functions

bool setField (const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
 
- Protected Member Functions inherited from AbstractDataMessagePrivate
bool verify (const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDataMessagePrivate
AbstractDataMessage *const q_ptr
 Internal q-pointer.
 

Detailed Description

The HrvMessagePrivate class provides private implementation for the HrvMessage.

See also
HrvMessage

Definition at line 38 of file hrvmessage_p.h.

Constructor & Destructor Documentation

◆ HrvMessagePrivate()

HrvMessagePrivate::HrvMessagePrivate ( HrvMessage *const  q)
explicit

Constructs a HrvMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 112 of file hrvmessage.cpp.

114  , time(0xFFFF)
115 {
116  globalMessageNumber = MesgNum::Hrv;
117 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint16 time
The HrvMessage FIT message's time field.
Definition: hrvmessage_p.h:46

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~HrvMessagePrivate()

HrvMessagePrivate::~HrvMessagePrivate ( )
virtual

Destroys the HrvMessagePrivate object.

Definition at line 124 of file hrvmessage.cpp.

125 {
126 
127 }

Member Function Documentation

◆ setField()

bool HrvMessagePrivate::setField ( const int  fieldId,
const QByteArray &  data,
const FitBaseType  baseType,
const bool  bigEndian 
)
overrideprotectedvirtual

Sets the value of the fieldId field.

Derived classes must implement this method to extract the baseType value from data, and assign the extracted value the fieldId field.

Parameters
fieldIdThe field number within the given FIT data message.
dataThe raw data to extract the field value from.
baseTypeThe FIT base type for the field.
bigEndianWhether or not multibyte values in record are big-endian.
Returns
true if the field was set, or safely ignored; false otherwise.

Implements AbstractDataMessagePrivate.

Definition at line 129 of file hrvmessage.cpp.

131 {
132  switch (fieldId) {
133  case 0: // See Profile.xlsx::Messages:hrv.time
134  if (!verify(data, baseType, 2, FitBaseType::Uint16, "hrv.time")) return false;
135  this->time = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
136  break;
137  default:
138  qWarning() << "ignoring unknown hrv message field number" << fieldId << bigEndian;
139  // Fall through to return true, as its still 'safe' to continue parsing data messages.
140  }
141  return true;
142 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ time

quint16 HrvMessagePrivate::time

The HrvMessage FIT message's time field.

Time between beats

Definition at line 46 of file hrvmessage_p.h.


The documentation for this class was generated from the following files: