QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
abstractdatamessage.cpp File Reference

Defines the AbstractDataMessage, and AbstractDataMessagePrivate classes. More...

#include "abstractdatamessage.h"
#include "abstractdatamessage_p.h"
#include <QDebug>
Include dependency graph for abstractdatamessage.cpp:

Go to the source code of this file.

Functions

bool verifyBaseType (const FitBaseType actual, const FitBaseType expected, const char *name)
 
bool verifyDataSize (const QByteArray &data, const int expectedSize, const char *name)
 

Detailed Description

Defines the AbstractDataMessage, and AbstractDataMessagePrivate classes.

Definition in file abstractdatamessage.cpp.

Function Documentation

◆ verifyBaseType()

bool verifyBaseType ( const FitBaseType  actual,
const FitBaseType  expected,
const char *  name 
)
inline

Verifies that actual matches expected, and reports a warning if not.

Parameters
actualActual base type.
expectedExpected base type.
nameName of the field being verfied.
Returns
true if actual and expected match, false otherwise.

Definition at line 161 of file abstractdatamessage.cpp.

162 {
163  if (actual == expected) return true;
164  qWarning() << name << "has base type" << actual << "but should be" << expected;
165  return false;
166 }

Referenced by AbstractDataMessagePrivate::verify().

Here is the caller graph for this function:

◆ verifyDataSize()

bool verifyDataSize ( const QByteArray &  data,
const int  expectedSize,
const char *  name 
)
inline

Verifies that the size of data matches expectedSize, and reports a warning if not.

Parameters
dataData to verify the size of.
expectedSizeExepcted size of data.
nameName of the field being verified.
Returns
true if data has expectedSize bytes, false otherwise.

Definition at line 179 of file abstractdatamessage.cpp.

180 {
181  if (data.size() == expectedSize) return true;
182  qWarning() << name << "size is" << data.size() << "but should be" << expectedSize;
183  return false;
184 }

Referenced by AbstractDataMessagePrivate::verify().

Here is the caller graph for this function: