Enabled DBus with matrix classes, noticed issue with QList Signature (ad, addddd)

This commit is contained in:
Klaus Basan
2013-07-25 00:10:50 +02:00
parent 9b2cb3b517
commit 2fc08a0376
17 changed files with 225 additions and 15 deletions

View File

@@ -9,6 +9,7 @@
#include "blackmisc/basestreamstringifier.h"
#include "blackmisc/mathvector3dbase.h"
#include <QGenericMatrix>
#include <QDBusMetaType>
namespace BlackMisc
{
@@ -49,6 +50,34 @@ protected:
*/
QString stringForConverter() const;
/*!
* \brief Stream to DBus
* \param argument
*/
virtual void marshallToDbus(QDBusArgument &argument) const {
const QList<double> l = this->toList();
// there is an issue with the signature of QList, so I use
// individual values
foreach(double v, l) {
argument << v;
}
}
/*!
* \brief Stream from DBus
* \param argument
*/
virtual void unmarshallFromDbus(const QDBusArgument &argument) {
QList<double> list;
double v;
while(!argument.atEnd()) {
argument >> v;
list.append(v);
}
this->fromList(list);
}
public:
/*!
* \brief Default constructor
@@ -75,6 +104,18 @@ public:
*/
virtual ~CMatrixBase() {}
/*!
* \brief List of values
* \return
*/
const QList<double> toList() const;
/*!
* \brief List of values
* \return
*/
void fromList(const QList<double> &list);
/*!
* \brief Equal operator ==
* \param otherMatrix
@@ -264,6 +305,11 @@ public:
*/
bool isZero() const;
/*!
* \brief Each cell gets a unique index (used primarily for testing)
*/
void setCellIndex();
/*!
* \brief Is identity matrix? Epsilon considered.
* \return
@@ -342,6 +388,11 @@ public:
return this->getElement(row, column);
}
/*!
* \brief Register metadata
*/
static void registerMetadata();
private:
/*!
* \brief Check range of row / column