Enabled coordinates for DBus

This commit is contained in:
Klaus Basan
2013-07-25 12:37:51 +02:00
parent 2fc08a0376
commit 7316980a5c
14 changed files with 196 additions and 17 deletions

View File

@@ -24,6 +24,33 @@ class CMatrix3x1; // forward declaration
template <class ImplVector> class CVector3DBase : public CBaseStreamStringifier
{
/*!
* \brief Unmarshalling operator >>, DBus to object
* \param argument
* \param uc
* \return
*/
friend const QDBusArgument &operator>>(const QDBusArgument &argument, ImplVector &uc) {
// If I do not have the method here, DBus metasystem tries to stream against
// a container: inline const QDBusArgument &operator>>(const QDBusArgument &arg, Container<T> &list)
// Once someone solves this, this methods should go and the
// CBaseStreamStringifier signature should be used
CBaseStreamStringifier &sf = uc;
return argument >> sf;
}
/*!
* \brief Marshalling operator <<, object to DBus
* \param argument
* \param pq
* \return
*/
friend QDBusArgument &operator<<(QDBusArgument &argument, const ImplVector &uc)
{
const CBaseStreamStringifier &sf = uc;
return argument << sf;
}
private:
/*!
* \brief Easy access to derived class (CRTP template parameter)
@@ -81,6 +108,18 @@ protected:
*/
virtual QString stringForConverter() const;
/*!
* \brief Unmarshall from Dbus
* \param argument
*/
virtual void unmarshallFromDbus(const QDBusArgument &argument);
/*!
* \brief Marshall to Dbus
* \param argument
*/
virtual void marshallToDbus(QDBusArgument &argument) const;
public:
// getter and setters are implemented in the derived classes
@@ -416,6 +455,11 @@ public:
v.round();
return v;
}
/*!
* \brief Register metadata
*/
static void registerMetadata();
};
} // namespace