mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
refs #140 , macro to enable enums in CValueObject classes for DBus marshalling, and hence to be used woth tupels.
This commit is contained in:
@@ -198,4 +198,23 @@ namespace BlackMisc
|
|||||||
|
|
||||||
} // BlackMisc
|
} // BlackMisc
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Macro to make a ENUMs DBus streamable.
|
||||||
|
* \details Put this macro outside of any namespace, in the same header as the class defining the enumeration.
|
||||||
|
* \param ENUM The fully qualified name of the enumeration.
|
||||||
|
* \hideinitializer
|
||||||
|
* \ingroup Tuples
|
||||||
|
*/
|
||||||
|
#define BLACK_DBUS_ENUM_MARSHALLING(ENUM) \
|
||||||
|
namespace BlackMisc \
|
||||||
|
{ \
|
||||||
|
inline const QDBusArgument &operator >>(const QDBusArgument &arg, ENUM &enumType) \
|
||||||
|
{ \
|
||||||
|
uint e; \
|
||||||
|
arg >> e; \
|
||||||
|
enumType = static_cast<ENUM>(e); \
|
||||||
|
return arg; \
|
||||||
|
}; \
|
||||||
|
}
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user