mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #140, removed MACRO DBUS_ENUM_MARSHALLING, changed to template
discussed in https://dev.vatsim-germany.org/issues/140#change-864
This commit is contained in:
@@ -297,6 +297,22 @@ namespace BlackMisc
|
||||
return argument >> static_cast<CValueObject &>(valueObject);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Non-member non-friend operator for streaming enums to QDBusArgument.
|
||||
*
|
||||
* \param argument
|
||||
* \param enumType
|
||||
* \return
|
||||
*/
|
||||
template <class ENUM> typename std::enable_if<std::is_enum<ENUM>::value, QDBusArgument>::type const &
|
||||
operator>>(const QDBusArgument &argument, ENUM &enumType)
|
||||
{
|
||||
uint e;
|
||||
argument>> e;
|
||||
enumType = static_cast<ENUM>(e);
|
||||
return argument;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Non-member non-friend operator for streaming T objects from QDBusArgument.
|
||||
* Needed because we can't rely on the friend operator in some cases due to
|
||||
|
||||
Reference in New Issue
Block a user