mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #411, MS diff to reduce DBus signature length
This commit is contained in:
committed by
Mathew Sutcliffe
parent
210fb5a530
commit
afdf8eccad
@@ -332,17 +332,25 @@ namespace BlackMisc
|
||||
template <class T, class... Ts>
|
||||
static void marshallImpl(QDBusArgument &arg, const T &head, const Ts &... tail)
|
||||
{
|
||||
arg << head;
|
||||
marshallHelper(arg, head, 0);
|
||||
marshallImpl(arg, tail...);
|
||||
}
|
||||
template <class T, typename std::enable_if<std::is_base_of<CEmpty, T>::value, int>::type = 0>
|
||||
static void marshallHelper(QDBusArgument &arg, const T &val, int) { static_cast<const typename T::CValueObject &>(val).marshallToDbus(arg); }
|
||||
template <class T>
|
||||
static void marshallHelper(QDBusArgument &arg, const T &val, ...) { arg << val; }
|
||||
|
||||
static void unmarshallImpl(const QDBusArgument &) {}
|
||||
template <class T, class... Ts>
|
||||
static void unmarshallImpl(const QDBusArgument &arg, T &head, Ts &... tail)
|
||||
{
|
||||
arg >> head;
|
||||
unmarshallHelper(arg, head, 0);
|
||||
unmarshallImpl(arg, tail...);
|
||||
}
|
||||
template <class T, typename std::enable_if<std::is_base_of<CEmpty, T>::value, int>::type = 0>
|
||||
static void unmarshallHelper(const QDBusArgument &arg, T &val, int) { static_cast<typename T::CValueObject &>(val).unmarshallFromDbus(arg); }
|
||||
template <class T>
|
||||
static void unmarshallHelper(const QDBusArgument &arg, T &val, ...) { arg >> val; }
|
||||
|
||||
static void debugImpl(QDebug) {}
|
||||
template <class T, class... Ts>
|
||||
|
||||
@@ -427,6 +427,7 @@ namespace BlackMisc
|
||||
return BaseOrDummy::isA(metaTypeId);
|
||||
}
|
||||
|
||||
public:
|
||||
//! Marshall to DBus
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user