mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #199 , moved operator for enum/DBus to own file. This operator is not CValueObject specific.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef BLACKMISC_VALUEOBJECT_H
|
||||
#define BLACKMISC_VALUEOBJECT_H
|
||||
|
||||
#include "dbus.h"
|
||||
#include "tuple.h"
|
||||
#include "json.h"
|
||||
#include <QtDBus/QDBusMetaType>
|
||||
@@ -15,24 +16,6 @@
|
||||
#include <type_traits>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
/*!
|
||||
* Non-member non-friend operator for streaming enums to QDBusArgument.
|
||||
*
|
||||
* \param argument
|
||||
* \param enumType
|
||||
* \return
|
||||
* \remarks Currently outside namespace for OSX build, see https://dev.vatsim-germany.org/issues/184
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
// forward declaration
|
||||
|
||||
Reference in New Issue
Block a user