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

Public Member Functions

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

Public Attributes

MessageIndex messageIndex
 The SegmentFileMessage FIT message's messageIndex field.
 
QString fileUuid
 The SegmentFileMessage FIT message's fileUuid field. More...
 
bool enabled
 The SegmentFileMessage FIT message's enabled field. More...
 
quint32 userProfilePrimaryKey
 The SegmentFileMessage FIT message's userProfilePrimaryKey field. More...
 
SegmentLeaderboardType leaderType
 The SegmentFileMessage FIT message's leaderType field. More...
 
quint32 leaderGroupPrimaryKey
 The SegmentFileMessage FIT message's leaderGroupPrimaryKey field. More...
 
quint32 leaderActivityId
 The SegmentFileMessage FIT message's leaderActivityId field. More...
 
QString leaderActivityIdString
 The SegmentFileMessage FIT message's leaderActivityIdString field. More...
 
quint8 defaultRaceLeader
 The SegmentFileMessage FIT message's defaultRaceLeader 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 SegmentFileMessagePrivate class provides private implementation for the SegmentFileMessage.

See also
SegmentFileMessage

Definition at line 38 of file segmentfilemessage_p.h.

Constructor & Destructor Documentation

◆ SegmentFileMessagePrivate()

SegmentFileMessagePrivate::SegmentFileMessagePrivate ( SegmentFileMessage *const  q)
explicit

Constructs a SegmentFileMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 295 of file segmentfilemessage.cpp.

297  , messageIndex(static_cast<MessageIndex>(-1))
298  , enabled(static_cast<bool>(-1))
299  , userProfilePrimaryKey(0xFFFFFFFF)
300  , leaderType(static_cast<SegmentLeaderboardType>(-1))
301  , leaderGroupPrimaryKey(0xFFFFFFFF)
302  , leaderActivityId(0xFFFFFFFF)
303  , defaultRaceLeader(0xFF)
304 {
305  globalMessageNumber = MesgNum::SegmentFile;
306 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
MessageIndex messageIndex
The SegmentFileMessage FIT message's messageIndex field.
SegmentLeaderboardType leaderType
The SegmentFileMessage FIT message's leaderType field.
quint32 userProfilePrimaryKey
The SegmentFileMessage FIT message's userProfilePrimaryKey field.
bool enabled
The SegmentFileMessage FIT message's enabled field.
quint32 leaderActivityId
The SegmentFileMessage FIT message's leaderActivityId field.
quint32 leaderGroupPrimaryKey
The SegmentFileMessage FIT message's leaderGroupPrimaryKey field.
quint8 defaultRaceLeader
The SegmentFileMessage FIT message's defaultRaceLeader field.
SegmentLeaderboardType
Garmin FIT SegmentLeaderboardType type.
Definition: types.h:2737
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~SegmentFileMessagePrivate()

SegmentFileMessagePrivate::~SegmentFileMessagePrivate ( )
virtual

Destroys the SegmentFileMessagePrivate object.

Definition at line 313 of file segmentfilemessage.cpp.

314 {
315 
316 }

Member Function Documentation

◆ setField()

bool SegmentFileMessagePrivate::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 318 of file segmentfilemessage.cpp.

320 {
321  switch (fieldId) {
322  case 254: // See Profile.xlsx::Messages:segment_file.messageIndex
323  if (!verify(data, baseType, 2, FitBaseType::Uint16, "segment_file.messageIndex")) return false;
324  this->messageIndex = static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
325  break;
326  case 1: // See Profile.xlsx::Messages:segment_file.fileUuid
327  if (!verify(data, baseType, 1, FitBaseType::String, "segment_file.fileUuid")) return false;
328  this->fileUuid = QString::fromUtf8(data);
329  break;
330  case 3: // See Profile.xlsx::Messages:segment_file.enabled
331  if (!verify(data, baseType, 0, FitBaseType::Byte, "segment_file.enabled")) return false;
332  this->enabled = static_cast<bool>(data.at(0));
333  break;
334  case 4: // See Profile.xlsx::Messages:segment_file.userProfilePrimaryKey
335  if (!verify(data, baseType, 4, FitBaseType::Uint32, "segment_file.userProfilePrimaryKey")) return false;
336  this->userProfilePrimaryKey = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
337  break;
338  case 7: // See Profile.xlsx::Messages:segment_file.leaderType
339  if (!verify(data, baseType, 1, FitBaseType::Enum, "segment_file.leaderType")) return false;
340  this->leaderType = static_cast<SegmentLeaderboardType>(data.at(0));
341  break;
342  case 8: // See Profile.xlsx::Messages:segment_file.leaderGroupPrimaryKey
343  if (!verify(data, baseType, 4, FitBaseType::Uint32, "segment_file.leaderGroupPrimaryKey")) return false;
344  this->leaderGroupPrimaryKey = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
345  break;
346  case 9: // See Profile.xlsx::Messages:segment_file.leaderActivityId
347  if (!verify(data, baseType, 4, FitBaseType::Uint32, "segment_file.leaderActivityId")) return false;
348  this->leaderActivityId = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
349  break;
350  case 10: // See Profile.xlsx::Messages:segment_file.leaderActivityIdString
351  if (!verify(data, baseType, 1, FitBaseType::String, "segment_file.leaderActivityIdString")) return false;
352  this->leaderActivityIdString = QString::fromUtf8(data);
353  break;
354  case 11: // See Profile.xlsx::Messages:segment_file.defaultRaceLeader
355  if (!verify(data, baseType, 1, FitBaseType::Uint8, "segment_file.defaultRaceLeader")) return false;
356  this->defaultRaceLeader = static_cast<quint8>(data.at(0));
357  break;
358  default:
359  qWarning() << "ignoring unknown segment_file message field number" << fieldId << bigEndian;
360  // Fall through to return true, as its still 'safe' to continue parsing data messages.
361  }
362  return true;
363 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
QString fileUuid
The SegmentFileMessage FIT message's fileUuid field.
QString leaderActivityIdString
The SegmentFileMessage FIT message's leaderActivityIdString field.

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ defaultRaceLeader

quint8 SegmentFileMessagePrivate::defaultRaceLeader

The SegmentFileMessage FIT message's defaultRaceLeader field.

Index for the Leader Board entry selected as the default race participant

Definition at line 101 of file segmentfilemessage_p.h.

◆ enabled

bool SegmentFileMessagePrivate::enabled

The SegmentFileMessage FIT message's enabled field.

Enabled state of the segment file

Definition at line 58 of file segmentfilemessage_p.h.

◆ fileUuid

QString SegmentFileMessagePrivate::fileUuid

The SegmentFileMessage FIT message's fileUuid field.

UUID of the segment file

Definition at line 51 of file segmentfilemessage_p.h.

◆ leaderActivityId

quint32 SegmentFileMessagePrivate::leaderActivityId

The SegmentFileMessage FIT message's leaderActivityId field.

Activity ID of each leader in the segment file

Definition at line 86 of file segmentfilemessage_p.h.

◆ leaderActivityIdString

QString SegmentFileMessagePrivate::leaderActivityIdString

The SegmentFileMessage FIT message's leaderActivityIdString field.

String version of the activity ID of each leader in the segment file. 21 characters long for each ID, express in decimal

Definition at line 94 of file segmentfilemessage_p.h.

◆ leaderGroupPrimaryKey

quint32 SegmentFileMessagePrivate::leaderGroupPrimaryKey

The SegmentFileMessage FIT message's leaderGroupPrimaryKey field.

Group primary key of each leader in the segment file

Definition at line 79 of file segmentfilemessage_p.h.

◆ leaderType

SegmentLeaderboardType SegmentFileMessagePrivate::leaderType

The SegmentFileMessage FIT message's leaderType field.

Leader type of each leader in the segment file

Definition at line 72 of file segmentfilemessage_p.h.

◆ userProfilePrimaryKey

quint32 SegmentFileMessagePrivate::userProfilePrimaryKey

The SegmentFileMessage FIT message's userProfilePrimaryKey field.

Primary key of the user that created the segment file

Definition at line 65 of file segmentfilemessage_p.h.


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