Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qobject_impl.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef Q_QDOC
0005 
0006 #ifndef QOBJECT_H
0007 #error Do not include qobject_impl.h directly
0008 #endif
0009 
0010 #if 0
0011 #pragma qt_sync_skip_header_check
0012 #pragma qt_sync_stop_processing
0013 #endif
0014 
0015 QT_BEGIN_NAMESPACE
0016 
0017 
0018 namespace QtPrivate {
0019     /*
0020         Logic to statically generate the array of qMetaTypeId
0021         ConnectionTypes<FunctionPointer<Signal>::Arguments>::types() returns an array
0022         of int that is suitable for the types arguments of the connection functions.
0023 
0024         The array only exist of all the types are declared as a metatype
0025         (detected using the TypesAreDeclaredMetaType helper struct)
0026         If one of the type is not declared, the function return 0 and the signal
0027         cannot be used in queued connection.
0028     */
0029     template <typename ArgList> struct TypesAreDeclaredMetaType { enum { Value = false }; };
0030     template <> struct TypesAreDeclaredMetaType<List<>> { enum { Value = true }; };
0031     template <typename Arg, typename... Tail> struct TypesAreDeclaredMetaType<List<Arg, Tail...> >
0032     { enum { Value = QMetaTypeId2<Arg>::Defined && TypesAreDeclaredMetaType<List<Tail...>>::Value }; };
0033 
0034     template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value > struct ConnectionTypes
0035     { static const int *types() { return nullptr; } };
0036     template <> struct ConnectionTypes<List<>, true>
0037     { static const int *types() { return nullptr; } };
0038     template <typename... Args> struct ConnectionTypes<List<Args...>, true>
0039     { static const int *types() { static const int t[sizeof...(Args) + 1] = { (QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id())..., 0 }; return t; } };
0040 }
0041 
0042 
0043 QT_END_NAMESPACE
0044 
0045 #endif