1 #ifndef QTDATASYNC_HELPERTYPES_H 2 #define QTDATASYNC_HELPERTYPES_H 6 #include <QtCore/qobject.h> 8 #include "QtDataSync/qtdatasync_global.h" 11 namespace __helpertypes {
13 template <
class T,
class Enable =
void>
14 struct is_gadget :
public std::false_type {};
17 struct is_gadget<T, typename T::QtGadgetHelper> :
public std::true_type {};
20 struct is_object :
public std::false_type {};
23 struct is_object<T*> :
public std::is_base_of<QObject, T> {};
26 struct is_storable :
public is_gadget<T> {};
29 struct is_storable<T*> :
public std::is_base_of<QObject, T> {};
34 #define QTDATASYNC_STORE_ASSERT(T) static_assert(__helpertypes::is_storable<T>::value, "Only Q_GADGETS or pointers to QObject extending classes can be stored") 36 #endif // QTDATASYNC_HELPERTYPES_H The primary namespace of the QtDataSync library.